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

session.c File Reference

Implementation details of the MACS Session API. Are you sure you don't want libmacs.h? More...

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "libmacs.h"
#include "common.h"

Functions

macs_sessionmacs_init (const char *cf, int svc)
 Initialize the library.

macs_sessionmacs_new_sess (macs_session *sess)
 Create a MACS session pointer.

int macs_exit (macs_session *sess)
 Free a session.

int macs_ping (macs_session *sess, int svc)
 Ping the services.

void _macs_clean_sess (macs_session *sess)
 Make existing sess as if it just came from macs_new_sess().


Variables

const char _macs_session_c_id [] = "$Id: session.c,v 1.7 2003/08/06 11:46:22 blake Exp $"


Detailed Description

Implementation details of the MACS Session API. Are you sure you don't want libmacs.h?

Id
session.c,v 1.7 2003/08/06 11:46:22 blake Exp

Function Documentation

macs_session* macs_init const char *    cf,
int    svc
 

Initialize the library.

Parameters:
cf The full path to the MACS config file.
svc If logical OR of MACS_MUX, MACS_AUS, MACS_RPS and MACS_ATS, will fail unless we can access the given services; otherwise, will only connect on demand.
Returns:
A pointer to a MACS session on success, NULL on failure
Processes the configuration file. Conditionally establishes service connections. Loads configuration directives for exposure via macs_get_config() and macs_get_configs()

macs_session* macs_new_sess macs_session   sess
 

Create a MACS session pointer.

Parameters:
sess An exisint MACS Session pointer
Returns:
A MACS Session pointer
Many MACS sessions can share the same basic configuration and service information. The session created by macs_new_sess() will use the same configuration file and service connections as the session passed as the argument. They will not share user or authentication information. The intended scenario is for macs_init() to create only the first session used by an application, and for macs_new_sess() to create the rest.

int macs_exit macs_session   sess
 

Free a session.

Parameters:
sess A MACS session pointer
Returns:
1 on success, 0 on failure
Frees all resources associated with the session. If no other sessions share them, additionally closes all connections and forgets all configuration.

NOTE that this API will not log a session out of MACS. If you wish to log a session out before closing it, see macs_logout() Logging a session out will make the session inaccessible from other applications.

int macs_ping macs_session   sess,
int    svc
 

Ping the services.

Parameters:
sess A MACS session
svc The service(s) to ping. Logical OR of MACS_MUX, MACS_AUS, MACS_RPS and MACS_ATS
Returns:
1 on success, 0 on failure
Pinging makes sure the connections are up, and the services are listening.

void _macs_clean_sess macs_session   sess
 

Make existing sess as if it just came from macs_new_sess().

Parameters:
sess A MACS session


Variable Documentation

const char _macs_session_c_id[] = "$Id: session.c,v 1.7 2003/08/06 11:46:22 blake Exp $"
 

identify yourself


Generated on Fri Aug 8 09:53:44 2003 for MACS Client C API by doxygen1.3-rc3