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
|
--- fe.c
+++ fe.c
@@ -128,7 +128,7 @@
/* read rules
*/
- while ( (r = getline(f)) != 0) {
+ while ( (r = get_line(f)) != 0) {
rulecount++;
if (tail) {
tail->next = r;
--- getline.c
+++ getline.c
@@ -27,7 +27,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
- * getline() picks up a magicfilter rule line and passes it back to magicfilter
+ * get_line() picks up a magicfilter rule line and passes it back to magicfilter
*
* rules are:
*
@@ -172,10 +172,10 @@
/*
- * getline() gets a rule off the input stream
+ * get_line() gets a rule off the input stream
*/
struct rule *
-getline(FILE *input)
+get_line(FILE *input)
{
static char *bfr = 0; /* a buffer for reading lines into */
static int buflen = 0; /* size of that buffer */
@@ -189,13 +189,13 @@
/* initialize the line buffer the first time in
*/
if ( (bfr = malloc(buflen=80)) == 0) {
- perror("getline::malloc");
+ perror("get_line::malloc");
exit(1);
}
}
if ( (r = calloc(1, sizeof *r)) == 0) {
- perror("getline::calloc");
+ perror("get_line::calloc");
exit(1);
}
@@ -240,7 +240,7 @@
}
if ( (r->pattern = strdup(q)) == 0) {
- perror("getline::strdup");
+ perror("get_line::strdup");
exit(1);
}
@@ -289,7 +289,7 @@
if (hint)
if ( (r->hint = strdup(hint)) == 0) {
- perror("getline::strdup");
+ perror("get_line::strdup");
exit(1);
}
@@ -302,11 +302,11 @@
while ( (q = getarg(&p)) != 0) {
r->argv = realloc(r->argv, (3 + r->argc) * sizeof r->argv[0]);
if (r->argv == 0) {
- perror("getline::realloc");
+ perror("get_line::realloc");
exit(1);
}
if ( (r->argv[r->argc++] = strdup(q)) == 0) {
- perror("getline::strdup");
+ perror("get_line::strdup");
exit(1);
}
}
@@ -330,4 +330,4 @@
}
++ruleno;
return r;
-} /* getline */
+} /* get_line */
--- rule.h
+++ rule.h
@@ -55,7 +55,7 @@
struct rule *next; /* next rule in the chain */
} ;
-extern struct rule *getline(FILE *);
+extern struct rule *get_line(FILE *);
extern struct rule *rules;
char * action_p(enum rule_action);
|