cpiNextParserCodedCharSetId

Purpose

Optional function to return the coded character set ID (CCSID) of the data owned by the next parser class in the chain, if any.

Defined In Type Member
CPI_VFT Optional iFpNextParserCodedCharSetId

Syntax

int cpiNextParserCodedCharSetId(
  CciParser*   parser,
  CciContext*  context);

Parameters

parser
The address of the parser object (input).
context
The address of the plug-in context (input).

Return values

The CCSID of the data is returned. If it is not known, zero might be returned and a default CCSID will apply.

Sample

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

int cpiNextParserCodedCharSetId(
  CciParser*  parser,
  CciContext* context
){
  PARSER_CONTEXT_ST* pc = (PARSER_CONTEXT_ST *)context ;
  int                ccsid = 0;

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

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

  return ccsid;
}

Related concepts
User-defined parsers
User-defined extensions

Related tasks
Creating a parser in C

Related reference
cpiNextParserClassName
cpiNextParserEncoding
Parser implementation functions