Thomas Haupt
09/23/2008 9:55 AM
post13856
|
Seek for the first '='. Everything to the left is the variable's
name, everything to the right up to the terminating ASCII NUL is
the value:
void getit( const char *env_var_val ) {
char *name = strdup( env_var_val );
char *value = strchr( name, '=' );
*value++ = '\0';
printf( "Variable '%s' has value '%s'\n", name, value );
}
Or did I miss your point?
- Thomas
> -----Ursprungliche Nachricht-----
> Von: Mario Charest [mailto:community-noreply@qnx.com]
> Gesendet: 23 September 2008 15:51
> An: ostech-core_os
> Betreff: pidin env
>
>
> I'm been using code from pidin env to get access to other
> processes environment variables. My problem is with parsing
> of the data. Say a variable is setup like
>
> VAR="see the=sign "
>
> This make parsing close to impossible. Suggestions?
>
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post13854
>
>
|
|
|
Mario Charest
09/23/2008 3:32 PM
post13887
|
> I'm been using code from pidin env to get access to other processes
> environment variables. My problem is with parsing of the data. Say a variable
> is setup like
>
> VAR="see the=sign "
>
> This make parsing close to impossible. Suggestions?
>
While I'm at it, let me steal my own post ;-)
Any way to speed up reading of environment variable across the network. It currently takes 300ms to read about 30
variables.
|
|
|