ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

getenv.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   See COPYING in the top level directory
00003  * PROJECT:     ReactOS system libraries
00004  * FILE:        lib/crt/??????
00005  * PURPOSE:     Unknown
00006  * PROGRAMER:   Unknown
00007  * UPDATE HISTORY:
00008  *              25/11/05: Added license header
00009  */
00010 
00011 #include <precomp.h>
00012 //#undef environ
00013 
00014 /*
00015  * @implemented
00016  */
00017 char *getenv(const char *name)
00018 {
00019    char **environ;
00020    size_t length = strlen(name);
00021 
00022    for (environ = *__p__environ(); *environ; environ++)
00023    {
00024       char *str = *environ;
00025       char *pos = strchr(str,'=');
00026       if (pos && ((unsigned int)(pos - str) == length) && !_strnicmp(str, name, length))
00027          return pos + 1;
00028    }
00029    return NULL;
00030 }
00031 
00032 /*
00033  * @implemented
00034  */
00035 wchar_t *_wgetenv(const wchar_t *name)
00036 {
00037    wchar_t **environ;
00038    size_t length = wcslen(name);
00039 
00040    for (environ = *__p__wenviron(); *environ; environ++)
00041    {
00042       wchar_t *str = *environ;
00043       wchar_t *pos = wcschr(str, L'=');
00044       if (pos && ((unsigned int)(pos - str) == length) && !_wcsnicmp(str, name, length))
00045          return pos + 1;
00046    }
00047    return NULL;
00048 }

Generated on Fri May 25 2012 04:34:58 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.