Open a configuration file
#include <cfgopen.h> FILE * fcfgopen( const char * path, const char * mode, int location, const char * historical, char * namebuf, int nblen );
- The name of the configuration file that you want to open.
- A string that describes the mode to open in; see fopen() .
- Flags that describe how the path is constructed. See Search condition flags in the documentation for cfgopen().
- A optional file to open as a last resort if none of the criteria for finding the path is met. This string works like a path search order, and lets you search more than one location. You can also specify %H to substitute the hostname value into the string. Specify NULL to ignore this option.
- A buffer to save the pathname in. Specify NULL to ignore this option.
- The length of the buffer pointed to by namebuf. Specify 0 to ignore this option.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The fcfgopen() function is similar to cfgopen() with these exceptions:
- The CFGFILE_NOFD flag isn't valid.
- The values for flags described in open() aren't valid.
A valid fd if CFGFILE_NOFD isn't specified, a nonnegative value if CFGFILE_NOFD is specified, or -1 if an error occurs.