[Previous] [Contents] [Index] [Next]


Read a Boolean value from a configuration file


#include <photon/PxProto.h>

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


PxConfigReadBool() reads a Boolean parameter from the specified section and entry of the configuration file. If section is NULL, the function reads the value from entry in the current section.

PxConfigReadBool() accepts the (case-insensitive) values ON or OFF, YES or NO, TRUE or FALSE, and stores the integer equivalent (zero or nonzero) in *value. If any other value is given (or if none is given), the default value dflt is put into *value instead. If the required section or entry doesn't exist, the default value is stored in *value.


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



Interrupt handler No
Signal handler No
Thread No

See also:

PxConfigOpen(), PxConfigReadChar(), PxConfigReadInt(), PxConfigReadLong(), PxConfigReadShort(), PxConfigReadString(), PxConfigWriteBool(), PxConfigWriteChar(), PxConfigWriteInt(), PxConfigWriteLong(), PxConfigWriteShort(), PxConfigWriteString()

[Previous] [Contents] [Index] [Next]