13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * IPRT - Error Info, Setters.
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync * Copyright (C) 2010-2014 Oracle Corporation
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * available from http://www.virtualbox.org. This file is free software;
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * you can redistribute it and/or modify it under the terms of the GNU
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * General Public License (GPL) as published by the Free Software
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * The contents of this file may alternatively be used under the terms
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * of the Common Development and Distribution License Version 1.0
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * VirtualBox OSE distribution, in which case the provisions of the
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * CDDL are applicable instead of those of the GPL.
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * You may elect to license modified versions of this file under the
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync * terms and conditions of either the GPL or the CDDL or both.
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync/*******************************************************************************
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync* Header Files *
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync*******************************************************************************/
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTDECL(int) RTErrInfoSet(PRTERRINFO pErrInfo, int rc, const char *pszMsg)
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync Assert((pErrInfo->fFlags & RTERRINFO_FLAGS_MAGIC_MASK) == RTERRINFO_FLAGS_MAGIC);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTStrCopy(pErrInfo->pszMsg, pErrInfo->cbMsg, pszMsg);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTDECL(int) RTErrInfoSetF(PRTERRINFO pErrInfo, int rc, const char *pszFormat, ...)
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTDECL(int) RTErrInfoSetV(PRTERRINFO pErrInfo, int rc, const char *pszFormat, va_list va)
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync Assert((pErrInfo->fFlags & RTERRINFO_FLAGS_MAGIC_MASK) == RTERRINFO_FLAGS_MAGIC);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTStrPrintfV(pErrInfo->pszMsg, pErrInfo->cbMsg, pszFormat, va);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTDECL(int) RTErrInfoAdd(PRTERRINFO pErrInfo, int rc, const char *pszMsg)
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync RTStrCat(pErrInfo->pszMsg, pErrInfo->cbMsg, pszMsg);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTDECL(int) RTErrInfoAddF(PRTERRINFO pErrInfo, int rc, const char *pszFormat, ...)
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsyncRTDECL(int) RTErrInfoAddV(PRTERRINFO pErrInfo, int rc, const char *pszFormat, va_list va)
b63da7c87ee97d237d799dc5d275a70a546b5588vboxsync Assert((pErrInfo->fFlags & RTERRINFO_FLAGS_MAGIC_MASK) == RTERRINFO_FLAGS_MAGIC);
13493ab7596e827b8d0caab2c89e635dd65f78f9vboxsync char *pszOut = (char *)memchr(pErrInfo->pszMsg, '\0', pErrInfo->cbMsg - 2);