unsigned EnvLkup( const char *name, char *buff, unsigned buff_len ) { int handle; int size; handle = RdosOpenProcessEnv(); size = RdosFindEnvVar( handle, name, buff ); RdosCloseEnv( handle ); return( size ); }
int EnvLkup( char *src, char *dst, int max_len ) { int handle; int size; handle = RdosOpenProcessEnv(); size = RdosFindEnvVar( handle, src, dst ); RdosCloseEnv( handle ); return( size ); }
trap_retval ReqEnv_getvar( void ) { env_get_var_req *req; env_get_var_ret *ret; char *var; char *value; int handle; req = GetInPtr( 0 ); var = GetInPtr( sizeof( *req ) ); ret = GetOutPtr( 0 ); value = GetOutPtr( sizeof( *ret ) ); ret->err = 0; handle = RdosOpenProcessEnv(); RdosDeleteEnvVar( handle, var ); if( !RdosFindEnvVar( handle, var, value ) ) { ret->err = MSG_NOT_FOUND; return( sizeof( *ret ) ); } return( sizeof( *ret ) + strlen( value ) + 1 ); }