1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
--- cdecl.c
+++ cdecl.c.new
@@ -67,6 +67,7 @@
# include <stddef.h>
# include <string.h>
# include <stdarg.h>
+# include <errno.h>
#else
# ifndef NOVARARGS
# include <varargs.h>
@@ -124,7 +125,6 @@
#if __STDC__
char *ds(char *), *cat(char *, ...), *visible(int);
- int getopt(int,char **,char *);
int main(int, char **);
int yywrap(void);
int dostdin(void);
--- cdecl.c 2009-07-07 13:20:37.000000000 +0200
+++ cdecl.c.new 2009-07-07 13:25:00.000000000 +0200
@@ -91,7 +91,7 @@
#ifdef USE_READLINE
# include <readline/readline.h>
/* prototypes for functions related to readline() */
- char * getline();
+ char * mygetline();
char ** attempt_completion(char *, int, int);
char * keyword_completion(char *, int);
char * command_completion(char *, int);
@@ -375,7 +375,7 @@
static char *line_read = NULL;
/* Read a string, and return a pointer to it. Returns NULL on EOF. */
-char * getline ()
+char * mygetline ()
{
/* If the buffer has already been allocated, return the memory
to the free pool. */
@@ -887,7 +887,7 @@
if (!quiet) (void) printf("Type `help' or `?' for help\n");
ret = 0;
- while ((line = getline())) {
+ while ((line = mygetline())) {
if (!strcmp(line, "quit") || !strcmp(line, "exit")) {
free(line);
return ret;
--- Makefile.old 2010-08-26 22:06:28.000000000 +0200
+++ Makefile 2010-08-26 22:11:42.000000000 +0200
@@ -15,9 +15,9 @@
#
# add -DUSE_READLINE To compile in support for the GNU readline library.
-CFLAGS= -s -O2 -DUSE_READLINE
+
CC= gcc
-LIBS= -lreadline -ltermcap
+
ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++
BINDIR= /usr/bin
MANDIR= /usr/man/man1
@@ -29,7 +29,7 @@
ln c++decl cdecl
c++decl: cdgram.c cdlex.c cdecl.c
- $(CC) $(CFLAGS) -o c++decl cdecl.c $(LIBS)
+ $(CC) $(CFLAGS) ${LDFLAGS} -o c++decl cdecl.c $(LIBS)
rm -f cdecl
cdlex.c: cdlex.l
|