[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Conf4CParser

Conf4CParser - Provides a configuration-file parsing function.

Synopsis

#include "conf4cfile.h"
#include "conf4cfileattrib.h"

struct Conf4CParser;

Conf4CParser *		conf4c_parser_new			(Conf4CFile *c4cf,
					 			 Conf4CFileAttrib *c4cfattrib);
int			conf4c_parser_parse			(Conf4CParser *c4cp,
								 const unsigned int instances,
								 const unsigned int entries);
Conf4CFile *		conf4c_parser_get_conf4cfile		(Conf4CParser *c4cp);
Conf4CFileAttrib *	conf4c_parser_get_conf4cfileattrib	(Conf4CParser *c4cp);

Description

The Conf4CParser is provided to separate the actual configuration file parsing algorithm from the remainder of the library; allowing for the user to implement their own parsing function (perhaps necessary for customizations and extensions to the Conf4CFileAttrib struct).

Details

Conf4CParser

struct Conf4CParser;
This should not be accessed directly. Use the accessor functions below.

conf4c_parser_new ()

Conf4CParser * conf4c_parser_new	(Conf4CFile *c4cf,
					 Conf4CFileAttrib *c4cfattrib);
Creates a new instance of Conf4CParser.

 
c4cf : 		the Conf4CFile to be populated by the parsing
c4cfattrib : 	the attributes of the configuration file (delimiter and comment definitions) that allow the file
			to be parsed; not to mention the file name of the configuration file

conf4c_parser_parse ()

int conf4c_parser_parse	(Conf4CParser *c4cp,
			 const unsigned int instances,
			 const unsigned int entries);
Parses the configuration file specified by the member variable c4cfattrib and stores the results in the second member: c4cf.

 
c4cp : a Conf4CParser
instances : the expected number of instances of each section type
entries : the expected number of name / value pairs per section instance
Returns : an int indicating success or error during the parse; 1 = success, 0 = error

conf4c_parser_get_conf4cfile ()

Conf4CFile * conf4c_parser_get_conf4cfile	(Conf4CParser *c4cp);
Returns the stored Conf4CFile (a useless function until after conf4c_parser_parse has been called).

conf4c_parser_get_conf4cfileattrib ()

Conf4CFileAttrib * conf4c_parser_get_conf4cfileattrib	(Conf4CParser *c4cp);
Returns the stored Conf4CFileAttrib.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated on October, 29 2004 using texi2html 1.70.