Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdlib.h>
    char *getenv( const char *name );
    wchar_t *_wgetenv( const wchar_t *name );

Description:
    The getenv function searches the environment list for an entry matching
    the string pointed to by name.  The matching is case-insensitive; all
    lowercase letters are treated as if they were in upper case.

    Entries can be added to the environment list with the DOS set command or
    with the  putenv or  setenv functions.  All entries in the environment
    list can be displayed by using the DOS set command with no arguments.

    To assign a string to a variable and place it in the environment list:


             C>SET INCLUDE=C:\WATCOM\H

    To see what variables are in the environment list, and their current
    assignments:


             C>SET
             COMSPEC=C:\COMMAND.COM
             PATH=C:\;C:\WATCOM
             INCLUDE=C:\WATCOM\H

    _wgetenv is a wide-character version of getenv the argument and return
    value of _wgetenv are wide-character strings.

Returns:
    The getenv function returns a pointer to the string assigned to the
    environment variable if found, and NULL if no match was found.  Note:
     the value returned should be duplicated if you intend to modify the
    contents of the string.

Example:
    #include <stdio.h>
    #include <stdlib.h>

    void main()
      {
        char *path;

        path = getenv( "INCLUDE" );
        if( path != NULL )
          printf( "INCLUDE=%s\n", path );
      }

Classification:
    getenv is ANSI, _wgetenv is not ANSI

Systems:
     getenv - All, Netware

    _wgetenv - DOS, Windows, Win386, Win32, QNX/16, OS/2 1.x(all), OS/2-32

See Also:
    clearenv, exec Functions, putenv, _searchenv, setenv, spawn Functions,
    system

See Also: clearenv

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson