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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
Description: 1.03-14 changes, as part of conversion to 3.0/quilt
Original maintainer added a makefile, and various quoting changes in
the man pages and the code itself needed various C-89 modernization
(see debian/changelog 1.03-1.)
Author: Mark W. Eichin <eichin@thok.org>
--- /dev/null
+++ lx-gdb-1.03/Makefile
@@ -0,0 +1,34 @@
+#
+# makefile for gdbdump/gdbload
+# C source by Steve Roth <stever@cup.hp.com>/Arne Christensen <arc@pine.dk>
+# Makefile by Darren Stalder <torin@daft.com>
+
+VERSION = 1.03
+
+prefix = /usr/local
+BINDIR = $(prefix)/bin
+MANDIR = $(prefix)/share/man/man1
+
+PROGRAMS = gdbload gdbdump
+MANPAGES = gdbload.1 gdbdump.1
+SOURCES = gdbload.c gdbdump.c
+CFLAGS = -Wall -O2 -Wstrict-prototypes
+
+all binary: $(PROGRAMS)
+
+# the following assumes a GNU install. If you don't have one use install-cp
+
+install: $(PROGRAMS)
+ install -m 755 $(PROGRAMS) $(BINDIR)
+ install -m 644 $(MANPAGES) $(MANDIR)
+
+install-cp: $(PROGRAMS)
+ cp $(PROGRAMS) $(BINDIR)
+ (cd $(BINDIR); chmod 755 $(PROGRAMS))
+ cp $(MANPAGES) $(MANDIR)
+ (cd $(MANDIR); chmod 644 $(MANPAGES))
+
+clean:
+ -rm -f $(PROGRAMS)
+
+.PHONY: all binary install install-cp clean
--- lx-gdb-1.03.orig/gdbload.1
+++ lx-gdb-1.03/gdbload.1
@@ -56,18 +56,19 @@ Text fields, category fields, number fie
have their text quoted if it contains commas or newlines.
The following escape sequences are understood:
.RS
-. Can't produce a \ on Solaris nroff, need to manually substitute \ for % !
+.\" Can't produce a \ on Solaris nroff, need to manually substitute \ for % !
+.\" We can produce a \ using groff though...
.TP
-.B "%r"
+.B "\er"
Carriage return (ASCII 13).
.TP
-.B "%n"
+.B "\en"
Line feed (ASCII 10).
.TP
-.B "%nnn"
+.B "\ennn"
nnn are octal digits representing a character.
.TP
-.B "%xnn"
+.B "\exnn"
nn are hexadecimal digits representing a character.
.RE
.PP
--- lx-gdb-1.03.orig/gdbload.c
+++ lx-gdb-1.03/gdbload.c
@@ -71,11 +71,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
/* This define is needed for HP-UX systems, and probably not anywhere else
* I would guess. Comment it in if needed.
*/
-/*#define stricmp strcasecmp*/
+#if defined(__hpux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
+#define stricmp strcasecmp
+#endif
#define MAXFIELDS 100 /* Max. fields in a database */
@@ -110,14 +113,14 @@ FILE * hfOld; /* Old database handle
FILE * hfIn; /* Input stream handle */
/* This routine exits the program with an error message. */
-die(char * message)
+int die(char * message)
{
fprintf(stderr, "gdbload(%d): %s\n", lineNum, message);
exit(1);
}
/* This routine exits the program with a usage message. */
-usage()
+int usage(void)
{
fprintf(stderr,
"usage: gdbload [-an] <database file> [<input file>]\n");
@@ -157,7 +160,7 @@ void parseArgs(int argc,
}
/* Generate the file names we need. */
-void makeFileNames()
+void makeFileNames(void)
{
char * pch;
@@ -448,7 +451,7 @@ RecordHandler RecordHandlers[32] =
/* This routine copies the appropriate records of the old database to the
* new.
*/
-void copyDatabase()
+void copyDatabase(void)
{
uchar rechdr[6]; /* Record header buffer */
int reclen; /* Record length */
@@ -509,7 +512,7 @@ void copyDatabase()
}
/* This routine reads a line of input and breaks it into fields. */
-void readLine()
+void readLine(void)
{
int field = 0; /* Field number being read */
int matchQuote = FALSE; /* Inside quotation marks */
@@ -655,9 +658,9 @@ int matchField(uchar * name1,
namebuf1[20] = namebuf2[20] = '\0';
/* Remove &s from the field names */
- while (pch = strchr(namebuf1, '&'))
+ while ((pch = strchr(namebuf1, '&')) != NULL)
memmove(pch, pch+1, strlen(pch));
- while (pch = strchr(namebuf2, '&'))
+ while ((pch = strchr(namebuf2, '&')) != NULL)
memmove(pch, pch+1, strlen(pch));
/* Return a case-insensitive comparison of the result. */
@@ -667,7 +670,7 @@ int matchField(uchar * name1,
/* This routine reads the line of field names and compares it with the
* field definitions in the database.
*/
-void readFields()
+void readFields(void)
{
int i;
@@ -919,11 +922,11 @@ void DoField(uchar * line,
}
/* This routine adds the input records to the database. */
-void addRecords()
+void addRecords(void)
{
uchar rechdr[6]; /* Record header buffer */
int endrec; /* Offset of first unused by in rec */
- int note; /* Record # of associated note */
+ int note = 0; /* Record # of associated note */
int i;
do
@@ -975,7 +978,7 @@ void addRecords()
/* This routine writes out the database header, the categories record,
* and the index table.
*/
-void writeHeader()
+void writeHeader(void)
{
uchar rechdr[6]; /* Record header buffer */
int reclen; /* Record length */
@@ -1013,8 +1016,8 @@ void writeHeader()
}
/* Main program. */
-main(int argc,
- char * argv[])
+int main(int argc,
+ char * argv[])
{
parseArgs(argc, argv);
makeFileNames();
|