summaryrefslogtreecommitdiff
path: root/textproc/agrep/files/patch-mgrep.c
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2011-11-27 12:47:41 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2011-11-27 12:47:41 +0000
commitafcd9bf461ee813bd17c0718ef3211b5d09fc890 (patch)
treefefa270e267f6810de6521f1804e0f4e468613e5 /textproc/agrep/files/patch-mgrep.c
parent- Update to 0.16 (diff)
- add missing prototypes
- add missing includes - fix build with clang Feature safe: yes
Notes
Notes: svn path=/head/; revision=286502
Diffstat (limited to 'textproc/agrep/files/patch-mgrep.c')
-rw-r--r--textproc/agrep/files/patch-mgrep.c86
1 files changed, 82 insertions, 4 deletions
diff --git a/textproc/agrep/files/patch-mgrep.c b/textproc/agrep/files/patch-mgrep.c
index d7ac5b9730c8..367e33ac8474 100644
--- a/textproc/agrep/files/patch-mgrep.c
+++ b/textproc/agrep/files/patch-mgrep.c
@@ -1,14 +1,47 @@
---- mgrep.c.orig Thu Jun 26 21:03:50 2003
-+++ mgrep.c Thu Jun 26 21:03:53 2003
-@@ -1,6 +1,7 @@
+--- mgrep.c.orig 1992-04-11 00:12:27.000000000 +0200
++++ mgrep.c 2011-11-27 13:42:10.000000000 +0100
+@@ -1,7 +1,10 @@
/* Copyright (c) 1991 Sun Wu and Udi Manber. All Rights Reserved. */
/* multipattern matcher */
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
++#include <string.h>
++#include <unistd.h>
#define MAXPAT 256
#define MAXLINE 1024
-@@ -85,7 +86,7 @@
+ #define MAXSYM 256
+@@ -14,11 +17,16 @@
+ #define W_DELIM 128
+ #define L_DELIM 10
+
+-extern COUNT, FNAME, SILENT, FILENAMEONLY, num_of_matched;
+-extern INVERSE;
+-extern WORDBOUND, WHOLELINE, NOUPPER;
++void countline(unsigned char *text, int len);
++void monkey1( register unsigned char *text, int start, int end );
++void m_short( register unsigned char *text, int start, int end );
++void f_prep(int pat_index, unsigned char *Pattern);
++
++extern int COUNT, FNAME, SILENT, FILENAMEONLY, num_of_matched;
++extern int INVERSE;
++extern int WORDBOUND, WHOLELINE, NOUPPER;
+ extern unsigned char CurrentFileName[], Progname[];
+-extern total_line;
++extern int total_line;
+
+ int LONG = 0;
+ int SHORT = 0;
+@@ -37,7 +45,7 @@
+ unsigned char pat_len[max_num];
+
+
+-prepf(fp)
++void prepf(fp)
+ int fp;
+ {
+ int length=0, i, p=1, pdx=0, num_pat;
+@@ -85,7 +93,7 @@
if(p!=0 && p < p_size) p_size = p;
}
if(p_size == 0) {
@@ -17,3 +50,48 @@
exit(2);
}
if(length > 400 && p_size > 2) LONG = 1;
+@@ -98,7 +106,7 @@
+ }
+
+
+-mgrep(fd)
++void mgrep(fd)
+ int fd;
+ {
+ register char r_newline = '\n';
+@@ -136,7 +144,7 @@
+ return;
+ } /* end mgrep */
+
+-countline(text, len)
++void countline(text, len)
+ unsigned char *text; int len;
+ {
+ int i;
+@@ -144,7 +152,7 @@
+ }
+
+
+-monkey1( text, start, end )
++void monkey1( text, start, end )
+ int start, end; register unsigned char *text;
+ {
+ register unsigned char *textend;
+@@ -232,7 +240,7 @@
+ if(INVERSE && !COUNT) while(lastout <= textend) putchar(*lastout++);
+ }
+
+-m_short( text, start, end )
++void m_short( text, start, end )
+ int start, end; register unsigned char *text;
+ {
+ register unsigned char *textend;
+@@ -292,7 +300,7 @@
+ if(INVERSE && !COUNT) while(lastout <= textend) putchar(*lastout++);
+ }
+
+-f_prep(pat_index, Pattern)
++void f_prep(pat_index, Pattern)
+ unsigned char *Pattern ; int pat_index;
+ {
+ int i, j, m;