[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.1 and 1.2

version 1.1, 2000/10/13 06:05:12 version 1.2, 2000/10/13 07:39:10
Line 1 
Line 1 
 /* -*- mode: C -*- */  /* -*- mode: C -*- */
 /* $OpenXM$ */  /* $OpenXM: OpenXM/src/oxc/oxc.c,v 1.1 2000/10/13 06:05:12 ohara Exp $ */
   
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 45  OXFILE *connection()
Line 45  OXFILE *connection()
     return oxfp;      return oxfp;
 }  }
   
   /* xterm, kterm, rxvt, gnome-terminal, ... */
   static char *xterminal()
   {
           char *e = getenv("OpenXM_XTERM");
           return (e != NULL)? e: "xterm";
   }
   
 int main(int argc, char *argv[])  int main(int argc, char *argv[])
 {  {
     OXFILE *oxfp;      OXFILE *oxfp;
           char *port_s = "";
           char *xterm =  xterminal();
           char *myname = argv[0];
           int oxlog = 0;
     int c;      int c;
     while ((c = getopt(argc, argv, "c:p:h:")) != -1) {  
       while ((c = getopt(argc, argv, "c:p:h:x")) != -1) {
         switch(c) {          switch(c) {
         case 'h':          case 'h':
             remote_host = optarg;              remote_host = optarg;
Line 59  int main(int argc, char *argv[])
Line 71  int main(int argc, char *argv[])
             break;              break;
         case 'p':          case 'p':
             port = atoi(optarg);              port = atoi(optarg);
                           port_s = optarg;
             break;              break;
                   case 'x':
                           if (getenv("DISPLAY") != NULL) {
                                   oxlog = 1;
                           }
               break;
         default:          default:
         }          }
     }      }
     argc -= optind;      argc -= optind;
     argv += optind;      argv += optind;
   
           if (oxlog) {
                   execlp(xterm, xterm, "-e", myname,
                              "-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 (strlen(remote_host) == 0 || strlen(password) == 0 || port == 0) {
         fprintf(stderr, "oxc: invalid arguments.\n");          fprintf(stderr, "oxc: invalid arguments.\n");

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

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