Caution: This version of this document is no longer maintained. For the latest documentation, see

PxConfigSection(), PxConfigSectionCx()

Seek the start of a given section in a configuration file


#include <photon/PxProto.h>

int PxConfigSection( const char *section );

int PxConfigSectionCx(PxCfgContext_t *cx,
                      char const *section);


PxConfigSectionCx() only. The configuration file handle for the file you want to seek for a section in. This handle is returned by PxConfigOpenCx().
The name of a section you want to seek to.

Note: Section names must be an exact match—they must not be abbreviated and the match is case-sensitive. If there is more than one section with the same name, these functions seek to the first matched section in the file. Use PxConfigNextSection*() to find subsequent sections with the same name.




These functions seek to the start of the requested section, and return an indication of whether the section exists within the configuration file. These functions may be used to conditionally process an optional section block. Photon also uses it internally to locate a configuration entry; the section is made the internal current section.

If the requested section can't be found, the file pointer and current section remain untouched, and the function returns Pt_FALSE.


Pt_TRUE if the requested section exists, Pt_FALSE otherwise



Interrupt handler No
Signal handler No
Thread No

See also:

PxConfigDeleteSection*(), PxConfigFirstSection*(), PxConfigForceEmptySection*(), PxConfigNextEntry*(), PxConfigNextSection*(), PxConfigNextString*(), PxConfigOpen*()