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

PxConfigReadInt(), PxConfigReadIntCx()

Read an integer parameter from a configuration file

Synopsis:

#include <photon/PxProto.h>

int PxConfigReadInt( const char *section,
                     const char *entry,
                     int dflt,
                     int *value );

int PxConfigReadIntCx( PxCfgContext_t *cx,
                       const char *section,
                       const char *entry,
                       int dflt,
                       int *value );

Arguments:

cx
PxConfigReadIntCx() only. The configuration file handle for the file you want to read from. This handle is returned by PxConfigOpenCx().
section
The section to read a value from.
If section is NULL, the function reads the value from entry in the current section. If section is a valid section name, it becomes the current section.
entry
The entry to read the value from.
dflt
The default to store in value if the specified section or entry don't exist, or if the entry value is not a valid integer (see below).
value
A pointer to an int where the function stores the value it reads.

Library:

phexlib

Description:

These functions read an integer parameter from a configuration file.

The value can be signed. The characters after the sign determine the base:

Character(s): Base:
0x or 0X Hexadecimal
0 Octal
Other digits Decimal

PxConfigReadInt() reads from the currently open configuration file opened by PxConfigOpen(), while PxConfigReadIntCx() reads from the configuration file indicated by cx.

Returns:

Pt_TRUE if the required section/entry exists and the given value is valid, otherwise Pt_FALSE.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

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