eyBuildLib API Reference : eyBuildLib
ebthreadenv - thread private environment variable library
ebthreadIoInit( ) - add the thread environment variable list
ebThreadEnvCleanup( ) - release all current thread environment variables
ebThreadSetenv( ) - set an private environment variable into current thread
ebThreadUnSetenv( ) - unset an private environment variable
ebThreadGetenv( ) - get an private environment variable from current thread
ebThreadPutenv( ) - set an private environment variable for current thread
ebThreadShowEnv( ) - list private environment variables of current thread
This library support Win32, POSIX OS and VxWorks. The meaning of task of Vxworks is look as thread in other OS.
When you defined the macro HAVE_THREAD_ENV, putenv( )/getenv( ) will be replace into ebThreadPutenv( )/ebThreadGetenv( ). At the same time, you should add folloing C codes in your initialize code:
#include <ebenviron.h> genenvCallback = ebThreadGetenv; /* redefine getenv() */Those lines are to replace getenv( ) in CSP/eybuild library into ebThreadGetenv( ). Global variable genenvCallback defined in ebenviron.h,
To enable this library, you should define macro HAVE_THREAD_SAFE. This library is conflicted with HAVE_FAST_CGI.
ebthreadio.h
ebthreadIoInit( ) - add the thread environment variable list
int ebThreadEnvInit (void)
This routine initialize the thread standard I/O. The parameter stdfps is to providing spaces for the thread stdin/stdout, sterr.
OK/ERROR
ebThreadEnvCleanup( ) - release all current thread environment variables
int ebThreadEnvCleanup (void)
This routine is to release all current thread environment variables and its relation resources.
OK/ERROR
ebThreadSetenv( ) - set an private environment variable into current thread
int ebThreadSetenv ( const char * name, /* env name */ const char * value /* env value */ )
This routine add an private environment variable into current thread.
OK/ERROR
ebThreadUnSetenv( ) - unset an private environment variable
int ebThreadUnSetenv ( const char * name /* env name */ )
This routine will unset an private environment variable from current thread. Just call ebThreadSetenv(name, "");
OK/ERROR
ebThreadGetenv( ) - get an private environment variable from current thread
char * ebThreadGetenv ( const char * name /* env variable to get value for */ )
This routine searches the private environment list and returned the value, which is setted by "name=value"; otherwise it returns a NULL pointer.
A pointer to the string value, or a NULL pointer.
ebThreadPutenv( ) - set an private environment variable for current thread
int ebThreadPutenv ( const char * envstring /* string to add to env */ )
This routine sets an thread private environment variable to a value by altering an existing variable or creating a new one. The parameter points to a string of the form "name=value". If parameter value is a blank string, the exist variable will be removed.
Before thread exist you should call ebThreadDestroyEnvlib( ) to release all the exist private environment variables and its relation resources.
OK/ERROR
ebThreadShowEnv( ) - list private environment variables of current thread
int ebThreadShowEnv ( FILE * fp )
This routine is to list all private environment variables of current thread to specified stream. if fp equal to NULL, it will write into stdout of current thread.
OK/ERROR