Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

Configuration

Exposes values from MACS configuration file. More...

Functions

char * macs_get_config (const void *ctxp, const char *key,...)
 Fetch a configuration value.

char ** macs_get_configs (const void *ctxp, int *nodes, const char *key,...)
 Fetch several configuration values.

char ** macs_get_methods (const void *ctxp, int server)
 Fetch a list of available methods.


Detailed Description

Exposes values from MACS configuration file.


Function Documentation

char* macs_get_config const void *    ctxp,
const char *    key,
...   
 

Fetch a configuration value.

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
key  A NULL-terminated list of strings which make up the key.
Returns:
The value associated with the key, or NULL if the key was not found. Should be free()d
Expose key/value pairs stored from the configuration file. Example usage:
 void showLIA() {
   char *value;
   fputs("(normal) Fetching cgi/LIA:",stderr);
   value=macs_get_config("cgi","LIA",NULL);
   if (!value) { fputs("No cgi/LIA found.\n",stderr); return; }
   fprintf(stderr,"%s\n",value);
   free(value);
 }

char** macs_get_configs const void *    ctxp,
int *    nodes,
const char *    key,
...   
 

Fetch several configuration values.

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
nodes  The number of values in the array will be stored here.
key  A NULL-terminated list of strings which make up the key.
Returns:
On success, a NULL-terminated array of strings, or NULL if the key was not found. Each string, and the array, should be free()d
Expose all values of named configuration array. Example usage:
 void showSFSs() {
   char **values;
   int nodes, i;
   fputs("(array) Fetching SFS/p",stderr);
   values=macs_get_configs(ctxp,&nodes,"SFS","p",NULL);
   if (!values) { fputs("No SFS/p found.\n",stderr); return; }
   fprintf(stderr,"(%d):",nodes);
   for (i=0; i < nodes; i++) {
     fprintf(stderr,"%s%s",values[i],i==nodes-1?"\n":",");
     free(values[i]);
   }
   if (!values) return;
   free(values);
 }

char** macs_get_methods const void *    ctxp,
int    server
 

Fetch a list of available methods.

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
server  The server whose methods to list. One of MACS_AUS, MACS_UPS or MACS_ATS.
Returns:
On success, a NULL-terminated array of strings, or NULL if there was an error. Each string, and the array, should be free()d


Generated on Tue Oct 8 22:15:53 2002 for MACS Client C API by doxygen1.2.16