tcpscript.c
changeset 6 07f184944f3f
parent 5 470463cba5cf
child 7 6102b11bac49
equal deleted inserted replaced
5:470463cba5cf 6:07f184944f3f
    37  *
    37  *
    38  * 2000-07-30 Per Andreas Buer <per@linpro.no> - added "q"-option
    38  * 2000-07-30 Per Andreas Buer <per@linpro.no> - added "q"-option
    39  */
    39  */
    40 
    40 
    41 /*
    41 /*
    42  * tcpscript - Modified from script - 2007 Lluis Batlle i Rossell
    42  * tcpscript - Modified from 'script' - 2007 Lluis Batlle i Rossell
    43  */
    43  */
    44 #include <stdio.h>
    44 #include <stdio.h>
    45 #include <stdlib.h>
    45 #include <stdlib.h>
    46 #include <sys/types.h>
    46 #include <sys/types.h>
    47 #include <sys/stat.h>
    47 #include <sys/stat.h>
    95 
    95 
    96 enum {
    96 enum {
    97     MAXCONNS = 10
    97     MAXCONNS = 10
    98 };
    98 };
    99 static int accept_socket;
    99 static int accept_socket;
       
   100 const char version[] = "0.1";
   100 
   101 
   101 static char *progname;
   102 static char *progname;
   102 
   103 
   103 static void
   104 static void
   104 die_if_link(char *fn) {
   105 die_if_link(char *fn) {
   135 		progname = p+1;
   136 		progname = p+1;
   136 
   137 
   137 
   138 
   138 	if (argc == 2) {
   139 	if (argc == 2) {
   139 		if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")) {
   140 		if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")) {
   140 			printf("%s, modification of 'script', by %s\n",
   141 			printf("%s %s, modification of 'script' by %s\n",
   141 			       progname, "Lluis Batlle i Rossell 2007");
   142 			       progname, version,
       
   143                    "Lluis Batlle i Rossell 2007");
   142 			return 0;
   144 			return 0;
   143 		}
   145 		}
   144 	}
   146 	}
   145 
   147 
   146 	while ((ch = getopt(argc, argv, "c:qp:l:")) != -1)
   148 	while ((ch = getopt(argc, argv, "c:qp:l:")) != -1)