]> git.pond.sub.org Git - empserver/blobdiff - src/client/servcmd.c
Update copyright notice.
[empserver] / src / client / servcmd.c
index ae4976c5f4369a0748dc7097a15eb2978dfc5834..7dbe50ebeb031bb4e472d4c15c29c69265dbe3b6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2004, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
 #include "proto.h"
 #include "queue.h"
 #include "ioqueue.h"
+#include "tags.h"
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <ctype.h>
 #include <fcntl.h>
 #if !defined(_WIN32)
 #include <unistd.h>
+#else
+#include <io.h>
 #endif
 
-extern s_char *gettag();
-
 s_char num_teles[64];
 static s_char the_prompt[1024];
 static int mode;
@@ -56,25 +58,16 @@ FILE *redir_fp;
 FILE *pipe_fp;
 int exec_fd;
 
-void prompt();
-void doredir();
-void dopipe();
-void doexecute();
-void output();
-void screen();
-int sendeof();
-int termio();
-void _noecho();
-
-extern s_char *SO;
-extern s_char *SE;
+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);
 
 void
-servercmd(ioq, auxfi)
-struct ioqueue *ioq;
-FILE *auxfi;
+servercmd(struct ioqueue *ioq, FILE *auxfi)
 {
-    s_char *ioq_gets(struct ioqueue *, s_char *, int);
     s_char buf[1024];
     s_char *p;
     int code;
@@ -129,9 +122,8 @@ FILE *auxfi;
     }
 }
 
-void
-prompt(auxfi)
-FILE *auxfi;
+static void
+prompt(FILE *auxfi)
 {
     if (mode == C_PROMPT) {
        if (redir_fp) {
@@ -162,9 +154,8 @@ FILE *auxfi;
 /*
  * opens redir_fp if successful
  */
-void
-doredir(p)
-s_char *p;
+static void
+doredir(s_char *p)
 {
     s_char *how;
     s_char *name;
@@ -215,9 +206,8 @@ s_char *p;
 /*
  * opens "pipe_fp" if successful
  */
-void
-dopipe(p)
-s_char *p;
+static void
+dopipe(s_char *p)
 {
     s_char *tag;
 
@@ -246,12 +236,9 @@ s_char *p;
     free(tag);
 }
 
-void
-doexecute(p, auxfi)
-s_char *p;
-FILE *auxfi;
+static void
+doexecute(s_char *p, FILE *auxfi)
 {
-    extern int sock;
     int fd;
     s_char *tag;
 
@@ -292,15 +279,12 @@ FILE *auxfi;
     free(tag);
 }
 
-void
-output(code, buf, auxfi)
-int code;
-s_char *buf;
-FILE *auxfi;
+static void
+output(int code, s_char *buf, FILE *auxfi)
 {
     switch (code) {
     case C_NOECHO:
-       _noecho(0);
+       /* not implemented; serve doesn't send it */
        break;
     case C_FLUSH:
        (void)fflush(stdout);
@@ -353,9 +337,8 @@ FILE *auxfi;
     }
 }
 
-void
-screen(buf)
-register s_char *buf;
+static void
+screen(register s_char *buf)
 {
     register s_char *sop;
     register s_char c;