/*
* 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;
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;
}
}
-void
-prompt(auxfi)
-FILE *auxfi;
+static void
+prompt(FILE *auxfi)
{
if (mode == C_PROMPT) {
if (redir_fp) {
/*
* opens redir_fp if successful
*/
-void
-doredir(p)
-s_char *p;
+static void
+doredir(s_char *p)
{
s_char *how;
s_char *name;
/*
* opens "pipe_fp" if successful
*/
-void
-dopipe(p)
-s_char *p;
+static void
+dopipe(s_char *p)
{
s_char *tag;
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;
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);
}
}
-void
-screen(buf)
-register s_char *buf;
+static void
+screen(register s_char *buf)
{
register s_char *sop;
register s_char c;