2 #include <Xw_Extension.h>
4 /* ifdef then trace on */
11 STATUS Xw_get_env (symbol,value,length):
12 char *symbol Symbol string to read
13 char *value return Symbol value to fill
14 int length Value max length in chars
16 Get external Symbol value (Set by setenv UNIX)
18 Returns ERROR if No symbol exist
19 or Length is too small for value
20 Returns SUCCESS if Successful
22 STATUS Xw_put_env (symbol,value):
23 char *symbol Symbol string to write
24 char *value Symbol value to write
26 Put external Symbol value (Set by putenv UNIX)
28 Returns ERROR if symbol is empty
29 Returns SUCCESS if Successful
33 XW_STATUS Xw_get_env (const char* symbol,char* value,int length)
35 XW_STATUS Xw_get_env (symbol,value,length)
39 #endif /*XW_PROTOTYPE*/
43 if( !(string = getenv (symbol)) ) {
44 if( Xw_get_trace() > 1 )
45 printf("*UNDEFINED SYMBOL*Xw_get_env('%s',...)\n",symbol);
49 if( strlen(string) >= (unsigned int ) length ) return (XW_ERROR) ;
51 strcpy(value,string) ;
54 if( Xw_get_trace() > 1 ) {
55 printf (" '%s' = Xw_get_env('%s','%s',%d)\n",value,symbol,string,length) ;