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

Diff for /OpenXM/src/oxc/oxc.c between version 1.5 and 1.6

version 1.5, 2000/12/01 07:34:48 version 1.6, 2000/12/03 14:32:40
Line 1 
Line 1 
 /* -*- mode: C -*- */  /* -*- mode: C -*- */
 /* $OpenXM: OpenXM/src/oxc/oxc.c,v 1.4 2000/11/28 04:02:56 ohara Exp $ */  /* $OpenXM: OpenXM/src/oxc/oxc.c,v 1.5 2000/12/01 07:34:48 ohara Exp $ */
   
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 48  OXFILE *connection()
Line 48  OXFILE *connection()
 /* xterm, kterm, rxvt, gnome-terminal, ... */  /* xterm, kterm, rxvt, gnome-terminal, ... */
 static char *xterminal()  static char *xterminal()
 {  {
         char *e = getenv("OpenXM_XTERM");      char *e = getenv("OpenXM_XTERM");
         return (e != NULL)? e: "xterm";      return (e != NULL)? e: "xterm";
 }  }
   
 static int basic0[] =  {  static int basic0[] =  {
         CMO_ERROR2,      CMO_ERROR2,
         CMO_NULL,      CMO_NULL,
         CMO_INT32,      CMO_INT32,
         CMO_DATUM,      CMO_DATUM,
         CMO_STRING,      CMO_STRING,
         CMO_MATHCAP,      CMO_MATHCAP,
         CMO_LIST,      CMO_LIST,
         0      0
 };  };
   
 /* We assume that data has the following format:  /* We assume that data has the following format:
Line 74  void pipe_read_info(char **hostname, int *port, char *
Line 74  void pipe_read_info(char **hostname, int *port, char *
 int main(int argc, char *argv[])  int main(int argc, char *argv[])
 {  {
     OXFILE *oxfp;      OXFILE *oxfp;
         char *port_s = "";      char *port_s = "";
         char *xterm =  xterminal();      char *xterm =  xterminal();
         char *myname = argv[0];      char *myname = argv[0];
         int oxlog = 0;      int oxlog = 0;
     int c;      int c;
   
     while ((c = getopt(argc, argv, "c:p:h:x")) != -1) {      while ((c = getopt(argc, argv, "c:p:h:x")) != -1) {
Line 87  int main(int argc, char *argv[])
Line 87  int main(int argc, char *argv[])
             break;              break;
         case 'c':          case 'c':
             password = optarg;              password = optarg;
   
             break;              break;
         case 'p':          case 'p':
             port = atoi(optarg);              port = atoi(optarg);
                         port_s = optarg;              port_s = optarg;
             break;              break;
                 case 'x':          case 'x':
                         if (getenv("DISPLAY") != NULL) {              if (getenv("DISPLAY") != NULL) {
                                 oxlog = 1;                  oxlog = 1;
                         }              }
             break;              break;
         default:          default:
         }          }
Line 105  int main(int argc, char *argv[])
Line 105  int main(int argc, char *argv[])
     argv += optind;      argv += optind;
   
     if (strlen(remote_host) == 0) {      if (strlen(remote_host) == 0) {
                 pipe_read_info(&remote_host, &port, &password);          pipe_read_info(&remote_host, &port, &password);
                 port_s = malloc(32);          port_s = malloc(32);
                 sprintf(port_s, "%d", port);          sprintf(port_s, "%d", port);
     }      }
         if (oxlog) {      if (oxlog) {
                 execlp(xterm, xterm, "-e", myname,          execlp(xterm, xterm, "-e", myname,
                            "-h", remote_host, "-p", port_s, "-c", password);                 "-h", remote_host, "-p", port_s, "-c", password);
         }      }
   
     fprintf(stderr, "start connection!\n");      fprintf(stderr, "start connection!\n");
         if ((oxfp = connection()) == NULL) {      if ((oxfp = connection()) == NULL) {
         fprintf(stderr, "oxc: cannot connect.\n");          fprintf(stderr, "oxc: cannot connect.\n");
     }else {      }else {
                 fprintf(stderr, "oxc: oxfp = %p, fd = %d\n", oxfp, oxfp->fd);          fprintf(stderr, "oxc: oxfp = %p, fd = %d\n", oxfp, oxfp->fd);
             mathcap_init(20001006, "v2000.10.06", "oxc", basic0, NULL);          mathcap_init(20001006, "v2000.10.06", "oxc", basic0, NULL);
                 sm(oxfp);          sm(oxfp);
         }      }
     return 0;      return 0;
 }  }

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

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