#ifdef __cplusplus extern "C" { #endif #ifndef kGenericError #define kGenericError -1 #endif extern char *gErrorMessage; void SetErrorMessage(const char *theErrorMessage); void SetErrorMessageAndAppendLongInt(const char *theErrorMessage,const long theLongInt); void SetErrorMessageAndCStrAndLongInt(const char *theErrorMessage,const char * theCStr,const long theLongInt); void SetErrorMessageAndCStr(const char *theErrorMessage,const char * theCStr); void AppendCStrToErrorMessage(const char *theErrorMessage); void AppendLongIntToErrorMessage(const long theLongInt); char *GetErrorMessage(void); OSErr GetErrorMessageInNewHandle(Handle *inoutHandle); OSErr GetErrorMessageInExistingHandle(Handle inoutHandle); OSErr AppendErrorMessageToHandle(Handle inoutHandle); #ifdef __EXCEPTIONS_ENABLED__ void ThrowErrorMessageException(void); #endif // A bunch of evil macros that would be uneccessary if I were always using C++ ! #define SetErrorMessageAndBailIfNil(theArg,theMessage) \ { \ if (theArg == nil) \ { \ SetErrorMessage(theMessage); \ errCode = kGenericError; \ goto EXITPOINT; \ } \ } #define SetErrorMessageAndBail(theMessage) \ { \ SetErrorMessage(theMessage); \ errCode = kGenericError; \ goto EXITPOINT; \ } #define SetErrorMessageAndLongIntAndBail(theMessage,theLongInt) \ { \ SetErrorMessageAndAppendLongInt(theMessage,theLongInt); \ errCode = kGenericError; \ goto EXITPOINT; \ } #define SetErrorMessageAndLongIntAndBailIfError(theErrCode,theMessage,theLongInt) \ { \ if (theErrCode != noErr) \ { \ SetErrorMessageAndAppendLongInt(theMessage,theLongInt); \ errCode = theErrCode; \ goto EXITPOINT; \ } \ } #define SetErrorMessageCStrLongIntAndBailIfError(theErrCode,theMessage,theCStr,theLongInt) \ { \ if (theErrCode != noErr) \ { \ SetErrorMessageAndCStrAndLongInt(theMessage,theCStr,theLongInt); \ errCode = theErrCode; \ goto EXITPOINT; \ } \ } #define SetErrorMessageAndCStrAndBail(theMessage,theCStr) \ { \ SetErrorMessageAndCStr(theMessage,theCStr); \ errCode = kGenericError; \ goto EXITPOINT; \ } #define SetErrorMessageAndBailIfError(theErrCode,theMessage) \ { \ if (theErrCode != noErr) \ { \ SetErrorMessage(theMessage); \ errCode = theErrCode; \ goto EXITPOINT; \ } \ } #define SetErrorMessageAndLongIntAndBailIfNil(theArg,theMessage,theLongInt) \ { \ if (theArg == nil) \ { \ SetErrorMessageAndAppendLongInt(theMessage,theLongInt); \ errCode = kGenericError; \ goto EXITPOINT; \ } \ } #define BailIfError(theErrCode) \ { \ if ((theErrCode) != noErr) \ { \ goto EXITPOINT; \ } \ } #define SetErrCodeAndBail(theErrCode) \ { \ errCode = theErrCode; \ \ goto EXITPOINT; \ } #define SetErrorCodeAndMessageAndBail(theErrCode,theMessage) \ { \ SetErrorMessage(theMessage); \ errCode = theErrCode; \ goto EXITPOINT; \ } #define BailNow() \ { \ errCode = kGenericError; \ goto EXITPOINT; \ } #ifdef __cplusplus } #endif -12 18:29:28 +0000 Cleanup' href='/sra/rpki.net/commit/Makefile?id=38fe69c217faefc2b3df6deeef636d679389f7dd'>38fe69c2</a></span> </pre></div><div class='alt'><pre><span class='sha1'><a title='author Rob Austein <sra@hactrn.net> 2008-01-08 21:52:16 +0000 committer Rob Austein <sra@hactrn.net> 2008-01-08 21:52:16 +0000 Export target' href='/sra/rpki.net/commit/Makefile?id=e3267ab194fe2e3368121430e2acbe125ae9de6b'>e3267ab1</a></span> </pre></div><div class='alt'><pre><span class='sha1'><a title='author Rob Austein <sra@hactrn.net> 2008-04-20 04:44:49 +0000 committer Rob Austein <sra@hactrn.net> 2008-04-20 04:44:49 +0000 make test' href='/sra/rpki.net/commit/Makefile?id=30e5c6cca080bc7c64dac004f523d70f3ed56391'>30e5c6cc</a></span> </pre></div><div class='alt'><pre><span class='sha1'><a title='author Rob Austein <sra@hactrn.net> 2008-01-08 21:52:16 +0000 committer Rob Austein <sra@hactrn.net> 2008-01-08 21:52:16 +0000 Export target' href='/sra/rpki.net/commit/Makefile?id=e3267ab194fe2e3368121430e2acbe125ae9de6b'>e3267ab1</a></span> </pre></div><div class='alt'><pre><span class='sha1'><a title='author Rob Austein <sra@hactrn.net> 2008-01-08 21:52:16 +0000 committer Rob Austein <sra@hactrn.net> 2008-01-08 21:52:16 +0000 Export target' href='/sra/rpki.net/commit/Makefile?id=e3267ab194fe2e3368121430e2acbe125ae9de6b'>e3267ab1</a></span> </pre></div></td> <td class='linenumbers'><div class='alt'><pre><a id='n1' href='#n1'>1</a> <a id='n2' href='#n2'>2</a> </pre></div><div class='alt'><pre><a id='n3' href='#n3'>3</a> </pre></div><div class='alt'><pre><a id='n4' href='#n4'>4</a> </pre></div><div class='alt'><pre><a id='n5' href='#n5'>5</a> </pre></div><div class='alt'><pre><a id='n6' href='#n6'>6</a> </pre></div><div class='alt'><pre><a id='n7' href='#n7'>7</a> </pre></div><div class='alt'><pre><a id='n8' href='#n8'>8</a> <a id='n9' href='#n9'>9</a> </pre></div><div class='alt'><pre><a id='n10' href='#n10'>10</a> <a id='n11' href='#n11'>11</a> </pre></div><div class='alt'><pre><a id='n12' href='#n12'>12</a> <a id='n13' href='#n13'>13</a> </pre></div></td> <td class='lines'><div><div><div class='alt'><pre> </pre></div><div class='alt'><pre> </pre></div><div class='alt'><pre> </pre></div><div class='alt'><pre> </pre></div><div class='alt'><pre> </pre></div><div class='alt'><pre> </pre></div><div class='alt'><pre> </pre></div><div class='alt'><pre> </pre></div><div class='alt'><pre> </pre></div></div><pre><code>