--- 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 @@ -25,11 +25,13 @@ INSTALL= install -c INSTALL_DATA= install -c -m 644 +LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) + 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) + $(CC) $(CFLAGS) -o c++decl cdecl.c $(LIBS) $(LDFLAGS) rm -f cdecl cdlex.c: cdlex.l @@ -44,7 +46,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 @@ ::= short | long | unsigned | signed | ::= | NOTHING ::= const | volatile | noalias - ::= auto | extern | register | auto + ::= auto | extern | register | static ::= NOTHING | ::= NOTHING | | create | nocreate --- cdecl-2.5.orig/cdecl.c +++ cdecl-2.5/cdecl.c @@ -67,6 +67,7 @@ # include # include # include +# include #else # ifndef NOVARARGS # include @@ -90,10 +91,10 @@ #ifdef USE_READLINE # include /* prototypes for functions related to readline() */ - char * getline(); - char ** attempt_completion(char *, int, int); + char * get_line(); + char ** attempt_completion(const char *, int, int); char * keyword_completion(char *, int); - char * command_completion(char *, int); + char * command_completion(const char *, int); #endif /* maximum # of chars from progname to display in prompt */ @@ -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); @@ -241,7 +241,7 @@ /* for unsupported combinations of types. */ void mbcheck() { - register int i, j, restrict; + register int i, j, restriction; char *t1, *t2; /* Loop through the types */ @@ -258,26 +258,26 @@ if (!(modbits & crosstypes[j].bit)) continue; /* check the type of restriction */ - restrict = crosscheck[i][j]; - if (restrict == ALWAYS) + restriction = crosscheck[i][j]; + if (restriction == ALWAYS) continue; t1 = crosstypes[i].name; t2 = crosstypes[j].name; - if (restrict == NEVER) + if (restriction == NEVER) { notsupported("", t1, t2); } - else if (restrict == RITCHIE) + else if (restriction == RITCHIE) { if (RitchieFlag) notsupported(" (Ritchie Compiler)", t1, t2); } - else if (restrict == PREANSI) + else if (restriction == PREANSI) { if (PreANSIFlag || RitchieFlag) notsupported(" (Pre-ANSI Compiler)", t1, t2); } - else if (restrict == ANSI) + else if (restriction == ANSI) { if (!RitchieFlag && !PreANSIFlag) notsupported(" (ANSI Compiler)", t1, t2); @@ -286,7 +286,7 @@ { (void) fprintf (stderr, "%s: Internal error in crosscheck[%d,%d]=%d!\n", - progname, i, j, restrict); + progname, i, j, restriction); exit(1); /* NOTREACHED */ } } @@ -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. */ @@ -395,16 +395,16 @@ return (line_read); } -char ** attempt_completion(char *text, int start, int end) +char ** attempt_completion(const char *text, int start, int end) { char **matches = NULL; - if (start == 0) matches = completion_matches(text, command_completion); + if (start == 0) matches = rl_completion_matches(text, command_completion); return matches; } -char * command_completion(char *text, int flag) +char * command_completion(const char *text, int flag) { static int index, len; char *command; @@ -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; @@ -1251,8 +1251,8 @@ #ifdef USE_READLINE /* install completion handlers */ - rl_attempted_completion_function = (CPPFunction *)attempt_completion; - rl_completion_entry_function = (Function *)keyword_completion; + rl_attempted_completion_function = (rl_completion_func_t *)attempt_completion; + rl_completion_entry_function = (rl_compentry_func_t *)keyword_completion; #endif setprogname(argv[0]); --- cdecl-2.5.orig/debian/changelog +++ cdecl-2.5/debian/changelog @@ -0,0 +1,85 @@ +cdecl (2.5-13) unstable; urgency=low + + * Fixed lintian warnings + * Renamed restrict to restriction (closes: #689326) + * Did not close properly last release: Fixed readline build (closes: #741835) + + -- Fredrik Hallenberg Sat, 29 Mar 2014 17:37:34 +0100 + +cdecl (2.5-12) untable; urgency=low + + * Fixed readline build (closes: 741835) + + -- Fredrik Hallenberg Sun, 23 Mar 2014 09:18:56 +0100 + +cdecl (2.5-11) unstable; urgency=low + + * Applied patch from Colin Watson : + Rename getline to get_line to avoid conflict with POSIX:2008. + (closes: #550373) + + -- Fredrik Hallenberg Fri, 09 Oct 2009 18:57:29 +0200 + +cdecl (2.5-10) unstable; urgency=low + + * Removed dependency on libreadline5-dev. + + -- Fredrik Hallenberg Mon, 14 Sep 2009 07:33:01 +0200 + +cdecl (2.5-9) unstable; urgency=low + + * Fixed lintian warnings. + + -- Fredrik Hallenberg Sun, 28 Dec 2008 14:45:04 +0100 + +cdecl (2.5-8) unstable; urgency=low + + * Build-depend on libreadline5-dev (closes: #326381) + + -- Fredrik Hallenberg Sun, 4 Sep 2005 13:11:23 +0200 + +cdecl (2.5-7) unstable; urgency=low + + * Applied patch from Mauro Antonio Persano + to fix minor bug in cdecl manpage. + * Fixed spelling error in description (closes: #124487) + + -- Fredrik Hallenberg Wed, 18 Jun 2003 18:37:38 +0200 + +cdecl (2.5-6) unstable; urgency=low + + * Fixed build problem (closes: #134470) + * Removed hard link + + -- Fredrik Hallenberg Sun, 17 Feb 2002 22:09:52 +0100 + +cdecl (2.5-5) unstable; urgency=low + + * Fixed diverts so that a correct man page filename is used. + + -- Fredrik Hallenberg Tue, 4 Jul 2000 12:49:22 +0200 + +cdecl (2.5-4) frozen unstable; urgency=low + + * Fixed build-depends (closes: #55757) + + -- Fredrik Hallenberg Thu, 20 Jan 2000 09:55:30 +0100 + +cdecl (2.5-3) frozen unstable; urgency=low + + * Updated man page divertion to avoid conflict with cutils. + (closes: #55408) + + -- Fredrik Hallenberg Mon, 17 Jan 2000 10:44:30 +0100 + +cdecl (2.5-2) unstable; urgency=low + + * Recompile with new readline and ncurses. + + -- Fredrik Hallenberg Sun, 16 Jan 2000 14:03:11 +0100 + +cdecl (2.5-1) unstable; urgency=low + + * Initial Release. + + -- Fredrik Hallenberg Wed, 7 Jul 1999 21:47:26 +0200 --- cdecl-2.5.orig/debian/compat +++ cdecl-2.5/debian/compat @@ -0,0 +1,2 @@ +7 + --- cdecl-2.5.orig/debian/control +++ cdecl-2.5/debian/control @@ -0,0 +1,17 @@ +Source: cdecl +Section: devel +Priority: optional +Maintainer: Fredrik Hallenberg +Standards-Version: 3.9.5 +Build-Depends: debhelper (>=7), bison, flex, libreadline-dev + +Package: cdecl +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Turn English phrases to C or C++ declarations + Cdecl is a program which will turn English-like phrases such as "declare + foo as array 5 of pointer to function returning int" into C declarations + such as "int (*foo[5])()". It can also translate the C into the pseudo- + English. And it handles typecasts, too. Plus C++. And in this version + it has command line editing and history with the GNU readline library. + --- cdecl-2.5.orig/debian/copyright +++ cdecl-2.5/debian/copyright @@ -0,0 +1,8 @@ +This package was debianized by Fredrik Hallenberg on +Wed, 7 Jul 1999 21:39:17 +0200. + +It was downloaded from ftp://ftp.cc.gatech.edu/pub/linux/devel/lang/c + +Upstream Author: David R. Conrad + +In the public domain. --- cdecl-2.5.orig/debian/dirs +++ cdecl-2.5/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/man/man1 + --- cdecl-2.5.orig/debian/postrm +++ cdecl-2.5/debian/postrm @@ -0,0 +1,10 @@ +#!/bin/sh -e + +if [ "$1" = remove ]; then + dpkg-divert --package cdecl --remove --rename \ + --divert /usr/bin/cdecl.cutils /usr/bin/cdecl + dpkg-divert --package cdecl --remove --rename \ + --divert /usr/share/man/man1/cdecl.cutils.1.gz /usr/share/man/man1/cdecl.1.gz +fi + +#DEBHELPER# --- cdecl-2.5.orig/debian/preinst +++ cdecl-2.5/debian/preinst @@ -0,0 +1,31 @@ +#!/bin/sh -e + +if [ "$1" = upgrade ]; then + if [ -n "`dpkg-divert --list | grep /usr/man/man1/cdecl.1.cutils`" ]; then + if [ -f /usr/man/man1/cdecl.1.gz ]; then + rm /usr/man/man1/cdecl.1.gz + fi + dpkg-divert --package cdecl --remove --rename \ + --divert /usr/man/man1/cdecl.1.cutils.gz /usr/man/man1/cdecl.1.gz + dpkg-divert --package cdecl --add --rename \ + --divert /usr/share/man/man1/cdecl.cutils.1.gz /usr/share/man/man1/cdecl.1.gz + fi + if [ -n "`dpkg-divert --list | grep /usr/share/man/man1/cdecl.1.cutils`" ]; then + if [ -f /usr/share/man/man1/cdecl.1.gz ]; then + rm /usr/share/man/man1/cdecl.1.gz + fi + dpkg-divert --package cdecl --remove --rename \ + --divert /usr/share/man/man1/cdecl.1.cutils.gz /usr/share/man/man1/cdecl.1.gz + dpkg-divert --package cdecl --add --rename \ + --divert /usr/share/man/man1/cdecl.cutils.1.gz /usr/share/man/man1/cdecl.1.gz + fi +fi + +if [ "$1" = install ]; then + dpkg-divert --package cdecl --add --rename \ + --divert /usr/bin/cdecl.cutils /usr/bin/cdecl + dpkg-divert --package cdecl --add --rename \ + --divert /usr/share/man/man1/cdecl.cutils.1.gz /usr/share/man/man1/cdecl.1.gz +fi + +#DEBHELPER# --- cdecl-2.5.orig/debian/rules +++ cdecl-2.5/debian/rules @@ -0,0 +1,6 @@ +#!/usr/bin/make -f +%: + dh $@ + +override_dh_auto_install: + $(MAKE) install BINDIR=debian/cdecl/usr/bin MANDIR=debian/cdecl/usr/share/man/man1 --- cdecl-2.5.orig/debian/substvars +++ cdecl-2.5/debian/substvars @@ -0,0 +1 @@ +shlibs:Depends=libc6 (>= 2.3.5-1), libreadline4 (>= 4.3-1)