WebSphere Message Brokers
File: as08120_
Writer: Lorraine Waitt

Reference topic

This build: July 31, 2007 21:37:54

cpiNextParserClassName

Purpose

Optional function to return the name of the next parser class in the chain, if any. It allows the parser to return to the broker the name of the parser class that handles the next section, or remainder, of the message content. Normally, for messages having a simple format type, there is only one message content parser; it is not necessary to provide this function. For messages having a more complex format type with multiple message parsers, each parser should identify the next one in the chain by returning its name in the buffer parameter. The last parser in the chain must return an empty string.

If you specify the name of a parser supplied with WebSphere Message Broker, you must use the correct class name of the parser.

Defined In Type Member
CPI_VFT Optional iFpNextParserClassName

Syntax

void cpiNextParserClassName(
  CciParser*   parser,
  CciContext*  context,
  CciChar*     buffer,
  int          size);

Parameters

parser
The address of the parser object (input).
context
The address of the context owned by the parser object (input).
buffer
The address of a buffer into which the parser class name should be put (input).
size
The length, in bytes, of the buffer provided by the broker (input).

Return values

None.

Sample

This example is taken from the sample parser file BipSampPluginParser.c (lines 732 to 756).

void cpiNextParserClassName(
  CciParser*  parser,
  CciContext* context,
  CciChar*    buffer,
  int         size
){
  PARSER_CONTEXT_ST* pc = (PARSER_CONTEXT_ST *)context ;
  int                rc = 0;

  if (pc->trace) {
    fprintf(pc->tracefile, "PLUGIN: -> cpiNextParserClassName() parser=0x%x context=0x%x\n",
            parser, context);
    fflush(pc->tracefile);
  }

  /* Copy the name to the broker */
  CciCharNCpy(buffer, pc->iNextParserClassName, size);

  if (pc->trace) {
    fprintf(pc->tracefile, "PLUGIN: <- cpiNextParserClassName()\n");
    fflush(pc->tracefile);
  }

  return;
}
Related concepts
User-defined parsers
User-defined extensions overview
Related tasks
Creating a parser in C
Related reference
cpiNextParserCodedCharSetId
cpiNextParserEncoding
C parser implementation functions
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:37:54

as08120_ This topic's URL is: