[BACK]Return to oxserver00.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kxx

Diff for /OpenXM/src/kxx/oxserver00.c between version 1.2 and 1.6

version 1.2, 1999/11/09 11:43:35 version 1.6, 2001/12/21 02:32:11
Line 1 
Line 1 
 /* $OpenXM$ */  /* $OpenXM: OpenXM/src/kxx/oxserver00.c,v 1.5 2001/05/06 07:53:01 takayama Exp $ */
 /* nullserver01 */  /* nullserver01 */
 #include <stdio.h>  #include <stdio.h>
 #include <sys/types.h>  #include <sys/types.h>
Line 33  main(int argc, char *argv[]) {
Line 33  main(int argc, char *argv[]) {
   char *tigers[] = {"callsm1.sm1","tigers.sm1"};    char *tigers[] = {"callsm1.sm1","tigers.sm1"};
   char *basicCD[] = {"basicCD.sm1"};    char *basicCD[] = {"basicCD.sm1"};
   /*  If you change the above, you need to change the argc of Sm1_start below.    /*  If you change the above, you need to change the argc of Sm1_start below.
       */     */
   
   if (argc > 1) {    if (argc > 1) {
     if (strcmp(argv[1],"-monitor")==0) {      if (strcmp(argv[1],"-monitor")==0) {
Line 64  main(int argc, char *argv[]) {
Line 64  main(int argc, char *argv[]) {
   
 static char *getSuffix(char *s) {  static char *getSuffix(char *s) {
   /* getSuffix("ox_sm1_forAsir") returns "forAsir" */    /* getSuffix("ox_sm1_forAsir") returns "forAsir" */
     /* getSuffix("ox_sm1_forAsir.exe") returns "forAsir" */
   /* getSuffix("ox_sm1_gnuplot") returns "gnuplot" */    /* getSuffix("ox_sm1_gnuplot") returns "gnuplot" */
   int n,i,k;    int n,i,k;
   n = strlen(s);    n = strlen(s);
     if (n > 5 && (strcmp(".exe",&(s[n-4]))==0 || strcmp(".EXE",&(s[n-4]))==0)) {
       s[n-4] = '\0';
     }
   for (i=n-1; i>=0; i--) {    for (i=n-1; i>=0; i--) {
     if (s[i] == '_') {      if (s[i] == '_') {
       return( s+i+1 );        return( s+i+1 );
Line 83  nullserver(int fdStream) {
Line 87  nullserver(int fdStream) {
   extern jmp_buf EnvOfStackMachine;    extern jmp_buf EnvOfStackMachine;
   int engineByteOrder;    int engineByteOrder;
   
     fflush(NULL);
   engineByteOrder = oxTellMyByteOrder(fdStream);    engineByteOrder = oxTellMyByteOrder(fdStream);
   /* Set the network byte order. */    /* Set the network byte order. */
   fprintf(stderr,"engineByteOrder=%x\n",engineByteOrder);    fprintf(stderr,"engineByteOrder=%x\n",engineByteOrder);
Line 115  nullserver(int fdStream) {
Line 120  nullserver(int fdStream) {
     /* In case of error in the stack machine, pop the error info      /* In case of error in the stack machine, pop the error info
        and send the error packet. */         and send the error packet. */
     /* oxSendOXheader(ostream,OX_DATA,SerialOX++);      /* oxSendOXheader(ostream,OX_DATA,SerialOX++);
     oxSendCmoError(ostream);         oxSendCmoError(ostream);
     oxSendOXheader(ostream,OX_DATA,SerialOX++);         oxSendOXheader(ostream,OX_DATA,SerialOX++);
     sprintf(sreason,"Jump here by sm1 error.");         sprintf(sreason,"Jump here by sm1 error.");
     oxSendCmoError2(ostream,sreason);         oxSendCmoError2(ostream,sreason);
     */      */
     Sm1_pushError2(SerialCurrent,-1,"Global jump by sm1 error");      Sm1_pushError2(SerialCurrent,-1,"Global jump by sm1 error");
   
Line 163  nullserver(int fdStream) {
Line 168  nullserver(int fdStream) {
       case OX_DATA:    fprintf(stderr," OX_DATA \n"); break;        case OX_DATA:    fprintf(stderr," OX_DATA \n"); break;
       case OX_SYNC_BALL: fprintf(stderr," OX_SYNC_BALL \n"); break;        case OX_SYNC_BALL: fprintf(stderr," OX_SYNC_BALL \n"); break;
       case -1: fprintf(stderr," End of file. Exiting the server child.\n");        case -1: fprintf(stderr," End of file. Exiting the server child.\n");
         exit(); break;          exit(); break;
       default: fprintf(stderr," ?! \n"); break;        default: fprintf(stderr," ?! \n"); break;
       }        }
     }      }
Line 224  nullserverCommand(ox_stream ostream) {
Line 229  nullserverCommand(ox_stream ostream) {
     if (message) fprintf(stderr," dupErrors \n");      if (message) fprintf(stderr," dupErrors \n");
     Sm1_dupErrors();      Sm1_dupErrors();
     break;      break;
     case SM_pushCMOtag:
       if (message) fprintf(stderr," pushCMOtag \n");
       Sm1_pushCMOtag(SerialCurrent);
       break;
   case SM_setName:    case SM_setName:
     if (message) fprintf(stderr," setName \n");      if (message) fprintf(stderr," setName \n");
     iresult = Sm1_setName();      iresult = Sm1_setName();
Line 273  nullserverCommand(ox_stream ostream) {
Line 282  nullserverCommand(ox_stream ostream) {
     if (message) fprintf(stderr,"Done.\n");      if (message) fprintf(stderr,"Done.\n");
     break;      break;
   case SM_shutdown:    case SM_shutdown:
       fprintf(stderr,"Shutting down the engine.\n");
       exit(0);
       break;
   case SM_beginBlock:    case SM_beginBlock:
   case SM_endBlock:    case SM_endBlock:
     fprintf(stderr,"This command has not yet been implemented.\n");      fprintf(stderr,"This command has not yet been implemented.\n");
Line 297  nullserver_simplest(int fd) {
Line 309  nullserver_simplest(int fd) {
   
   
 void controlResetHandler(sig)  void controlResetHandler(sig)
 int sig;       int sig;
 {  {
   signal(sig,SIG_IGN);    signal(sig,SIG_IGN);
   fprintf(stderr,"From controlResetHandler. OxCritical = %d\n",OxCritical);    fprintf(stderr,"From controlResetHandler. OxCritical = %d\n",OxCritical);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.6

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>