Si la función de implementación se proporciona en la estructura CPI_VFT, no se puede especificar cpiParseBuffer() ni cpiParseBufferEncoded(), porque la función cpiDefineParserClass() fallará con un código de retorno de CCI_INVALID_IMPL_FUNCTION.
Definida en | Tipo | Miembro |
CPI_VFT | Condicional | iFpParseBufferFormatted |
int cpiParseBufferFormatted( CciParser* parser, CciContext* context, int encoding, int ccsid, CciChar* set, CciChar* type, CciChar* format);
Tamaño (en bytes) de la parte restante del almacenamiento intermedio de mensaje del que el analizador se convierte en propietario.
Este ejemplo se ha tomado del archivo de analizador de ejemplo BipSampPluginParser.c (líneas 428 a 466):
int cpiParseBufferFormatted( CciParser* parser, CciContext* context, int encoding, int ccsid, CciChar* set, CciChar* type, CciChar* format ){ PARSER_CONTEXT_ST* pc = (PARSER_CONTEXT_ST *)context ; int rc; /* Obtener un puntero al almacenamiento intermedio de mensaje y establecer el desplazamiento */ pc->iBuffer = (void *)cpiBufferPointer(&rc, parser); pc->iIndex = 0; /* Guardar el formato del almacenamiento intermedio */ pc->iEncoding = encoding; pc->iCcsid = ccsid; /* Guardar el tamaño del almacenamiento intermedio */ pc->iSize = cpiBufferSize(&rc, parser); /* Cargar el primer byte en la corriente de datos */ pc->iCurrentCharacter = cpiBufferByte(&rc, parser, pc->iIndex); /* Establecer el elemento actual en el elemento raíz */ pc->iCurrentElement = cpiRootElement(&rc, parser); /* Restablecer el distintivo para asegurar que el análisis se restablece correctamente */ pc->iInTag = 0; if (pc->trace) { fprintf(pc->tracefile, "PLUGIN: <- cpiParseBufferFormatted() retvalue=%d\n", pc->iSize); fflush(pc->tracefile); }