この関数は、指定したパーサー・オブジェクトについて、 入力メッセージのビット・ストリーム表現が含まれるバッファーのサイズを取得します。
CciSize cpiBufferSize(
int* returnCode,
CciParser* parser);
成功した場合、バッファーのサイズ (バイト単位) が戻されます。 エラーが発生した場合は、ゼロ (CCI_NULL_ADDR) が戻され、returnCode がエラーの理由を示します。
この例は、サンプル・ノード・ファイル BipSampPluginParser.c から取られています。
int cpiParseBufferEncoded(
CciParser* parser,
CciContext* context,
int encoding,
int ccsid
){
PARSER_CONTEXT_ST* pc = (PARSER_CONTEXT_ST *)context ;
int rc;
/* Get a pointer to the message buffer and set the offset */
pc->iBuffer = (void *)cpiBufferPointer(&rc, parser);
pc->iIndex = 0;
/* Save the format of the buffer */
pc->iEncoding = encoding;
pc->iCcsid = ccsid;
/* Save size of the buffer */
pc->iSize = cpiBufferSize(&rc, parser);