eyBuildLib API Reference : eyBuildLib
ebsession - session function
makeSessID( ) - create session ID
ebSessGC( ) - garbage collection by probability
ebSessInit( ) - initilize the session
ebSessSetHandle( ) - change the default session handle
ebSessStart( ) - prepare session environment
ebSessDestroy( ) - remove current session completely
ebSessEnd( ) - stop this session
ebSessIDRenew( ) - renew current session ID
ebSessGetID( ) - get current session ID
ebSessRegister( ) - register new session variable or update exist variable
ebSessUnregister( ) - remove specified session variable
ebGetSessVariable( ) - get session variable by key
ebSessIsRegister( ) - check specified session variable exist or not
session
ebsession.h
makeSessID( ) - create session ID
char * ebMakeSessID ( char * pbuf, /* where store to */ int len /* max length */ )
this routine is to create session ID, the buffer length should longer 1 byte than len to hold \0.
pinter to pbuf
ebSessGC( ) - garbage collection by probability
int ebSessGC (void)
this routine is to garbage collection by probability
OK/ERROR
ebSessInit( ) - initilize the session
int ebSessInit ( char * savepath, /* session struct */ int timeout, /* cookie timeout */ int gcprob /* default: 1000 */ )
this routine is to initilize the session
OK/ERROR
ebSessSetHandle( ) - change the default session handle
int ebSessSetHandle ( SOPEN open, /* hooks */ SCLOSE close, /* hooks */ SREAD read, /* hooks */ SWRITE write, /* hooks */ SDISTORY distory, /* hooks */ SRENAME rename, /* hooks */ SGC gc /* hooks */ )
this routine is to change the default session handle. by this routine you can customize private session (e.g. store into database)
OK/ERROR
ebSessStart( ) - prepare session environment
int ebSessStart (void)
this routine will load session from file system and prepare session environment. it will try to call ebSessInit( ) and set default setting if you don't call it before.
OK/ERROR
ebSessDestroy( ) - remove current session completely
int ebSessDestroy (void)
this routine will remove current session completely, it includes close session file, free session resource, remove session file and clean session cookies.
OK/ERROR
ebSessEnd( ) - stop this session
int ebSessEnd (void)
this routine is to flush session data into file system and free the session resource.
OK/ERROR
ebSessIDRenew( ) - renew current session ID
int ebSessIDRenew (void)
this routine is to renew current session ID
pointer to the renew session ID, or ""
ebSessGetID( ) - get current session ID
char * ebSessGetID (void)
this routine is to get current session ID
pointer to the current session ID, or ""
ebSessRegister( ) - register new session variable or update exist variable
int ebSessRegister ( const char * key, const char * value, size_t size )
this routine is to register new session variable or update exist variable. if size equal zero, it will look value as a string and count its length by strlen( ).
OK/ERROR
ebSessUnregister( ) - remove specified session variable
int ebSessUnregister ( const char * key )
this routine is to remove specified session variable
OK/ERROR
ebGetSessVariable( ) - get session variable by key
char * ebGetSessVariable ( const char * key, /* session key */ char * buff, /* where store into */ size_t size /* max size of buffer */ )
this routine is to get session variable by key. if buff is not NULL and size not equa zero, it will copy data to this buffer; otherwise, it will pointer to a global buffer (user must copy the return value as so as possiable).
pointer to the result, or ""
ebSessIsRegister( ) - check specified session variable exist or not
BOOL ebSessIsRegister ( const char * key )
this routine is to check specified session variable exist or not
TRUE/FALSE