eyBuildLib API Reference : eyBuildLib

ebthreadenv

NAME

ebthreadenv - thread private environment variable library

ROUTINES

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

DESCRIPTION

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,

NOTE

To enable this library, you should define macro HAVE_THREAD_SAFE. This library is conflicted with HAVE_FAST_CGI.

INCLUDE

ebthreadio.h


eyBuildLib : Routines

ebthreadIoInit( )

NAME

ebthreadIoInit( ) - add the thread environment variable list

SYNOPSIS

int ebThreadEnvInit (void)

DESCRIPTION

This routine initialize the thread standard I/O. The parameter stdfps is to providing spaces for the thread stdin/stdout, sterr.

RETURNS

OK/ERROR

SEE ALSO

ebthreadenv


eyBuildLib : Routines

ebThreadEnvCleanup( )

NAME

ebThreadEnvCleanup( ) - release all current thread environment variables

SYNOPSIS

int ebThreadEnvCleanup (void)

DESCRIPTION

This routine is to release all current thread environment variables and its relation resources.

RETURNS

OK/ERROR

SEE ALSO

ebthreadenv


eyBuildLib : Routines

ebThreadSetenv( )

NAME

ebThreadSetenv( ) - set an private environment variable into current thread

SYNOPSIS

int ebThreadSetenv
    (
    const char * name,        /* env name */
    const char * value        /* env value */
    )

DESCRIPTION

This routine add an private environment variable into current thread.

RETURNS

OK/ERROR

SEE ALSO

ebthreadenv


eyBuildLib : Routines

ebThreadUnSetenv( )

NAME

ebThreadUnSetenv( ) - unset an private environment variable

SYNOPSIS

int ebThreadUnSetenv
    (
    const char * name         /* env name */
    )

DESCRIPTION

This routine will unset an private environment variable from current thread. Just call ebThreadSetenv(name, "");

RETURNS

OK/ERROR

SEE ALSO

ebthreadenv


eyBuildLib : Routines

ebThreadGetenv( )

NAME

ebThreadGetenv( ) - get an private environment variable from current thread

SYNOPSIS

char * ebThreadGetenv
    (
    const char * name         /* env variable to get value for */
    )

DESCRIPTION

This routine searches the private environment list and returned the value, which is setted by "name=value"; otherwise it returns a NULL pointer.

RETURNS

A pointer to the string value, or a NULL pointer.

SEE ALSO

ebthreadenv


eyBuildLib : Routines

ebThreadPutenv( )

NAME

ebThreadPutenv( ) - set an private environment variable for current thread

SYNOPSIS

int ebThreadPutenv
    (
    const char * envstring    /* string to add to env */
    )

DESCRIPTION

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.

NOTE

Before thread exist you should call ebThreadDestroyEnvlib( ) to release all the exist private environment variables and its relation resources.

RETURNS

OK/ERROR

SEE ALSO

ebthreadenv


eyBuildLib : Routines

ebThreadShowEnv( )

NAME

ebThreadShowEnv( ) - list private environment variables of current thread

SYNOPSIS

int ebThreadShowEnv
    (
    FILE * fp
    )

DESCRIPTION

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.

RETURNS

OK/ERROR

SEE ALSO

ebthreadenv