PxConfigNextEntry(), PxConfigNextEntryCx()

Get the next entry in the current section

Synopsis:

#include <photon/PxProto.h>

const char *PxConfigNextEntry( char **value );

const char *PxConfigNextEntryCx( PxCfgContext_t *cx,
                                  char **value );

Arguments:

cx
PxConfigNextEntryCx() only. The configuration file handle for the file you want to get the next string in. This handle is returned by PxConfigOpenCx().
value
If passed in as a non-NULL pointer, the function fills this in with pointer to a string containing the value of the next entry.

Library:

phexlib

Description:

These functions return the next entry in the current section as a pointer to a string. A pointer to the entry name is returned, and value is filled in with a pointer to the string containing its configuration value. This may be used to process a configuration section consisting of unknown entries, but where each entry is to be processed in a similar fashion.


Note: These functions are similar to PxConfigNextString*(), but because they don't copy the string, they are faster.

If there is no current section (for example, if the file has just been opened), PxConfigNextEntry*() seeks to the beginning of the first section, and returns the first entry.

Returns:

A string containing the next entry name within the current section if one exists, NULL otherwise.


Note: If PxConfigNextEntry*() detects the end of the section, it returns NULL. If you call PxConfigNextEntry() again, it gets the next entry in the next section.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PxConfigFirstSection*(), PxConfigNextEntry*(), PxConfigNextSection*(), PxConfigOpen*(), PxConfigSection*()