mirror of
https://github.com/ksherlock/mpw-tools.git
synced 2024-11-16 22:10:42 +00:00
29 lines
446 B
C
29 lines
446 B
C
/*
|
|
*
|
|
* GetEnv variable
|
|
* read an mpw variable.
|
|
* eg: CLibraries=`mpw GetEnv CLibraries`
|
|
* (makefile) CLibraries = $(shell mpw GetEnv CLibraries)
|
|
* flags to do name = value?
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
char *value;
|
|
char *name;
|
|
|
|
if (argc != 2)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
name = argv[1];
|
|
value = getenv(name);
|
|
// value == null if not defined.
|
|
if (value) puts(value);
|
|
return 0;
|
|
}
|