summaryrefslogtreecommitdiff
path: root/www/bkedit/patches/patch-ac
blob: 9030f4c005c33562a91ce699376eb2e3adeb3e60 (plain)
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
$NetBSD: patch-ac,v 1.1 2006/06/25 13:46:37 wiz Exp $

Fixes gcc4 error:
error: invalid storage class for function 'non_greedy_parsing'

--- src/plugins/nn4/nn4_parse.lex.orig	2003-11-29 13:14:14.000000000 +0000
+++ src/plugins/nn4/nn4_parse.lex
@@ -38,6 +38,7 @@
 
 #undef YY_USES_REJECT
 
+static char *non_greedy_parsing (pattern [], char []);
 %}
 
 %option noyywrap
@@ -56,65 +57,6 @@ DOCTYPE		"<!DOCTYPE NETSCAPE-Bookmark-fi
 
 
 %{
-
-static char *non_greedy_parsing (pattern stop_pattern[], char yytext[])
-{
-	char_vector *text_cv  = char_vector_new (text_cv, 100);
-	char        *text_end = NULL;
-	char        *text;
-	int         in, i, which, chr_cnt = 0;
-
-	char_vector_add (text_cv, yytext[0]);
-
-	while ((text_end == NULL) && ((in = input ()) != EOF))
-	{
-		char_vector_add (text_cv, in);
-		chr_cnt++;
-
-		for (which = 0; stop_pattern[which].text != NULL; which++)
-		{
-			if (chr_cnt > stop_pattern[which].length)
-			{
-				stop_pattern[which].text_ptr++;
-			}
-		}
-
-		for (which = 0; stop_pattern[which].text != NULL; which++)
-		{
-			text_end = strstr ((text_cv->vector) + stop_pattern[which].text_ptr,
-						stop_pattern[which].text);
-			if (text_end != NULL)
-			{
-				break;
-			}
-		}
-	}
-
-	if (text_end != NULL)
-	{
-		*text_end = '\0';
-
-		for (i = strlen (stop_pattern[which].text) - 1; i >= 0; i--)
-		{
-			unput (stop_pattern[which].text[i]);
-		}
-	}
-	else
-	{
-		char_vector_del (text_cv);
-		return NULL;
-	}
-
-	text = strdup (text_cv->vector);
-	char_vector_del (text_cv);
-
-	return text;
-}
-
-%}
-
-
-%{
 /************************************************************************
  * doctype
  ************************************************************************/
@@ -283,6 +225,60 @@ static char *non_greedy_parsing (pattern
 
 %%
 
+static char *non_greedy_parsing (pattern stop_pattern[], char yytext[])
+{
+	char_vector *text_cv  = char_vector_new (text_cv, 100);
+	char        *text_end = NULL;
+	char        *text;
+	int         in, i, which, chr_cnt = 0;
+
+	char_vector_add (text_cv, yytext[0]);
+
+	while ((text_end == NULL) && ((in = input ()) != EOF))
+	{
+		char_vector_add (text_cv, in);
+		chr_cnt++;
+
+		for (which = 0; stop_pattern[which].text != NULL; which++)
+		{
+			if (chr_cnt > stop_pattern[which].length)
+			{
+				stop_pattern[which].text_ptr++;
+			}
+		}
+
+		for (which = 0; stop_pattern[which].text != NULL; which++)
+		{
+			text_end = strstr ((text_cv->vector) + stop_pattern[which].text_ptr,
+						stop_pattern[which].text);
+			if (text_end != NULL)
+			{
+				break;
+			}
+		}
+	}
+
+	if (text_end != NULL)
+	{
+		*text_end = '\0';
+
+		for (i = strlen (stop_pattern[which].text) - 1; i >= 0; i--)
+		{
+			unput (stop_pattern[which].text[i]);
+		}
+	}
+	else
+	{
+		char_vector_del (text_cv);
+		return NULL;
+	}
+
+	text = strdup (text_cv->vector);
+	char_vector_del (text_cv);
+
+	return text;
+}
+
 
 void yyerror (char *error_message)
 {