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

Initialization

Library startup/shutdown, with automatic or manual configuration. More...

Defines

#define MACS_AUS   1
#define MACS_UPS   2
#define MACS_ATS   4
#define MACS_ALL   MACS_AUS | MACS_UPS | MACS_ATS

Functions

void * macs_init (const char *cf, int connect)
 Initializes the library.

const char * macs_cf (void *ctxp)
 Returns the loaded configuration file.

void macs_exit (void *ctxp)
 Deinitializes the library.

int macs_ping (const void *ctxp, const int servers)
 Ping servers.


Detailed Description

Library startup/shutdown, with automatic or manual configuration.


Define Documentation

#define MACS_AUS   1
 

Bit field to specify AUS action.

#define MACS_UPS   2
 

Bit field to specify UPS action.

#define MACS_ATS   4
 

Bit field to specify ATS action.

#define MACS_ALL   MACS_AUS | MACS_UPS | MACS_ATS
 

Bit field to specify action on all servers.


Function Documentation

void* macs_init const char *    cf,
int    connect
 

Initializes the library.

Parameters:
cf  The full path to the macs config file.
connect  Logical OR'ing of MACS_AUS, MACS_UPS, MACS_ATS and/or MACS_ALL. The selected servers will become connected on initialization. Others will only connect on demand.
Returns:
NULL on failure, or an opaque instance of the _macs_ctx macs context (passed as the first argument in other API calls) on success.

Todo:
there should be a way to evenly spread which server entry the children connect to. Right now, the first entry gets hit til it won't accept any more, then the second, etc.

Processes the configuration file. Conditionally establishes server connections. Loads configuration directives for exposure via macs_get_config() and macs_get_configs()

Examples:
sample.c.

const char* macs_cf void *    ctxp
 

Returns the loaded configuration file.

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
Returns:
The name of the currently loaded configuration file, or NULL if the library is not currently configured from a file.

void macs_exit void *    ctxp
 

Deinitializes the library.

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
Closes all connections, forgets all configuration, free()s used resources.
Examples:
sample.c.

int macs_ping const void *    ctxp,
const int    servers
 

Ping servers.

Parameters:
ctxp  An opaque _macs_ctx pointer from macs_init.
servers  Which servers to connect to. An ORing of MACS_AUS, MACS_UPS, MACS_ATS, and MACS_ALL.
Returns:
1 on success, 0 on failure
Pinging makes sure the connection is up, and the server is listening.


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