[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.3 and 1.5

version 1.3, 2000/11/18 06:03:42 version 1.5, 2000/12/01 07:34:48
Line 1 
Line 1 
 /* -*- mode: C -*- */  /* -*- mode: C -*- */
 /* $OpenXM: OpenXM/src/oxc/oxc.c,v 1.2 2000/10/13 07:39:10 ohara Exp $ */  /* $OpenXM: OpenXM/src/oxc/oxc.c,v 1.4 2000/11/28 04:02:56 ohara Exp $ */
   
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 52  static char *xterminal()
Line 52  static char *xterminal()
         return (e != NULL)? e: "xterm";          return (e != NULL)? e: "xterm";
 }  }
   
   static int basic0[] =  {
           CMO_ERROR2,
           CMO_NULL,
           CMO_INT32,
           CMO_DATUM,
           CMO_STRING,
           CMO_MATHCAP,
           CMO_LIST,
           0
   };
   
   /* We assume that data has the following format:
      LENGTH hostname '\0' port '\0' password '\0'
      where LENGTH is an integer with network byte order and its value
      equals to the sum of the length of three data above.
   */
   
   void pipe_read_info(char **hostname, int *port, char **password);
   
 int main(int argc, char *argv[])  int main(int argc, char *argv[])
 {  {
     OXFILE *oxfp;      OXFILE *oxfp;
Line 68  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);
Line 84  int main(int argc, char *argv[])
Line 104  int main(int argc, char *argv[])
     argc -= optind;      argc -= optind;
     argv += optind;      argv += optind;
   
       if (strlen(remote_host) == 0) {
                   pipe_read_info(&remote_host, &port, &password);
                   port_s = malloc(32);
                   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 (strlen(remote_host) == 0 || strlen(password) == 0 || port == 0) {          if ((oxfp = connection()) == NULL) {
         fprintf(stderr, "oxc: invalid arguments.\n");  
                 fprintf(stderr, "usage: oxc -p port -h host -c password.\n");  
     }else 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);
             sysinfo_set(20001006, "v2000.10.06", "oxc");              mathcap_init(20001006, "v2000.10.06", "oxc", basic0, NULL);
                 sm(oxfp);                  sm(oxfp);
         }          }
     return 0;      return 0;

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

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