例外をスローします。 例外は、指定した引数を例外データとして使用するメッセージ・ブローカー・インターフェースによってスローされます。
void cciThrowExceptionW( int* returnCode, CCI_EXCEPTION_TYPE type, const char* file, int line, const char* function, const CciChar* messageSource, int messageNumber, const CciChar* traceText, ... );
void raiseExceptionWithBroker(CciChar* helpfulText, char* file, /* which source file is broken */ int line, /* line in above file */ char* func /* function in above file */ ){ int rc = CCI_SUCCESS; /* Set up the message catalog name */ const char* catalog = "BIPv600"; /* Convert the catalog name to wide characters. * BIP_DEF_COMP_CCSID is UTF-8 on distributed and LATIN1 on z/OS */ int maxChars = strlen(catalog)+1; CciChar* wCatalog =(CciChar*)malloc(maxChars*sizeof(CciChar)); cciMbsToUcs(&rc, catalog, wCatalog, maxChars, BIP_DEF_COMP_CCSID); /* The above might have failed, but we are already throwing an exception, * so rc is now set to type success. */ rc = CCI_SUCCESS; /* Throw the exception. The explanation will be added as the traceText and * as an insert to the message */ cciThrowExceptionW(&rc, CCI_FATAL_EXCEPTION, file, line, func, wCatalog, BIP2111, helpfulText, helpfulText, (CciChar*)0 ); /* The above might have failed, but we are already throwing an exception, * so the value of rc is not important. */ }