Add putenv command.

This commit is contained in:
W. Eric Norum
2000-05-31 22:36:40 +00:00
parent 4674eccf2d
commit 85c2135b0d
+14
View File
@@ -119,6 +119,19 @@ static void threadInitCallFunc(ioccrfArg **args)
threadInit();
}
/* putenv */
static ioccrfArg putenvArg0 = { "environment_variable=name",ioccrfArgString,0};
static ioccrfArg *putenvArgs[1] = {&putenvArg0};
static ioccrfFuncDef putenvFuncDef = {"putenv",1,putenvArgs};
static void putenvCallFunc(ioccrfArg **args)
{
const char *cp = (char *)args[0]->value;
if (!cp)
return;
if (putenv (cp))
printf ("putenv(%s) failed.\n", cp);
}
void epicsShareAPI iocUtilRegister(void)
{
@@ -127,4 +140,5 @@ void epicsShareAPI iocUtilRegister(void)
ioccrfRegister(&pwdFuncDef,pwdCallFunc);
ioccrfRegister(&showFuncDef,showCallFunc);
ioccrfRegister(&threadInitFuncDef,threadInitCallFunc);
ioccrfRegister(&putenvFuncDef,putenvCallFunc);
}