Main Page | Data Structures | Directories | File List | Data Fields | Globals

os2compat.c File Reference

#include <stdlib.h>
#include <string.h>
#include <sys/param.h>

Go to the source code of this file.

Defines

#define OS2_AWARE

Functions

unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue)
char * _nl_getenv (const char *name)
 __attribute__ ((constructor))

Variables

char libintl_nl_default_dirname [MAXPATHLEN+1]
char * _nlos2_libdir = NULL
char * _nlos2_localealiaspath = NULL
char * _nlos2_localedir = NULL


Define Documentation

#define OS2_AWARE
 

Definition at line 19 of file os2compat.c.


Function Documentation

__attribute__ (constructor)   )  [static]
 

Definition at line 48 of file os2compat.c.

00050 {
00051   char *root = getenv ("UNIXROOT");
00052   char *gnulocaledir = getenv ("GNULOCALEDIR");
00053 
00054   _nlos2_libdir = gnulocaledir;
00055   if (!_nlos2_libdir)
00056     {
00057       if (root)
00058         {
00059           size_t sl = strlen (root);
00060           _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1);
00061           memcpy (_nlos2_libdir, root, sl);
00062           memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1);
00063         }
00064       else
00065         _nlos2_libdir = LIBDIR;
00066     }
00067 
00068   _nlos2_localealiaspath = gnulocaledir;
00069   if (!_nlos2_localealiaspath)
00070     {
00071       if (root)
00072         {
00073           size_t sl = strlen (root);
00074           _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1);
00075           memcpy (_nlos2_localealiaspath, root, sl);
00076           memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1);
00077         }
00078      else
00079         _nlos2_localealiaspath = LOCALE_ALIAS_PATH;
00080     }
00081 
00082   _nlos2_localedir = gnulocaledir;
00083   if (!_nlos2_localedir)
00084     {
00085       if (root)
00086         {
00087           size_t sl = strlen (root);
00088           _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1);
00089           memcpy (_nlos2_localedir, root, sl);
00090           memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1);
00091         }
00092       else
00093         _nlos2_localedir = LOCALEDIR;
00094     }
00095 
00096   if (strlen (_nlos2_localedir) <= MAXPATHLEN)
00097     strcpy (libintl_nl_default_dirname, _nlos2_localedir);
00098 }

char* _nl_getenv const char *  name  ) 
 

Definition at line 32 of file os2compat.c.

00033 {
00034   unsigned char *value;
00035   if (DosScanEnv (name, &value))
00036     return NULL;
00037   else
00038     return value;
00039 }

unsigned long DosScanEnv const unsigned char *  pszName,
unsigned char **  ppszValue
 


Variable Documentation

char* _nlos2_libdir = NULL
 

Definition at line 44 of file os2compat.c.

char* _nlos2_localealiaspath = NULL
 

Definition at line 45 of file os2compat.c.

char* _nlos2_localedir = NULL
 

Definition at line 46 of file os2compat.c.

char libintl_nl_default_dirname[MAXPATHLEN+1]
 

Definition at line 42 of file os2compat.c.


Generated on Sun Dec 26 11:23:29 2004 for lincity by  doxygen 1.3.9.1