forked from pool/cdecl
86e67f3b95
OBS-URL: https://build.opensuse.org/request/show/65005 OBS-URL: https://build.opensuse.org/package/show/devel:tools/cdecl?expand=0&rev=1
89 lines
2.4 KiB
Diff
89 lines
2.4 KiB
Diff
--- cdecl-2.5.orig/Makefile
|
|
+++ cdecl-2.5/Makefile
|
|
@@ -15,9 +15,9 @@
|
|
#
|
|
# add -DUSE_READLINE To compile in support for the GNU readline library.
|
|
|
|
-CFLAGS= -s -O2 -DUSE_READLINE
|
|
+CFLAGS= -g -O2 -DUSE_READLINE
|
|
CC= gcc
|
|
-LIBS= -lreadline -ltermcap
|
|
+LIBS= -lreadline
|
|
ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++
|
|
BINDIR= /usr/bin
|
|
MANDIR= /usr/man/man1
|
|
@@ -26,7 +26,7 @@
|
|
INSTALL_DATA= install -c -m 644
|
|
|
|
cdecl: c++decl
|
|
- ln c++decl cdecl
|
|
+ ln -s c++decl cdecl
|
|
|
|
c++decl: cdgram.c cdlex.c cdecl.c
|
|
$(CC) $(CFLAGS) -o c++decl cdecl.c $(LIBS)
|
|
@@ -44,7 +44,7 @@
|
|
|
|
install: cdecl
|
|
$(INSTALL) cdecl $(BINDIR)
|
|
- ln $(BINDIR)/cdecl $(BINDIR)/c++decl
|
|
+ ln -s cdecl $(BINDIR)/c++decl
|
|
$(INSTALL_DATA) cdecl.1 $(MANDIR)
|
|
$(INSTALL_DATA) c++decl.1 $(MANDIR)
|
|
|
|
--- cdecl-2.5.orig/cdecl.1
|
|
+++ cdecl-2.5/cdecl.1
|
|
@@ -274,7 +274,7 @@
|
|
<modifier> ::= short | long | unsigned | signed | <ptrmod>
|
|
<ptrmodlist> ::= <ptrmod> <ptrmodlist> | NOTHING
|
|
<ptrmod> ::= const | volatile | noalias
|
|
- <storage> ::= auto | extern | register | auto
|
|
+ <storage> ::= auto | extern | register | static
|
|
<optstorage> ::= NOTHING | <storage>
|
|
<options> ::= NOTHING | <options>
|
|
| create | nocreate
|
|
--- cdecl-2.5.orig/cdecl.c
|
|
+++ cdecl-2.5/cdecl.c
|
|
@@ -67,6 +67,7 @@
|
|
# include <stddef.h>
|
|
# include <string.h>
|
|
# include <stdarg.h>
|
|
+# include <errno.h>
|
|
#else
|
|
# ifndef NOVARARGS
|
|
# include <varargs.h>
|
|
@@ -90,7 +91,7 @@
|
|
#ifdef USE_READLINE
|
|
# include <readline/readline.h>
|
|
/* prototypes for functions related to readline() */
|
|
- char * getline();
|
|
+ char * get_line();
|
|
char ** attempt_completion(char *, int, int);
|
|
char * keyword_completion(char *, int);
|
|
char * command_completion(char *, int);
|
|
@@ -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);
|
|
@@ -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 * get_line ()
|
|
{
|
|
/* 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 = get_line())) {
|
|
if (!strcmp(line, "quit") || !strcmp(line, "exit")) {
|
|
free(line);
|
|
return ret;
|