CciSize cpiBufferSize( int* returnCode, CciParser* parser);
如果成功,返回缓冲区的大小(以字节为单位)。如果发生错误,则会返回零(CCI_NULL_ADDR),并且 returnCode 会表明发生错误的原因。
此示例取自样本节点文件 BipSampPluginParser.c(428 行到 452 行):
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);