updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / glimpse / compile.patch
blob2de74fd962388cd0363319a6fc835d04d30a1c94
1 --- ./get_index.c.orig 1996-07-16 00:39:40.000000000 +0200
2 +++ ./get_index.c 2010-07-15 11:22:14.000000000 +0200
3 @@ -1,4 +1,5 @@
4 /* Copyright (c) 1994 Burra Gopal, Udi Manber. All Rights Reserved. */
5 +#include <errno.h>
6 #include "glimpse.h"
7 #include "defs.h"
9 @@ -14,7 +15,6 @@
10 extern unsigned int *dest_index_set;
11 extern unsigned char *dest_index_buf;
12 extern int mask_int[32];
13 -extern int errno;
14 extern int ByteLevelIndex;
15 extern int NOBYTELEVEL;
16 extern int OPTIMIZEBYTELEVEL;
17 --- ./agrep/checksg.c.orig 1996-07-16 00:39:29.000000000 +0200
18 +++ ./agrep/checksg.c 2010-07-15 11:22:14.000000000 +0200
19 @@ -1,8 +1,8 @@
20 /* Copyright (c) 1994 Sun Wu, Udi Manber, Burra Gopal. All Rights Reserved. */
21 +#include <errno.h>
22 #include "agrep.h"
23 #include "checkfile.h"
25 -extern int errno;
26 extern CHAR Progname[MAXNAME];
27 extern int SGREP, PAT_FILE, PAT_BUFFER, EXITONERROR, SIMPLEPATTERN,
28 CONSTANT, D, NOUPPER, JUMP, I, LINENUM, INVERSE, WORDBOUND, WHOLELINE,
29 --- ./agrep/bitap.c.orig 1996-07-16 00:39:28.000000000 +0200
30 +++ ./agrep/bitap.c 2010-07-15 11:22:14.000000000 +0200
31 @@ -33,7 +33,6 @@
32 extern int agrep_outlen;
33 extern int agrep_outpointer;
34 extern FILE *agrep_finalfp;
35 -extern int errno;
37 extern int NEW_FILE, POST_FILTER;
39 --- ./agrep/agrep.c.orig 1996-07-16 00:39:29.000000000 +0200
40 +++ ./agrep/agrep.c 2010-07-15 11:24:19.000000000 +0200
41 @@ -4,6 +4,7 @@
42 * selectively modified many routines to work with our text-compression algo.
44 #include <sys/stat.h>
45 +#include <time.h>
46 #include "agrep.h"
47 #include "checkfile.h"
48 #include <errno.h>
49 @@ -11,7 +12,6 @@
50 #define PRINT(s)
52 extern char **environ;
53 -extern int errno;
54 int pattern_index; /* index in argv where the pattern is */
56 int glimpse_isserver=0; /* so that there is no user interaction */
57 --- ./agrep/newmgrep.c.orig 1996-07-16 00:39:29.000000000 +0200
58 +++ ./agrep/newmgrep.c 2010-07-15 11:22:14.000000000 +0200
59 @@ -62,7 +62,6 @@
60 extern int agrep_outpointer;
61 extern int agrep_outlen;
62 extern CHAR * agrep_outbuffer;
63 -extern int errno;
64 extern int NEW_FILE, POST_FILTER;
66 extern int tuncompressible();
67 --- ./agrep/parse.c.orig 1996-07-16 00:39:28.000000000 +0200
68 +++ ./agrep/parse.c 2010-07-15 11:25:33.000000000 +0200
69 @@ -4,6 +4,8 @@
70 tree for that regular expression. */
72 #include <stdio.h>
73 +#include <stdlib.h>
74 +#include <string.h>
75 #include "re.h"
77 #define FALSE 0
78 --- ./agrep/preprocess.c.orig 1996-07-16 00:39:28.000000000 +0200
79 +++ ./agrep/preprocess.c 2010-07-15 11:22:14.000000000 +0200
80 @@ -13,6 +13,7 @@
81 /* upon return, Pattern contains the pattern to be processed by maskgen */
82 /* D_pattern contains transformed D_pattern */
84 +#include <errno.h>
85 #include "agrep.h"
87 extern int PAT_FILE, PAT_BUFFER;
88 @@ -25,7 +26,6 @@
89 extern int table[WORD][WORD];
90 extern int agrep_initialfd;
91 extern int EXITONERROR;
92 -extern int errno;
94 extern int multifd;
95 extern char *multibuf;
96 --- ./agrep/checkfile.c.orig 1996-07-16 00:39:28.000000000 +0200
97 +++ ./agrep/checkfile.c 2010-07-15 11:22:14.000000000 +0200
98 @@ -24,7 +24,6 @@
99 #define MAXLINE 512
101 extern char Progname[];
102 -extern int errno;
104 unsigned char ibuf[MAXLINE];
106 --- ./agrep/maskgen.c.orig 1996-07-16 00:39:28.000000000 +0200
107 +++ ./agrep/maskgen.c 2010-07-15 11:22:14.000000000 +0200
108 @@ -1,4 +1,5 @@
109 /* Copyright (c) 1994 Sun Wu, Udi Manber, Burra Gopal. All Rights Reserved. */
110 +#include <errno.h>
111 #include "agrep.h"
113 extern unsigned D_endpos, endposition, Init1, wildmask;
114 @@ -7,7 +8,6 @@
115 extern unsigned char Progname[];
116 extern int agrep_initialfd;
117 extern int EXITONERROR;
118 -extern int errno;
121 maskgen(Pattern, D)
122 --- ./agrep/sgrep.c.orig 1996-07-16 00:39:29.000000000 +0200
123 +++ ./agrep/sgrep.c 2010-07-15 11:22:14.000000000 +0200
124 @@ -65,7 +65,6 @@
125 extern int NEW_FILE, POST_FILTER;
127 extern int EXITONERROR;
128 -extern int errno;
129 extern int TCOMPRESSED;
130 extern int EASYSEARCH;
131 extern char FREQ_FILE[MAX_LINE_LEN], HASH_FILE[MAX_LINE_LEN], STRING_FILE[MAX_LINE_LEN];
132 --- ./agrep/asearch.c.orig 1996-07-16 00:39:28.000000000 +0200
133 +++ ./agrep/asearch.c 2010-07-15 11:22:14.000000000 +0200
134 @@ -9,7 +9,6 @@
135 extern int I, num_of_matched, prev_num_of_matched, TRUNCATE;
137 extern int CurrentByteOffset;
138 -extern int errno;
139 extern CHAR *agrep_inbuffer;
140 extern int agrep_inlen;
141 extern int agrep_initialfd;
142 --- ./agrep/compat.c.orig 1996-07-16 00:39:28.000000000 +0200
143 +++ ./agrep/compat.c 2010-07-15 11:22:14.000000000 +0200
144 @@ -1,6 +1,7 @@
145 /* Copyright (c) 1994 Sun Wu, Udi Manber, Burra Gopal. All Rights Reserved. */
146 /* test the conflicts between options */
147 #include <stdio.h>
148 +#include <errno.h>
149 #include "agrep.h"
151 extern int D;
152 @@ -15,7 +16,6 @@
153 extern char Progname[32];
154 extern int agrep_initialfd;
155 extern int EXITONERROR;
156 -extern int errno;
159 compat()
160 --- ./index/glimpse.c.orig 1996-07-18 03:58:47.000000000 +0200
161 +++ ./index/glimpse.c 2010-07-15 11:22:14.000000000 +0200
162 @@ -1,6 +1,7 @@
163 /* Copyright (c) 1994 Sun Wu, Udi Manber, Burra Gopal. All Rights Reserved. */
164 /* ./glimpse/index/glimpse.c */
165 #include "glimpse.h"
166 +#include <errno.h>
167 #include <stdlib.h>
168 #include <sys/time.h>
169 #if ISO_CHAR_SET
170 @@ -8,7 +9,6 @@
171 #endif
173 extern char **environ;
174 -extern int errno;
175 extern FILE *TIMEFILE; /* file descriptor for sorting .glimpse_filenames by time */
176 #if BG_DEBUG
177 extern FILE *LOGFILE; /* file descriptor for LOG output */
178 --- ./index/partition.c.orig 1996-07-16 00:39:42.000000000 +0200
179 +++ ./index/partition.c 2010-07-15 11:22:14.000000000 +0200
180 @@ -1,6 +1,7 @@
181 /* Copyright (c) 1994 Sun Wu, Udi Manber, Burra Gopal. All Rights Reserved. */
182 /* ./glimpse/index/partition.c */
183 #include "glimpse.h"
184 +#include <errno.h>
185 #include <sys/stat.h>
186 #include <sys/time.h>
188 @@ -26,7 +27,6 @@
189 int files_per_partition;
190 int files_in_partition;
191 int ATLEASTONEFILE = 0;
192 -extern int errno;
194 char patbuf[MAX_PAT];
195 extern unsigned char *src_index_buf;
196 --- ./index/region.c.orig 1996-07-16 00:39:42.000000000 +0200
197 +++ ./index/region.c 2010-07-15 11:27:00.000000000 +0200
198 @@ -1,6 +1,8 @@
199 /* Copyright (c) 1994 Sun Wu, Udi Manber, Burra Gopal. All Rights Reserved. */
200 /* From mail received from Bill Camargo and Darren Hardy in June 1994 */
201 #include <stdio.h>
202 +#include <stdlib.h>
203 +#include <string.h>
204 #include "region.h"
207 @@ -464,7 +466,7 @@
208 while (rl != NULL) {
209 trl = rl;
210 rl = rl->next;
211 - free(trl, sizeof(region_t));
212 + free(trl);
214 current_regions = nextpos = NULL;
215 return 0;
216 --- ./index/build_in.c.orig 1996-07-16 00:39:41.000000000 +0200
217 +++ ./index/build_in.c 2010-07-15 11:22:14.000000000 +0200
218 @@ -23,6 +23,7 @@
219 this 12 19 \n is 9 17 12 18 19 \n an 7 12 \n example 16 \n
220 -----------------------------------------------------------------------*/
222 +#include <errno.h>
223 #include "glimpse.h"
225 #define debugt
226 @@ -394,7 +395,6 @@
227 int ret;
228 char s[MAX_LINE_LEN], es1[MAX_LINE_LEN], es2[MAX_LINE_LEN], es3[MAX_LINE_LEN];
229 char s1[MAX_LINE_LEN];
230 - extern int errno;
231 static int maxsortlinelen = 0;
232 int i;
234 --- ./main.c.orig 1996-07-16 05:03:12.000000000 +0200
235 +++ ./main.c 2010-07-15 11:22:14.000000000 +0200
236 @@ -26,7 +26,6 @@
238 /* Borrowed from C-Lib */
239 extern char **environ;
240 -extern int errno;
242 #if CLIENTSERVER
243 #include "communicate.c"
244 --- ./libtemplate/util/log.c.orig 1996-07-16 00:39:50.000000000 +0200
245 +++ ./libtemplate/util/log.c 2010-07-15 11:22:14.000000000 +0200
246 @@ -55,7 +55,7 @@
247 #include <errno.h>
248 #include <time.h>
249 #include <sys/file.h>
250 -#if defined(__STRICT_ANSI__)
251 +#if defined(__STRICT_ANSI__) || (defined(__GNUC__) && __GNUC__ >= 3)
252 #include <stdarg.h>
253 #else
254 #include <varargs.h>
255 @@ -119,7 +119,7 @@
257 * log() - used like printf(3). Prints message to stdout.
259 -#if defined(__STRICT_ANSI__)
260 +#if defined(__STRICT_ANSI__) || (defined(__GNUC__) && __GNUC__ >= 3)
261 void log(char *fmt,...)
263 va_list ap;
264 @@ -155,7 +155,7 @@
266 * errorlog() - used like printf(3). Prints error message to stderr.
268 -#if defined(__STRICT_ANSI__)
269 +#if defined(__STRICT_ANSI__) || (defined(__GNUC__) && __GNUC__ >= 3)
270 void errorlog(char *fmt,...)
272 va_list ap;
273 @@ -193,7 +193,7 @@
275 * fatal() - used like printf(3). Prints error message to stderr and exits
277 -#if defined(__STRICT_ANSI__)
278 +#if defined(__STRICT_ANSI__) || (defined(__GNUC__) && __GNUC__ >= 3)
279 void fatal(char *fmt,...)
281 va_list ap;
282 --- ./libtemplate/util/Makefile.in.orig 1996-07-16 00:39:50.000000000 +0200
283 +++ ./libtemplate/util/Makefile.in 2010-07-15 11:22:14.000000000 +0200
284 @@ -27,7 +27,7 @@
286 LIBDIR = ../lib
287 LIBFILE = libutil.a
288 -OBJS = buffer.o host.o log.o strdup.o system.o strerror.o \
289 +OBJS = buffer.o host.o log.o system.o \
290 string.o xmalloc.o
292 all: $(LIBFILE)
293 --- ./libtemplate/include/util.h.orig 1996-07-16 00:39:47.000000000 +0200
294 +++ ./libtemplate/include/util.h 2010-07-15 11:22:14.000000000 +0200
295 @@ -93,9 +93,14 @@
296 void init_log3 _PARAMS((char *,FILE *,FILE *)); /* Initialize log routines */
297 void log_errno _PARAMS((char *)); /* Same as perror(3) */
298 void fatal_errno _PARAMS((char *)); /* Same as perror(3) & exit */
299 -#ifdef __STRICT_ANSI__
300 +#if defined(__STRICT_ANSI__) || (defined(__GNUC__) && __GNUC__ >= 3)
301 #include <stdarg.h>
302 +# if defined(__GNUC__)
303 +#define log xlog
304 +void xlog _PARAMS((char *, ...)); /* Log a message */
305 +# else
306 void log _PARAMS((char *, ...)); /* Log a message */
307 +#endif
308 void errorlog _PARAMS((char *, ...)); /* Log an error message */
309 void fatal _PARAMS((char *, ...)); /* Log error msg and exit */
310 #else
311 @@ -104,11 +109,6 @@
312 void fatal _PARAMS(());
313 #endif
315 -#ifdef NO_STRDUP
316 -/* from strdup.c */
317 -char *strdup _PARAMS((char *)); /* Duplicate a string */
318 -#endif
320 /* from string.c */
321 void parse_argv _PARAMS((char **, char *)); /* Parse a command string */
323 --- ./Makefile.in.orig 1996-07-16 00:39:27.000000000 +0200
324 +++ ./Makefile.in 2010-07-15 11:22:14.000000000 +0200
325 @@ -34,7 +34,7 @@
327 CFLAGS = @CFLAGS@ -O -DSTRUCTURED_QUERIES=1
328 ALL_CFLAGS = $(CFLAGS) $(DEFS) -I$(INDEXSRC) -I$(AGREPSRC) -I$(TEMPLATESRC)/include
329 -LINKFLAGS = @LINKFLAGS@ -I$(INDEXSRC) -I$(AGREPSRC) -I$(TEMPLATESRC)/include
330 +LINKFLAGS = -I$(INDEXSRC) -I$(AGREPSRC) -I$(TEMPLATESRC)/include
332 .c.o:
333 $(CC) -c $(ALL_CFLAGS) $<