=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/plugin/oxmisc.c,v retrieving revision 1.18 retrieving revision 1.21 diff -u -p -r1.18 -r1.21 --- OpenXM/src/kan96xx/plugin/oxmisc.c 2003/11/19 01:02:39 1.18 +++ OpenXM/src/kan96xx/plugin/oxmisc.c 2004/09/16 23:53:45 1.21 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/kan96xx/plugin/oxmisc.c,v 1.17 2003/11/18 11:08:27 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/plugin/oxmisc.c,v 1.20 2004/03/08 08:24:42 takayama Exp $ */ #include #include #include @@ -11,6 +11,7 @@ #include #include #include +#include #define SET_MYERROROUT { if (MyErrorOut == NULL) MyErrorOut=stdout; } /* It is also defined in oxmisc2.c */ FILE *MyErrorOut = NULL; @@ -444,7 +445,16 @@ void oxReqExecuteFunction(ox_stream os,char *s) fp2fflush(os); } +void oxReqExecuteFunctionWithOptionalArgument(ox_stream os,char *s) +{ + oxSendOXheader(os,OX_DATA,SerialOX++); + oxSendCmoString(os,s); + oxSendOXheader(os,OX_COMMAND,SerialOX++); + oxSendInt32(os,SM_executeFunctionWithOptionalArgument); + fp2fflush(os); +} + void oxReqPopString(ox_stream os) { oxSendOXheader(os,OX_COMMAND,SerialOX++); @@ -500,7 +510,6 @@ int oxclientMultiSelect(oxclientp clients[],int datare int humanfd = 0; fd_set readfds; struct timeval timeout; - extern int errno; SET_MYERROROUT; /** printf("(1)"); fflush(NULL); */ @@ -869,14 +878,16 @@ char *oxGenPass(void) { static int seed = 0; long p; char *s; - int i; + int i,n; if (seed == 0) { seed = (int) time(NULL) + (int) &p; srandom((unsigned int) seed); } - for (i=0; i < ((int) &p) % 100 ; i++) random(); - p = random(); s = (char *)malloc(128*sizeof(char)); + if (s == NULL) { fprintf(stderr,"No more memory.\n"); return(s); } + n = (((int) s) + (int) time(NULL)) % 100; + for (i=0; i < n ; i++) random(); + p = random(); sprintf(s,"%ld",p); return(s); } @@ -1070,6 +1081,8 @@ char *oxFIDtoStr(int id) { return "SM_executeStringByLocalParser"; break; case SM_executeFunction: return "SM_executeFunction"; break; + case SM_executeFunctionWithOptionalArgument: + return "SM_executeFunctionWithOptionalArgument"; break; case SM_popCMO: return "SM_popCMO"; break; case SM_popString: