]> git.pond.sub.org Git - empserver/commitdiff
Get rid of "s_char", "register" and 0 used instead of NULL in the
authorMarc Olzheim <marcolz@stack.nl>
Tue, 15 Mar 2005 21:47:41 +0000 (21:47 +0000)
committerMarc Olzheim <marcolz@stack.nl>
Tue, 15 Mar 2005 21:47:41 +0000 (21:47 +0000)
client source.  No functional changes.

14 files changed:
src/client/expect.c
src/client/fnlist.h
src/client/host.c
src/client/ioqueue.c
src/client/ioqueue.h
src/client/login.c
src/client/main.c
src/client/misc.h
src/client/saveargv.c
src/client/servcmd.c
src/client/serverio.c
src/client/tags.c
src/client/tags.h
src/client/termio.c

index 4a4649559e25062ed9ee639fb9701fe12bf23c8d..57d8d18ef5baca88869434543adc726d2d63116b 100644 (file)
 #endif
 
 int
 #endif
 
 int
-expect(int s, int match, s_char *buf)
+expect(int s, int match, char *buf)
 {
     int size;
 {
     int size;
-    s_char *p;
+    char *p;
     int n;
     int code;
     int newline;
     int n;
     int code;
     int newline;
-    s_char *ptr;
+    char *ptr;
     int cc;
 
     size = 1024;
     int cc;
 
     size = 1024;
@@ -72,7 +72,7 @@ expect(int s, int match, s_char *buf)
     }
     size -= n;
     buf[n] = '\0';
     }
     size -= n;
     buf[n] = '\0';
-    if ((p = strchr(ptr, '\n')) == 0) {
+    if ((p = strchr(ptr, '\n')) == NULL) {
        do {
 #ifndef _WIN32
            cc = read(s, ptr, n);
        do {
 #ifndef _WIN32
            cc = read(s, ptr, n);
@@ -140,13 +140,13 @@ expect(int s, int match, s_char *buf)
 }
 
 void
 }
 
 void
-sendcmd(int s, int cmd, s_char *arg)
+sendcmd(int s, int cmd, char *arg)
 {
 {
-    s_char buf[128];
+    char buf[128];
     int cc;
     int len;
 
     int cc;
     int len;
 
-    (void)sprintf(buf, "%s %s\n", fnlist[cmd].name, arg != 0 ? arg : "");
+    (void)sprintf(buf, "%s %s\n", fnlist[cmd].name, arg != NULL ? arg : "");
     len = strlen(buf);
 #ifndef _WIN32
     cc = write(s, buf, len);
     len = strlen(buf);
 #ifndef _WIN32
     cc = write(s, buf, len);
index 40b51650923765d9a4374bc1bbb88ab301d228bd..3ecbff50c216f8969665bdecbb24dd11dde37e37 100644 (file)
@@ -37,7 +37,7 @@
 
 struct fn {
     int (*func)(void);
 
 struct fn {
     int (*func)(void);
-    s_char *name;
+    char *name;
     int value;
 };
 
     int value;
 };
 
index 90cabab0fb2d93dc88194e14ccadea85fe8e30be..603ed81bb921c430276e9d8652c082e6ba6d9880 100644 (file)
 #include "misc.h"
 
 int
 #include "misc.h"
 
 int
-hostaddr(s_char *name, struct sockaddr_in *addr)
+hostaddr(char *name, struct sockaddr_in *addr)
 {
     struct hostent *hp;
 
 {
     struct hostent *hp;
 
-    if (name == 0 || *name == 0)
+    if (name == NULL || *name == 0)
        return 0;
     if (isdigit(*name)) {
        addr->sin_addr.s_addr = inet_addr(name);
        return 0;
     if (isdigit(*name)) {
        addr->sin_addr.s_addr = inet_addr(name);
@@ -74,11 +74,11 @@ hostaddr(s_char *name, struct sockaddr_in *addr)
 }
 
 int
 }
 
 int
-hostport(s_char *name, struct sockaddr_in *addr)
+hostport(char *name, struct sockaddr_in *addr)
 {
     struct servent *sp;
 
 {
     struct servent *sp;
 
-    if (name == 0 || *name == 0)
+    if (name == NULL || *name == 0)
        return 0;
     if (isdigit(*name)) {
 #ifndef _WIN32
        return 0;
     if (isdigit(*name)) {
 #ifndef _WIN32
index cfff85d328f61a1a3c22fd12f08696a1ddd36f58..e6647be640783c23f5b0c31191e43c7949c2c986 100644 (file)
@@ -39,9 +39,9 @@
 #include "queue.h"
 #include "ioqueue.h"
 
 #include "queue.h"
 #include "ioqueue.h"
 
-static int ioqtobuf(register struct ioqueue *ioq, s_char *buf, int cc);
-static void enqueuecc(struct ioqueue *ioq, s_char *buf, int cc);
-static int dequeuecc(register struct ioqueue *ioq, register int cc);
+static int ioqtobuf(struct ioqueue *ioq, char *buf, int cc);
+static void enqueuecc(struct ioqueue *ioq, char *buf, int cc);
+static int dequeuecc(struct ioqueue *ioq, int cc);
 
 
 void
 
 
 void
@@ -59,7 +59,7 @@ ioq_init(struct ioqueue *ioq, int bsize)
  * number of bytes actually found.
  */
 int
  * number of bytes actually found.
  */
 int
-ioq_peek(struct ioqueue *ioq, s_char *buf, int cc)
+ioq_peek(struct ioqueue *ioq, char *buf, int cc)
 {
     return ioqtobuf(ioq, buf, cc);
 }
 {
     return ioqtobuf(ioq, buf, cc);
 }
@@ -73,7 +73,7 @@ ioq_dequeue(struct ioqueue *ioq, int cc)
 }
 
 int
 }
 
 int
-ioq_read(struct ioqueue *ioq, s_char *buf, int cc)
+ioq_read(struct ioqueue *ioq, char *buf, int cc)
 {
     int n;
 
 {
     int n;
 
@@ -84,7 +84,7 @@ ioq_read(struct ioqueue *ioq, s_char *buf, int cc)
 }
 
 void
 }
 
 void
-ioq_write(struct ioqueue *ioq, s_char *buf, int cc)
+ioq_write(struct ioqueue *ioq, char *buf, int cc)
 {
     enqueuecc(ioq, buf, cc);
 }
 {
     enqueuecc(ioq, buf, cc);
 }
@@ -110,11 +110,11 @@ ioq_drain(struct ioqueue *ioq)
     ioq->cc = 0;
 }
 
     ioq->cc = 0;
 }
 
-s_char *
-ioq_gets(struct ioqueue *ioq, s_char *buf, int cc)
+char *
+ioq_gets(struct ioqueue *ioq, char *buf, int cc)
 {
 {
-    register s_char *p;
-    register s_char *end;
+    char *p;
+    char *end;
     int nbytes;
 
     nbytes = ioqtobuf(ioq, buf, cc);
     int nbytes;
 
     nbytes = ioqtobuf(ioq, buf, cc);
@@ -128,7 +128,7 @@ ioq_gets(struct ioqueue *ioq, s_char *buf, int cc)
            return buf;
        }
     }
            return buf;
        }
     }
-    return 0;
+    return NULL;
 }
 
 /*
 }
 
 /*
@@ -142,11 +142,11 @@ ioq_gets(struct ioqueue *ioq, s_char *buf, int cc)
  * left for a higher level.
  */
 static int
  * left for a higher level.
  */
 static int
-ioqtobuf(register struct ioqueue *ioq, s_char *buf, int cc)
+ioqtobuf(struct ioqueue *ioq, char *buf, int cc)
 {
 {
-    register struct io *io;
+    struct io *io;
     struct qelem *qp;
     struct qelem *qp;
-    s_char *offset;
+    char *offset;
     int nbytes;
     int nleft;
 
     int nbytes;
     int nleft;
 
@@ -174,7 +174,7 @@ ioqtobuf(register struct ioqueue *ioq, s_char *buf, int cc)
  * append a buffer to the end of the ioq.
  */
 static void
  * append a buffer to the end of the ioq.
  */
 static void
-enqueuecc(struct ioqueue *ioq, s_char *buf, int cc)
+enqueuecc(struct ioqueue *ioq, char *buf, int cc)
 {
     struct io *io;
 
 {
     struct io *io;
 
@@ -192,12 +192,12 @@ enqueuecc(struct ioqueue *ioq, s_char *buf, int cc)
  * which are no longer used.
  */
 static int
  * which are no longer used.
  */
 static int
-dequeuecc(register struct ioqueue *ioq, register int cc)
+dequeuecc(struct ioqueue *ioq, int cc)
 {
 {
-    register struct io *io;
-    register struct qelem *qp;
-    register int nbytes;
-    register int there;
+    struct io *io;
+    struct qelem *qp;
+    int nbytes;
+    int there;
 
     nbytes = 0;
     while ((qp = ioq->queue.q_forw) != &ioq->queue) {
 
     nbytes = 0;
     while ((qp = ioq->queue.q_forw) != &ioq->queue) {
index 4ddd8c4c856fcdb4fa23ce2717318b26d1d44b94..489e4058d696bb47a180d19016bf6b0d5c172c35 100644 (file)
@@ -44,14 +44,14 @@ struct io {
     struct qelem queue;                /* list of ioqueue elements */
     int nbytes;                        /* number of data bytes present */
     int offset;                        /* offset into current entry */
     struct qelem queue;                /* list of ioqueue elements */
     int nbytes;                        /* number of data bytes present */
     int offset;                        /* offset into current entry */
-    s_char *data;              /* pointer to start */
+    char *data;                /* pointer to start */
 };
 
 void ioq_init(struct ioqueue *ioq, int bsize);
 };
 
 void ioq_init(struct ioqueue *ioq, int bsize);
-int ioq_peek(struct ioqueue *ioq, s_char *buf, int cc);
+int ioq_peek(struct ioqueue *ioq, char *buf, int cc);
 int ioq_dequeue(struct ioqueue *ioq, int cc);
 int ioq_dequeue(struct ioqueue *ioq, int cc);
-int ioq_read(struct ioqueue *ioq, s_char *buf, int cc);
-void ioq_write(struct ioqueue *ioq, s_char *buf, int cc);
+int ioq_read(struct ioqueue *ioq, char *buf, int cc);
+void ioq_write(struct ioqueue *ioq, char *buf, int cc);
 int ioq_qsize(struct ioqueue *ioq);
 void ioq_drain(struct ioqueue *ioq);
 int ioq_qsize(struct ioqueue *ioq);
 void ioq_drain(struct ioqueue *ioq);
-s_char *ioq_gets(struct ioqueue *ioq, s_char *buf, int cc);
+char *ioq_gets(struct ioqueue *ioq, char *buf, int cc);
index 74ac3623fcd2d7196a4350a08f48bcd915c87620..2789abce5de56986c4aa7c86ba9c612e46023797 100644 (file)
 #endif
 
 int
 #endif
 
 int
-login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc)
+login(int s, char *uname, char *cname, char *cpass, int kill_proc)
 {
 {
-    s_char tmp[128];
-    s_char buf[1024];
-    s_char *ptr;
-    s_char *p;
+    char tmp[128];
+    char buf[1024];
+    char *ptr;
+    char *p;
     int len;
 
     if (!expect(s, C_INIT, buf))
     int len;
 
     if (!expect(s, C_INIT, buf))
@@ -57,10 +57,10 @@ login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc)
     (void)sendcmd(s, USER, uname);
     if (!expect(s, C_CMDOK, buf))
        return 0;
     (void)sendcmd(s, USER, uname);
     if (!expect(s, C_CMDOK, buf))
        return 0;
-    if (cname == 0) {
+    if (cname == NULL) {
        (void)printf("Country name? ");
        cname = fgets(tmp, sizeof(tmp), stdin);
        (void)printf("Country name? ");
        cname = fgets(tmp, sizeof(tmp), stdin);
-       if (cname == 0 || *cname == 0)
+       if (cname == NULL || *cname == 0)
            return 0;
     }
     len = strlen(cname);
            return 0;
     }
     len = strlen(cname);
@@ -71,16 +71,16 @@ login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc)
        (void)fprintf(stderr, "empire: no such country\n");
        return 0;
     }
        (void)fprintf(stderr, "empire: no such country\n");
        return 0;
     }
-    if (cpass == 0) {
+    if (cpass == NULL) {
 #ifndef _WIN32
 #ifndef _WIN32
-       cpass = (s_char *)getpass("Your name? ");
-       if (cpass == 0 || *cpass == 0)
+       cpass = (char *)getpass("Your name? ");
+       if (cpass == NULL || *cpass == 0)
            return 0;
 #else
        printf("Note: This is echoed to the screen\n");
        printf("Your name? ");
        cpass = fgets(tmp, sizeof(tmp), stdin);
            return 0;
 #else
        printf("Note: This is echoed to the screen\n");
        printf("Your name? ");
        cpass = fgets(tmp, sizeof(tmp), stdin);
-       if (cpass == 0 || *cpass == 0)
+       if (cpass == NULL || *cpass == 0)
            return 0;
        len = strlen(cpass);
        if (cname[len-1] == '\n')
            return 0;
        len = strlen(cpass);
        if (cname[len-1] == '\n')
@@ -95,13 +95,13 @@ login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc)
        return 0;
     }
     if (kill_proc) {
        return 0;
     }
     if (kill_proc) {
-       (void)sendcmd(s, KILL, (s_char *)0);
+       (void)sendcmd(s, KILL, NULL);
        (void)printf("\n\t-=O=-\n");
        (void)expect(s, C_EXIT, buf);
        fprintf(stderr, "%s\n", buf);
        return 0;
     }
        (void)printf("\n\t-=O=-\n");
        (void)expect(s, C_EXIT, buf);
        fprintf(stderr, "%s\n", buf);
        return 0;
     }
-    (void)sendcmd(s, PLAY, (s_char *)0);
+    (void)sendcmd(s, PLAY, NULL);
     (void)printf("\n\t-=O=-\n");
     if (!expect(s, C_INIT, buf)) {
        fprintf(stderr, "%s\n", buf);
     (void)printf("\n\t-=O=-\n");
     if (!expect(s, C_INIT, buf)) {
        fprintf(stderr, "%s\n", buf);
@@ -110,7 +110,7 @@ login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc)
     for (ptr = buf; !isspace(*ptr); ptr++) ;
     ptr++;
     p = strchr(ptr, '\n');
     for (ptr = buf; !isspace(*ptr); ptr++) ;
     ptr++;
     p = strchr(ptr, '\n');
-    if (p != 0)
+    if (p != NULL)
        *p = 0;
     if (atoi(ptr) != CLIENTPROTO) {
        printf("Empire client out of date; get new version!\n");
        *p = 0;
     if (atoi(ptr) != CLIENTPROTO) {
        printf("Empire client out of date; get new version!\n");
index b88155b86c4a8d4f7d5d6af8cf916925026111c8..e87200327662b70e773af1d59bc17af4def2afd1 100644 (file)
@@ -77,7 +77,7 @@ static void intr(int sig);
 
 
 int
 
 
 int
-main(int ac, s_char **av)
+main(int ac, char **av)
 {
 #ifdef _WIN32
     WSADATA WsaData;
 {
 #ifdef _WIN32
     WSADATA WsaData;
@@ -94,16 +94,16 @@ main(int ac, s_char **av)
     int retry = 0;
 #endif
     struct ioqueue server;
     int retry = 0;
 #endif
     struct ioqueue server;
-    s_char *argv[128];
+    char *argv[128];
     int i, j;
     int i, j;
-    s_char *ptr;
-    s_char *auxout_fname;
+    char *ptr;
+    char *auxout_fname;
     FILE *auxout_fp;
     struct sockaddr_in sin;
     int n;
     FILE *auxout_fp;
     struct sockaddr_in sin;
     int n;
-    s_char *cname;
-    s_char *pname;
-    s_char *uname;
+    char *cname;
+    char *pname;
+    char *uname;
     int send_kill = 0;
 
 #ifdef _WIN32
     int send_kill = 0;
 
 #ifdef _WIN32
@@ -118,11 +118,11 @@ main(int ac, s_char **av)
 #endif
     memset(argv, 0, sizeof(argv));
     saveargv(ac, av, argv);
 #endif
     memset(argv, 0, sizeof(argv));
     saveargv(ac, av, argv);
-    auxout_fname = 0;
-    auxout_fp = 0;
+    auxout_fname = NULL;
+    auxout_fp = NULL;
     for (i = j = 1; i < ac; ++i) {
        ptr = argv[i];
     for (i = j = 1; i < ac; ++i) {
        ptr = argv[i];
-       if (strcmp(ptr, "-2") == 0) {
+       if (strcmp(ptr, "-2") == NULL) {
            if (i + 1 >= ac) {
                fprintf(stderr, "-2: Missing filename!\n");
                exit(1);
            if (i + 1 >= ac) {
                fprintf(stderr, "-2: Missing filename!\n");
                exit(1);
@@ -130,7 +130,7 @@ main(int ac, s_char **av)
            auxout_fname = argv[i + 1];
            ++i;
            continue;
            auxout_fname = argv[i + 1];
            ++i;
            continue;
-       } else if (strcmp(ptr, "-k") == 0) {
+       } else if (strcmp(ptr, "-k") == NULL) {
            send_kill = 1;
            continue;
        }
            send_kill = 1;
            continue;
        }
@@ -200,8 +200,7 @@ main(int ac, s_char **av)
     (void)signal(SIGPIPE, SIG_IGN);
     while (FD_ISSET(sock, &savemask)) {
        mask = savemask;
     (void)signal(SIGPIPE, SIG_IGN);
     while (FD_ISSET(sock, &savemask)) {
        mask = savemask;
-       n = select(sock + 1, &mask, (fd_set *)0, (fd_set *)0,
-                  (struct timeval *)0);
+       n = select(sock + 1, &mask, NULL, NULL, NULL);
        if (interrupt) {
            if (!handleintr(sock))
                break;
        if (interrupt) {
            if (!handleintr(sock))
                break;
@@ -271,8 +270,7 @@ main(int ac, s_char **av)
     while (1) {
        FD_ZERO(&readfds);
        FD_SET(sock, &readfds);
     while (1) {
        FD_ZERO(&readfds);
        FD_SET(sock, &readfds);
-       n = select(sock + 1, &readfds, (fd_set *) 0, (fd_set *) 0,
-                  (struct timeval *)&tm);
+       n = select(sock + 1, &readfds, NULL, NULL, (struct timeval *)&tm);
        if (interrupt) {
            if (!handleintr(sock))
                break;
        if (interrupt) {
            if (!handleintr(sock))
                break;
index a75184e272e8fd208a267cb3c022390560e7ded3..ec0f21fe0e32e9b436efdc249052ab0dc308b84a 100644 (file)
 #include <netinet/in.h>
 #endif
 
 #include <netinet/in.h>
 #endif
 
-#if !defined(aix) && !defined(sgi)
-#ifndef ultrix                 /* already defined in ultrix */
-typedef char s_char;           /* change to signed char for aix */
-#endif /* ultrix */
-#else
-typedef signed char s_char;
-#endif /* !aix && !sgi */
 typedef short coord;           /* also change NSC_COORD in nsc.h */
 
 struct ioqueue;
 
 typedef short coord;           /* also change NSC_COORD in nsc.h */
 
 struct ioqueue;
 
-extern s_char empirehost[];
-extern s_char empireport[];
+extern char empirehost[];
+extern char empireport[];
 extern int interrupt;
 extern int interrupt;
-extern s_char num_teles[];
+extern char num_teles[];
 extern int sock;
 extern int sock;
-extern s_char *SO;
-extern s_char *SE;
+extern char *SO;
+extern char *SE;
 
 #ifdef _WIN32
 HANDLE hStdIn;
 #endif
 
 void getsose(void);
 
 #ifdef _WIN32
 HANDLE hStdIn;
 #endif
 
 void getsose(void);
-int expect(int s, int match, s_char *buf);
+int expect(int s, int match, char *buf);
 int handleintr(int);
 int handleintr(int);
-int hostaddr(s_char *name, struct sockaddr_in *addr);
+int hostaddr(char *name, struct sockaddr_in *addr);
 int hostconnect(struct sockaddr_in *addr);
 int hostconnect(struct sockaddr_in *addr);
-int hostport(s_char *name, struct sockaddr_in *addr);
-int login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc);
-void saveargv(int ac, s_char **src, s_char **dst);
-void sendcmd(int s, int cmd, s_char *arg);
+int hostport(char *name, struct sockaddr_in *addr);
+int login(int s, char *uname, char *cname, char *cpass, int kill_proc);
+void saveargv(int ac, char **src, char **dst);
+void sendcmd(int s, int cmd, char *arg);
 int sendeof(int sock);
 void servercmd(struct ioqueue *ioq, FILE *auxfi);
 int serverio(int s, struct ioqueue *ioq);
 int sendeof(int sock);
 void servercmd(struct ioqueue *ioq, FILE *auxfi);
 int serverio(int s, struct ioqueue *ioq);
index cd47c627a761a52e78b87f7558269432253d9e1f..0968cb624555888adb5d7916bb449591706a046f 100644 (file)
 #include "misc.h"
 
 void
 #include "misc.h"
 
 void
-saveargv(int ac, s_char **src, s_char **dst)
+saveargv(int ac, char **src, char **dst)
 {
 {
-    register s_char *ptr;
-    register int i;
+    char *ptr;
+    int i;
 
     for (i = 0; i < ac; i++) {
        dst[i] = strcpy(malloc(strlen(src[i]) + 1), src[i]);
 
     for (i = 0; i < ac; i++) {
        dst[i] = strcpy(malloc(strlen(src[i]) + 1), src[i]);
index 7dbe50ebeb031bb4e472d4c15c29c69265dbe3b6..788af0ca83fa4e58ff06c468eed18076fdc2ad7c 100644 (file)
@@ -49,8 +49,8 @@
 #include <io.h>
 #endif
 
 #include <io.h>
 #endif
 
-s_char num_teles[64];
-static s_char the_prompt[1024];
+char num_teles[64];
+static char the_prompt[1024];
 static int mode;
 static int nbtu;
 static int nmin;
 static int mode;
 static int nbtu;
 static int nmin;
@@ -59,17 +59,17 @@ FILE *pipe_fp;
 int exec_fd;
 
 static void prompt(FILE *auxfi);
 int exec_fd;
 
 static void prompt(FILE *auxfi);
-static void doredir(s_char *p);
-static void dopipe(s_char *p);
-static void doexecute(s_char *p, FILE *auxfi);
-static void output(int code, s_char *buf, FILE *auxfi);
-static void screen(register s_char *buf);
+static void doredir(char *p);
+static void dopipe(char *p);
+static void doexecute(char *p, FILE *auxfi);
+static void output(int code, char *buf, FILE *auxfi);
+static void screen(char *buf);
 
 void
 servercmd(struct ioqueue *ioq, FILE *auxfi)
 {
 
 void
 servercmd(struct ioqueue *ioq, FILE *auxfi)
 {
-    s_char buf[1024];
-    s_char *p;
+    char buf[1024];
+    char *p;
     int code;
 
     while (ioq_gets(ioq, buf, sizeof(buf))) {
     int code;
 
     while (ioq_gets(ioq, buf, sizeof(buf))) {
@@ -110,7 +110,7 @@ servercmd(struct ioqueue *ioq, FILE *auxfi)
                sprintf(num_teles, "(%s) ", p + 1);
                if (!redir_fp && !pipe_fp && !exec_fd) {
                    putchar('\07');
                sprintf(num_teles, "(%s) ", p + 1);
                if (!redir_fp && !pipe_fp && !exec_fd) {
                    putchar('\07');
-                   prompt(0);
+                   prompt(NULL);
                }
            } else
                *num_teles = '\0';
                }
            } else
                *num_teles = '\0';
@@ -128,12 +128,12 @@ prompt(FILE *auxfi)
     if (mode == C_PROMPT) {
        if (redir_fp) {
            (void)fclose(redir_fp);
     if (mode == C_PROMPT) {
        if (redir_fp) {
            (void)fclose(redir_fp);
-           redir_fp = 0;
+           redir_fp = NULL;
        } else if (pipe_fp) {
 #ifndef _WIN32
            (void)pclose(pipe_fp);
 #endif
        } else if (pipe_fp) {
 #ifndef _WIN32
            (void)pclose(pipe_fp);
 #endif
-           pipe_fp = 0;
+           pipe_fp = NULL;
        } else if (exec_fd > 0) {
            close(exec_fd);
            close(0);
        } else if (exec_fd > 0) {
            close(exec_fd);
            close(0);
@@ -155,17 +155,17 @@ prompt(FILE *auxfi)
  * opens redir_fp if successful
  */
 static void
  * opens redir_fp if successful
  */
 static void
-doredir(s_char *p)
+doredir(char *p)
 {
 {
-    s_char *how;
-    s_char *name;
-    s_char *tag;
+    char *how;
+    char *name;
+    char *tag;
     int mode;
     int fd;
 
     if (redir_fp) {
        (void)fclose(redir_fp);
     int mode;
     int fd;
 
     if (redir_fp) {
        (void)fclose(redir_fp);
-       redir_fp = 0;
+       redir_fp = NULL;
     }
     how = p++;
     if (*p && ((*p == '>') || (*p == '!')))
     }
     how = p++;
     if (*p && ((*p == '>') || (*p == '!')))
@@ -207,9 +207,9 @@ doredir(s_char *p)
  * opens "pipe_fp" if successful
  */
 static void
  * opens "pipe_fp" if successful
  */
 static void
-dopipe(s_char *p)
+dopipe(char *p)
 {
 {
-    s_char *tag;
+    char *tag;
 
     if (*p == '|')
        p++;
 
     if (*p == '|')
        p++;
@@ -226,7 +226,7 @@ dopipe(s_char *p)
        return;
     }
 #ifndef _WIN32
        return;
     }
 #ifndef _WIN32
-    if ((pipe_fp = popen(p, "w")) == 0) {
+    if ((pipe_fp = popen(p, "w")) == NULL) {
 #else
     if (1) {
 #endif
 #else
     if (1) {
 #endif
@@ -237,10 +237,10 @@ dopipe(s_char *p)
 }
 
 static void
 }
 
 static void
-doexecute(s_char *p, FILE *auxfi)
+doexecute(char *p, FILE *auxfi)
 {
     int fd;
 {
     int fd;
-    s_char *tag;
+    char *tag;
 
     tag = gettag(p);
     while (*p && isspace(*p))
 
     tag = gettag(p);
     while (*p && isspace(*p))
@@ -251,7 +251,7 @@ doexecute(s_char *p, FILE *auxfi)
                p);
        return;
     }
                p);
        return;
     }
-    if (p == 0) {
+    if (p == NULL) {
        fprintf(stderr, "Null file to execute\n");
        free(tag);
        return;
        fprintf(stderr, "Null file to execute\n");
        free(tag);
        return;
@@ -280,7 +280,7 @@ doexecute(s_char *p, FILE *auxfi)
 }
 
 static void
 }
 
 static void
-output(int code, s_char *buf, FILE *auxfi)
+output(int code, char *buf, FILE *auxfi)
 {
     switch (code) {
     case C_NOECHO:
 {
     switch (code) {
     case C_NOECHO:
@@ -338,10 +338,10 @@ output(int code, s_char *buf, FILE *auxfi)
 }
 
 static void
 }
 
 static void
-screen(register s_char *buf)
+screen(char *buf)
 {
 {
-    register s_char *sop;
-    register s_char c;
+    char *sop;
+    char c;
 
     while ((c = *buf++)) {
        if (c & 0x80) {
 
     while ((c = *buf++)) {
        if (c & 0x80) {
index c01012685314cdbc85396b6fd98fe9f262557bb0..96a609c22a339e11b6c78e33c733d7e8755ec1f0 100644 (file)
 int
 serverio(int s, struct ioqueue *ioq)
 {
 int
 serverio(int s, struct ioqueue *ioq)
 {
-    s_char *buf;
+    char *buf;
     int n;
 
     int n;
 
-    if ((buf = malloc(ioq->bsize)) == 0) {
+    if ((buf = malloc(ioq->bsize)) == NULL) {
        fprintf(stderr, "malloc server i/o failed\n");
        return 0;
     }
        fprintf(stderr, "malloc server i/o failed\n");
        return 0;
     }
@@ -75,7 +75,7 @@ serverio(int s, struct ioqueue *ioq)
        return 0;
     }
     if (n != ioq->bsize)
        return 0;
     }
     if (n != ioq->bsize)
-       buf = (s_char *)realloc(buf, n);
+       buf = (char *)realloc(buf, n);
     ioq_write(ioq, buf, n);
     return 1;
 }
     ioq_write(ioq, buf, n);
     return 1;
 }
index 3531ca9eb6d4b188e92c94d10bb1b645f935a57d..73f87713c4ee624af679b6a8a8b10986bed8ec71 100644 (file)
@@ -50,8 +50,8 @@ io_init(void)
     taglist = NULL;
 }
 
     taglist = NULL;
 }
 
-s_char *
-gettag(s_char *p)
+char *
+gettag(char *p)
 {
     struct tagstruct *tag1, *tag2;
 
 {
     struct tagstruct *tag1, *tag2;
 
index b437c9f003e04383738afa51504c27d8f16ab122..a46b92a9f7abdc50c59b3abf0ed631b2bb923ef9 100644 (file)
 #define _TAGS_H_
 
 struct tagstruct {
 #define _TAGS_H_
 
 struct tagstruct {
-    s_char *item;
+    char *item;
     struct tagstruct *next;
 };
 
 extern struct tagstruct *taglist;
 
 void io_init(void);
     struct tagstruct *next;
 };
 
 extern struct tagstruct *taglist;
 
 void io_init(void);
-s_char *gettag(s_char *p);
+char *gettag(char *p);
 
 #endif
 
 #endif
index 31b6c694d98b22fdb2d26c3cdd553af87cd84c96..ec7232e9e7b6d2991ce5d5392233f69bf1ce4345 100644 (file)
@@ -49,10 +49,10 @@ termio(int fd, int sock, FILE *auxfi)
 {
     static char exec[] = "execute";
     static char buf[4096];
 {
     static char exec[] = "execute";
     static char buf[4096];
-    s_char out[4096];
+    char out[4096];
     int i, n;
     int i, n;
-    s_char *ptr;
-    s_char *p, *q, *r, *s, *t;
+    char *ptr;
+    char *p, *q, *r, *s, *t;
     int nbytes;
     int prespace, exec_com, inarg, quoted, tagging;
     struct tagstruct *tag;
     int nbytes;
     int prespace, exec_com, inarg, quoted, tagging;
     struct tagstruct *tag;
@@ -88,7 +88,7 @@ termio(int fd, int sock, FILE *auxfi)
        p[0] = c;
        p[1] = '\0';
        if (c != 10)
        p[0] = c;
        p[1] = '\0';
        if (c != 10)
-           ReadConsole(hStdIn, &p[0], sizeof(buf) - i, &n, NULL);
+           ReadConsole(hStdIn, p, sizeof(buf) - i, &n, NULL);
        else
            putchar(c);
 /* Strip off the CRLF to just LF */
        else
            putchar(c);
 /* Strip off the CRLF to just LF */
@@ -134,7 +134,7 @@ termio(int fd, int sock, FILE *auxfi)
        if (*p == '\n') {
            if (tagging) {
                tag = (struct tagstruct *)malloc(sizeof(struct tagstruct));
        if (*p == '\n') {
            if (tagging) {
                tag = (struct tagstruct *)malloc(sizeof(struct tagstruct));
-               tag->item = (s_char *)malloc((1 + p - s) * sizeof(s_char));
+               tag->item = (char *)malloc((1 + p - s) * sizeof(char));
                tag->next = taglist;
                taglist = tag;
                t = tag->item;
                tag->next = taglist;
                taglist = tag;
                t = tag->item;