Declare tags.c variables in tags.h. Declare stuff with external
linkage that is not in any other header in misc.h. Remove some redundant declarations elsewhere. (prompt, doredir, dopipe, doexecute, output, screen, parsedelay): Static linkage.
This commit is contained in:
parent
8d438a4601
commit
e7811102a3
11 changed files with 55 additions and 51 deletions
|
@ -71,6 +71,7 @@ clean:
|
|||
|
||||
expect.o: misc.h fnlist.h
|
||||
globals.o: misc.h fnlist.h proto.h
|
||||
handle.o: misc.h
|
||||
host.o: misc.h
|
||||
ioqueue.o: misc.h queue.h ioqueue.h
|
||||
ipglob.o: misc.h
|
||||
|
|
|
@ -142,7 +142,6 @@ expect(int s, int match, s_char *buf)
|
|||
void
|
||||
sendcmd(int s, int cmd, s_char *arg)
|
||||
{
|
||||
extern struct fn fnlist[];
|
||||
s_char buf[128];
|
||||
int cc;
|
||||
int len;
|
||||
|
|
|
@ -35,12 +35,11 @@
|
|||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "misc.h"
|
||||
|
||||
int
|
||||
handleintr(int s)
|
||||
{
|
||||
extern int interrupt;
|
||||
|
||||
if (interrupt) {
|
||||
/* tacky, but it works */
|
||||
if (write(s, "\naborted\n", 1 + 7 + 1) <= 0)
|
||||
|
|
|
@ -47,8 +47,6 @@ static int dequeuecc(register struct ioqueue *ioq, register int cc);
|
|||
void
|
||||
ioq_init(struct ioqueue *ioq, int bsize)
|
||||
{
|
||||
extern s_char num_teles[];
|
||||
|
||||
initque(&ioq->queue);
|
||||
ioq->cc = 0;
|
||||
ioq->bsize = bsize;
|
||||
|
|
|
@ -43,9 +43,6 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
int expect(int s, int match, s_char *buf);
|
||||
void sendcmd(int s, int cmd, s_char *arg);
|
||||
|
||||
int
|
||||
login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc)
|
||||
{
|
||||
|
|
|
@ -73,17 +73,6 @@ HANDLE hStdIn;
|
|||
int interrupt;
|
||||
int sock;
|
||||
|
||||
void saveargv(int ac, s_char **src, s_char **dst);
|
||||
void getsose(void);
|
||||
int hostport(s_char *name, struct sockaddr_in *addr);
|
||||
int hostaddr(s_char *name, struct sockaddr_in *addr);
|
||||
int hostconnect(struct sockaddr_in *addr);
|
||||
int login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc);
|
||||
int handleintr(int);
|
||||
int termio(int fd, int sock, FILE *auxfi);
|
||||
int serverio(int s, struct ioqueue *ioq);
|
||||
void servercmd(struct ioqueue *ioq, FILE *auxfi);
|
||||
|
||||
static void intr(int sig);
|
||||
|
||||
|
||||
|
@ -98,8 +87,6 @@ main(int ac, s_char **av)
|
|||
DWORD stdinmode;
|
||||
SECURITY_ATTRIBUTES security;
|
||||
#endif
|
||||
extern s_char empireport[];
|
||||
extern s_char empirehost[];
|
||||
fd_set mask;
|
||||
struct ioqueue server;
|
||||
s_char *argv[128];
|
||||
|
|
|
@ -35,7 +35,14 @@
|
|||
#define _MISC_H_
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#if !defined(aix) && !defined(sgi)
|
||||
#ifndef ultrix /* already defined in ultrix */
|
||||
|
@ -46,4 +53,33 @@ typedef signed char s_char;
|
|||
#endif /* !aix && !sgi */
|
||||
typedef short coord; /* also change NSC_COORD in nsc.h */
|
||||
|
||||
struct ioqueue;
|
||||
|
||||
extern struct fn fnlist[];
|
||||
extern s_char empirehost[];
|
||||
extern s_char empireport[];
|
||||
extern int interrupt;
|
||||
extern s_char num_teles[];
|
||||
extern int sock;
|
||||
extern s_char *SO;
|
||||
extern s_char *SE;
|
||||
|
||||
#ifdef _WIN32
|
||||
HANDLE hStdIn;
|
||||
#endif
|
||||
|
||||
void getsose(void);
|
||||
int expect(int s, int match, s_char *buf);
|
||||
int handleintr(int);
|
||||
int hostaddr(s_char *name, 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 sendeof(int sock);
|
||||
void servercmd(struct ioqueue *ioq, FILE *auxfi);
|
||||
int serverio(int s, struct ioqueue *ioq);
|
||||
int termio(int fd, int sock, FILE *auxfi);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -58,18 +58,12 @@ FILE *redir_fp;
|
|||
FILE *pipe_fp;
|
||||
int exec_fd;
|
||||
|
||||
void prompt(FILE *auxfi);
|
||||
void doredir(s_char *p);
|
||||
void dopipe(s_char *p);
|
||||
void doexecute(s_char *p, FILE *auxfi);
|
||||
void output(int code, s_char *buf, FILE *auxfi);
|
||||
void screen(register s_char *buf);
|
||||
int sendeof(int);
|
||||
int termio(int fd, int sock, FILE *auxfi);
|
||||
void _noecho(int);
|
||||
|
||||
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(struct ioqueue *ioq, FILE *auxfi)
|
||||
|
@ -128,7 +122,7 @@ servercmd(struct ioqueue *ioq, FILE *auxfi)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
prompt(FILE *auxfi)
|
||||
{
|
||||
if (mode == C_PROMPT) {
|
||||
|
@ -160,7 +154,7 @@ prompt(FILE *auxfi)
|
|||
/*
|
||||
* opens redir_fp if successful
|
||||
*/
|
||||
void
|
||||
static void
|
||||
doredir(s_char *p)
|
||||
{
|
||||
s_char *how;
|
||||
|
@ -212,7 +206,7 @@ doredir(s_char *p)
|
|||
/*
|
||||
* opens "pipe_fp" if successful
|
||||
*/
|
||||
void
|
||||
static void
|
||||
dopipe(s_char *p)
|
||||
{
|
||||
s_char *tag;
|
||||
|
@ -242,10 +236,9 @@ dopipe(s_char *p)
|
|||
free(tag);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
doexecute(s_char *p, FILE *auxfi)
|
||||
{
|
||||
extern int sock;
|
||||
int fd;
|
||||
s_char *tag;
|
||||
|
||||
|
@ -286,7 +279,7 @@ doexecute(s_char *p, FILE *auxfi)
|
|||
free(tag);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
output(int code, s_char *buf, FILE *auxfi)
|
||||
{
|
||||
switch (code) {
|
||||
|
@ -344,7 +337,7 @@ output(int code, s_char *buf, FILE *auxfi)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
screen(register s_char *buf)
|
||||
{
|
||||
register s_char *sop;
|
||||
|
|
|
@ -39,6 +39,10 @@ struct tagstruct {
|
|||
struct tagstruct *next;
|
||||
};
|
||||
|
||||
extern struct tagstruct *taglist;
|
||||
extern s_char buf[4096];
|
||||
extern s_char exec[8];
|
||||
|
||||
void io_init(void);
|
||||
s_char *gettag(s_char *p);
|
||||
|
||||
|
|
|
@ -44,16 +44,6 @@
|
|||
#include "misc.h"
|
||||
#include "tags.h"
|
||||
|
||||
extern struct tagstruct *taglist;
|
||||
extern s_char buf[4096];
|
||||
extern s_char exec[];
|
||||
|
||||
#ifdef _WIN32
|
||||
extern HANDLE hStdIn;
|
||||
#endif
|
||||
|
||||
int sendeof(int sock);
|
||||
|
||||
int
|
||||
termio(int fd, int sock, FILE *auxfi)
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ s_char *SE = 0;
|
|||
|
||||
int tgetent(char *, char *);
|
||||
|
||||
void
|
||||
static void
|
||||
parsedelay(s_char *r)
|
||||
{
|
||||
s_char *s, *t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue