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

PxConfigWriteString(), PxConfigWriteStringCx()

Write a string parameter in a configuration file

Synopsis:

#include <photon/PxProto.h>

int PxConfigWriteString( const char *section,
                         const char *entry,
                         int format,
                         const char *value );

int PxConfigWriteStringCx(  PxCfgContext_t *cx,
                            const char *section,
                            const char *entry,
                            int format,
                            const char *value );

Arguments:

cx
PxConfigWriteStringCx() only. The configuration file handle for the file you want to write to. This handle is returned by PxConfigOpenCx().
section
The section to write value to.
If section matches a valid section name, it becomes the current section. If section is NULL, the function writes to the current section. If section doesn't exist, the function creates it and makes it the current section.
entry
The entry to write value to. If the entry already exists in the current section, it's overwritten; otherwise, it's added to the end of the section.
format
This parameter must be PXCONFIG_FMT_STRING.
value
The value the function writes to the file. The string must not contain a \n

Library:

phexlib

Description:

These functions write a string parameter in the specified section and entry of the configuration file.


Note:

You can write a single comment line in the section by specifying "#" for entry and the comment for value. For example:

PxConfigWriteString( "My section", "#", PXCONFIG_FMT_STRING,
                     "This is a comment");

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

Returns:

Pt_TRUE if the entry is written, otherwise Pt_FALSE

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PxConfigOpen*(), PxConfigReadBool*(), PxConfigReadChar*(), PxConfigReadDouble*(), PxConfigReadInt*(), PxConfigReadLLong*(), PxConfigReadLong*(), PxConfigReadShort*(), PxConfigReadString*(), PxConfigWriteBool*(), PxConfigWriteChar*(), PxConfigWriteDouble*(), PxConfigWriteInt*(), PxConfigWriteLLong*(), PxConfigWriteLong*(), PxConfigWriteShort*()