00001
00002
00003
00004
00005 #include <stdio.h>
00006 #include <string.h>
00007
00008
00009 #include "MALLOC.h"
00010 #include "stack-c.h"
00011 #include "setenvc.h"
00012 #include "intsetenv.h"
00013 #include "gw_io.h"
00014
00015
00016 static int ReturnValueSetenv(int value);
00017
00018 int C2F(intsetenv) _PARAMS((char *fname, unsigned long len))
00019 {
00020 static int l1,n1,m1;
00021 int TypeVar1=GetType(1);
00022 int TypeVar2=GetType(2);
00023
00024 Rhs=Max(0,Rhs);
00025 CheckRhs(2,2);
00026 CheckLhs(0,1);
00027
00028 if ( (TypeVar1 == sci_strings) && (TypeVar2 == sci_strings) )
00029 {
00030 char *param1=NULL,*param2=NULL;
00031
00032 GetRhsVar(1,"c",&m1,&n1,&l1);
00033 param1=cstk(l1);
00034
00035 GetRhsVar(2,"c",&m1,&n1,&l1);
00036 param2=cstk(l1);
00037
00038 ReturnValueSetenv(setenvc(param1,param2));
00039 }
00040 else
00041 {
00042 Scierror(999,"Invalid type : string recquired");
00043 }
00044
00045 return 0;
00046 }
00047
00048 int ReturnValueSetenv(int value)
00049 {
00050 static int n1;
00051 int *paramoutINT=(int*)MALLOC(sizeof(int));
00052
00053 if (value == TRUE) *paramoutINT=(int)(TRUE);
00054 else *paramoutINT=(int)(FALSE);
00055
00056 n1=1;
00057 CreateVarFromPtr(1, "b", &n1, &n1, ¶moutINT);
00058 LhsVar(1)=1;
00059 C2F(putlhsvar)();
00060 if (paramoutINT) {FREE(paramoutINT);paramoutINT=NULL;}
00061 return 0;
00062 }
00063