Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

PxConfigForceEmptySection(), PxConfigForceEmptySectionCx()

Create an empty section in a configuration file

Synopsis:

#include <photon/PxProto.h>

int PxConfigForceEmptySection( const char *section );

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

Arguments:

cx
PxConfigForceEmptySectionCx() only. The configuration file handle for the file you want to write to. This handle is returned by PxConfigOpenCx().
section
The section to create.
If section already exists, it becomes the current section, and its entries are left intact. If section doesn't exist, the function creates it and makes it the current section.

Library:

phexlib

Description:

These functions create an empty section section if one doesn't exist.


Note: The configuration file must have been opened by PxConfigOpen*() with a mode of PXCONFIG_WRITE.

Normally sections are created as necessary by the PxConfigWrite*() functions to hold entries, but sometimes the mere presence of a configuration section conveys application information. The new section is made the internal current section.

PxConfigForceEmptySection() writes to the currently open configuration file opened by PxConfigOpen(), while PxConfigForceEmptySectionCx() writes to the configuration file indicated by cx.

Returns:

Pt_TRUE
The section is created or exists.
Pt_FALSE
Otherwise.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PxConfigDeleteSection*(), PxConfigOpen*()