From 08a3aa81e1ef2a2f8d0612017380bf77995ce4e0 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Sat, 18 May 2013 14:21:28 +0800 Subject: [PATCH] crypt depends on display and input instead of efunc. --- Makefile | 7 ++++--- crypt.c | 9 +++++---- edef.h | 2 ++ efunc.h | 13 +------------ estruct.h | 5 +++++ input.c | 4 ++++ input.h | 19 +++++++++++++++++++ 7 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 input.h diff --git a/Makefile b/Makefile index f1b580b..eb64892 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,8 @@ OBJ=basic.o bind.o buffer.o crypt.o display.o eval.o exec.o \ termio.o window.o word.o names.o globals.o \ wrapper.o utf8.o -HDR=crypt.h display.h ebind.h edef.h efunc.h estruct.h fileio.h version.h +HDR=crypt.h display.h ebind.h edef.h efunc.h estruct.h fileio.h input.h \ + version.h # DO NOT ADD OR MODIFY ANY LINES ABOVE THIS -- make source creates them @@ -134,14 +135,14 @@ ansi.o: ansi.c estruct.h edef.h basic.o: basic.c estruct.h edef.h bind.o: bind.c estruct.h edef.h fileio.h buffer.o: buffer.c estruct.h edef.h -crypt.o: crypt.c crypt.h estruct.h edef.h +crypt.o: crypt.c crypt.h display.h estruct.h edef.h input.h display.o: display.c display.h estruct.h edef.h utf8.h version.h eval.o: eval.c estruct.h edef.h version.h fileio.h exec.o: exec.c estruct.h edef.h file.o: file.c crypt.h estruct.h edef.h fileio.h fileio.o: fileio.c fileio.h crypt.h display.h estruct.h edef.h ibmpc.o: ibmpc.c estruct.h edef.h -input.o: input.c estruct.h edef.h +input.o: input.c input.h estruct.h edef.h isearch.o: isearch.c estruct.h edef.h line.o: line.c estruct.h edef.h lock.o: lock.c estruct.h edef.h diff --git a/crypt.c b/crypt.c index c2b1c6a..7b735cb 100644 --- a/crypt.c +++ b/crypt.c @@ -9,10 +9,11 @@ * written by Dana Hoggatt and Daniel Lawrence */ -#include -#include "estruct.h" -#include "edef.h" -#include "efunc.h" +#include +#include "display.h" +#include "estruct.h" +#include "edef.h" +#include "input.h" #if CRYPT diff --git a/edef.h b/edef.h index b70c9cd..b61b9f0 100644 --- a/edef.h +++ b/edef.h @@ -10,6 +10,8 @@ #ifndef EDEF_H_ #define EDEF_H_ +#include "estruct.h" + #include #include diff --git a/efunc.h b/efunc.h index 6ce5364..6a11c9e 100644 --- a/efunc.h +++ b/efunc.h @@ -138,18 +138,7 @@ extern int ttgetc(void); extern int typahead(void); /* input.c */ -extern int mlyesno(char *prompt); -extern int mlreply(char *prompt, char *buf, int nbuf); -extern int mlreplyt(char *prompt, char *buf, int nbuf, int eolchar); -extern int ectoc(int c); -extern int ctoec(int c); -extern fn_t getname(void); -extern int tgetc(void); -extern int get1key(void); -extern int getcmd(void); -extern int getstring(char *prompt, char *buf, int nbuf, int eolchar); -extern void outstring(char *s); -extern void ostring(char *s); +#include "input.h" /* bind.c */ extern int help(int f, int n); diff --git a/estruct.h b/estruct.h index 3c382ce..af27316 100644 --- a/estruct.h +++ b/estruct.h @@ -1,3 +1,6 @@ +#ifndef _ESTRUCT_H_ +#define _ESTRUCT_H_ + /* ESTRUCT.H * * Structure and preprocessor defines @@ -678,3 +681,5 @@ struct magic_replacement { }; #endif /* MAGIC */ + +#endif diff --git a/input.c b/input.c index 28d6ada..cd1f88c 100644 --- a/input.c +++ b/input.c @@ -1,3 +1,7 @@ +/* input.c -- implements input.h */ + +#include "input.h" + /* input.c * * Various input routines diff --git a/input.h b/input.h new file mode 100644 index 0000000..a1da651 --- /dev/null +++ b/input.h @@ -0,0 +1,19 @@ +#ifndef _INPUT_H_ +#define _INPUT_H_ + +#include "edef.h" + +int mlyesno( char *prompt) ; +int mlreply( char *prompt, char *buf, int nbuf) ; +int mlreplyt( char *prompt, char *buf, int nbuf, int eolchar) ; +int ectoc( int c) ; +int ctoec( int c) ; +fn_t getname( void) ; +int tgetc( void) ; +int get1key( void) ; +int getcmd( void) ; +int getstring( char *prompt, char *buf, int nbuf, int eolchar) ; +void outstring( char *s) ; +void ostring( char *s) ; + +#endif