diff options
-rw-r--r-- | configure.ac | 18 | ||||
-rw-r--r-- | src/graph.c | 1 | ||||
-rw-r--r-- | src/html.gram.y | 34 | ||||
-rw-r--r-- | src/html.lex.l | 10 | ||||
-rw-r--r-- | src/log.c | 16 | ||||
-rw-r--r-- | src/main.c | 77 | ||||
-rw-r--r-- | src/readconfig.c | 32 | ||||
-rw-r--r-- | src/report.c | 40 | ||||
-rw-r--r-- | src/stat.c | 65 | ||||
-rw-r--r-- | src/tagr.h | 5 |
10 files changed, 167 insertions, 131 deletions
diff --git a/configure.ac b/configure.ac index a622998..70e0c79 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -74,8 +74,26 @@ AC_CHECK_HEADERS(gdbm.h, | |||
74 | AC_CHECK_LIB([gdbm], [gdbm_open], | 74 | AC_CHECK_LIB([gdbm], [gdbm_open], |
75 | , | 75 | , |
76 | [AC_MSG_ERROR([libgdbm not found])]) | 76 | [AC_MSG_ERROR([libgdbm not found])]) |
77 | 77 | ||
78 | ## Default syslog facility | ||
79 | LOG_FACILITY="LOG_DAEMON" | ||
80 | |||
81 | AC_ARG_VAR([LOG_FACILITY], | ||
82 | [Default syslog facility]) | ||
83 | if test -n "$LOG_FACILITY"; then | ||
84 | logfacility=`echo $LOG_FACILITY | tr a-z A-Z` | ||
85 | case $logfacility in | ||
86 | USER|DAEMON|AUTH|AUTHPRIV|MAIL|CRON|LOCAL[[0-7]]) | ||
87 | LOG_FACILITY=LOG_$logfacility;; | ||
88 | LOG_USER|LOG_DAEMON|LOG_AUTH|LOG_AUTHPRIV|LOG_MAIL|LOG_CRON|LOG_LOCAL[[0-7]]) | ||
89 | LOG_FACILITY=$logfacility;; | ||
90 | *) AC_MSG_ERROR([Invalid value of LOG_FACILITY]);; | ||
91 | esac | ||
92 | fi | ||
93 | AC_DEFINE_UNQUOTED([LOG_FACILITY],$LOG_FACILITY, | ||
94 | [Default syslog facility.]) | ||
95 | |||
78 | AC_CONFIG_FILES([Makefile | 96 | AC_CONFIG_FILES([Makefile |
79 | gnu/Makefile | 97 | gnu/Makefile |
80 | grecs/Makefile | 98 | grecs/Makefile |
81 | grecs/src/Makefile | 99 | grecs/src/Makefile |
diff --git a/src/graph.c b/src/graph.c index bfd00cb..1464e8b 100644 --- a/src/graph.c +++ b/src/graph.c | |||
@@ -53,8 +53,9 @@ int graph_ysize = 100; | |||
53 | 53 | ||
54 | int graph_h_margin[2] = { 100, 14 }; | 54 | int graph_h_margin[2] = { 100, 14 }; |
55 | int graph_v_margin[2] = { 14, 35 }; | 55 | int graph_v_margin[2] = { 14, 35 }; |
56 | 56 | ||
57 | /* FIXME: I18N?? */ | ||
57 | char *rate_unit = "Bytes per Second"; | 58 | char *rate_unit = "Bytes per Second"; |
58 | 59 | ||
59 | #define make_color_index(g, ar) \ | 60 | #define make_color_index(g, ar) \ |
60 | gdImageColorAllocate (g, (ar)[0], (ar)[1], (ar)[2]) | 61 | gdImageColorAllocate (g, (ar)[0], (ar)[1], (ar)[2]) |
diff --git a/src/html.gram.y b/src/html.gram.y index fae64ff..e488494 100644 --- a/src/html.gram.y +++ b/src/html.gram.y | |||
@@ -112,9 +112,9 @@ expr : value | |||
112 | || $3.type == unspecified_value) | 112 | || $3.type == unspecified_value) |
113 | init_value (&$$, unspecified_value, NULL); | 113 | init_value (&$$, unspecified_value, NULL); |
114 | else if ($1.type != $3.type) | 114 | else if ($1.type != $3.type) |
115 | { | 115 | { |
116 | yyerror ("type mismatch in addition"); | 116 | yyerror (_("type mismatch in addition")); |
117 | init_value (&$$, unspecified_value, NULL); | 117 | init_value (&$$, unspecified_value, NULL); |
118 | } | 118 | } |
119 | else | 119 | else |
120 | { | 120 | { |
@@ -144,14 +144,14 @@ expr : value | |||
144 | || $3.type == unspecified_value) | 144 | || $3.type == unspecified_value) |
145 | init_value (&$$, unspecified_value, NULL); | 145 | init_value (&$$, unspecified_value, NULL); |
146 | else if ($1.type != $3.type) | 146 | else if ($1.type != $3.type) |
147 | { | 147 | { |
148 | yyerror ("type mismatch in subtraction"); | 148 | yyerror (_("type mismatch in subtraction")); |
149 | init_value (&$$, unspecified_value, NULL); | 149 | init_value (&$$, unspecified_value, NULL); |
150 | } | 150 | } |
151 | else if ($1.type == string_value) | 151 | else if ($1.type == string_value) |
152 | { | 152 | { |
153 | yyerror ("subtraction not defined for strings"); | 153 | yyerror (_("subtraction not defined for strings")); |
154 | init_value (&$$, unspecified_value, NULL); | 154 | init_value (&$$, unspecified_value, NULL); |
155 | } | 155 | } |
156 | else | 156 | else |
157 | { | 157 | { |
@@ -166,14 +166,14 @@ expr : value | |||
166 | || $3.type == unspecified_value) | 166 | || $3.type == unspecified_value) |
167 | init_value (&$$, unspecified_value, NULL); | 167 | init_value (&$$, unspecified_value, NULL); |
168 | else if ($1.type != $3.type) | 168 | else if ($1.type != $3.type) |
169 | { | 169 | { |
170 | yyerror ("type mismatch in multiplication"); | 170 | yyerror (_("type mismatch in multiplication")); |
171 | init_value (&$$, unspecified_value, NULL); | 171 | init_value (&$$, unspecified_value, NULL); |
172 | } | 172 | } |
173 | else if ($1.type == string_value) | 173 | else if ($1.type == string_value) |
174 | { | 174 | { |
175 | yyerror ("multiplication not defined for strings"); | 175 | yyerror (_("multiplication not defined for strings")); |
176 | init_value (&$$, unspecified_value, NULL); | 176 | init_value (&$$, unspecified_value, NULL); |
177 | } | 177 | } |
178 | else | 178 | else |
179 | { | 179 | { |
@@ -188,19 +188,19 @@ expr : value | |||
188 | || $3.type == unspecified_value) | 188 | || $3.type == unspecified_value) |
189 | init_value (&$$, unspecified_value, NULL); | 189 | init_value (&$$, unspecified_value, NULL); |
190 | else if ($1.type != $3.type) | 190 | else if ($1.type != $3.type) |
191 | { | 191 | { |
192 | yyerror ("type mismatch in division"); | 192 | yyerror (_("type mismatch in division")); |
193 | init_value (&$$, unspecified_value, NULL); | 193 | init_value (&$$, unspecified_value, NULL); |
194 | } | 194 | } |
195 | else if ($1.type == string_value) | 195 | else if ($1.type == string_value) |
196 | { | 196 | { |
197 | yyerror ("division not defined for strings"); | 197 | yyerror (_("division not defined for strings")); |
198 | init_value (&$$, unspecified_value, NULL); | 198 | init_value (&$$, unspecified_value, NULL); |
199 | } | 199 | } |
200 | else if (fabs ($3.v.number) < 1.0e-5) | 200 | else if (fabs ($3.v.number) < 1.0e-5) |
201 | { | 201 | { |
202 | yyerror ("division by zero"); | 202 | yyerror (_("division by zero")); |
203 | init_value (&$$, unspecified_value, NULL); | 203 | init_value (&$$, unspecified_value, NULL); |
204 | } | 204 | } |
205 | else | 205 | else |
206 | { | 206 | { |
@@ -214,9 +214,9 @@ expr : value | |||
214 | if ($2.type == unspecified_value) | 214 | if ($2.type == unspecified_value) |
215 | init_value (&$$, unspecified_value, NULL); | 215 | init_value (&$$, unspecified_value, NULL); |
216 | else if ($2.type == string_value) | 216 | else if ($2.type == string_value) |
217 | { | 217 | { |
218 | yyerror ("unary minus not defined for strings"); | 218 | yyerror (_("unary minus not defined for strings")); |
219 | init_value (&$$, unspecified_value, NULL); | 219 | init_value (&$$, unspecified_value, NULL); |
220 | } | 220 | } |
221 | else | 221 | else |
222 | { | 222 | { |
@@ -229,9 +229,9 @@ expr : value | |||
229 | if ($2.type == unspecified_value) | 229 | if ($2.type == unspecified_value) |
230 | init_value (&$$, unspecified_value, NULL); | 230 | init_value (&$$, unspecified_value, NULL); |
231 | else if ($2.type == string_value) | 231 | else if ($2.type == string_value) |
232 | { | 232 | { |
233 | yyerror ("unary plus not defined for strings"); | 233 | yyerror (_("unary plus not defined for strings")); |
234 | init_value (&$$, unspecified_value, NULL); | 234 | init_value (&$$, unspecified_value, NULL); |
235 | } | 235 | } |
236 | else | 236 | else |
237 | { | 237 | { |
@@ -272,9 +272,9 @@ create_html (pp_tab_t *tab, char *file, char *dest) | |||
272 | 272 | ||
273 | tmp_file = fopen (tmp_file_name, "w"); | 273 | tmp_file = fopen (tmp_file_name, "w"); |
274 | if (!tmp_file) | 274 | if (!tmp_file) |
275 | { | 275 | { |
276 | logmsg (L_ERR, "cannot open output file `%s': %s", | 276 | logmsg (L_ERR, _("cannot open output file `%s': %s"), |
277 | file, strerror (errno)); | 277 | file, strerror (errno)); |
278 | html_close (); | 278 | html_close (); |
279 | return 1; | 279 | return 1; |
280 | } | 280 | } |
@@ -285,16 +285,16 @@ create_html (pp_tab_t *tab, char *file, char *dest) | |||
285 | if (rc == 0) | 285 | if (rc == 0) |
286 | { | 286 | { |
287 | if (unlink (dest) && errno != ENOENT) | 287 | if (unlink (dest) && errno != ENOENT) |
288 | { | 288 | { |
289 | logmsg (L_ERR, "cannot unlink file `%s': %s", | 289 | logmsg (L_ERR, _("cannot unlink file `%s': %s"), |
290 | dest, strerror (errno)); | 290 | dest, strerror (errno)); |
291 | rc = 1; | 291 | rc = 1; |
292 | } | 292 | } |
293 | 293 | ||
294 | if (rename (tmp_file_name, dest)) | 294 | if (rename (tmp_file_name, dest)) |
295 | { | 295 | { |
296 | logmsg (L_ERR, "cannot rename `%s' to `%s': %s", | 296 | logmsg (L_ERR, _("cannot rename `%s' to `%s': %s"), |
297 | tmp_file_name, dest, | 297 | tmp_file_name, dest, |
298 | strerror (errno)); | 298 | strerror (errno)); |
299 | rc = 1; | 299 | rc = 1; |
300 | } | 300 | } |
@@ -493,18 +493,18 @@ read_symtab (pp_tab_t **tab, const char *name) | |||
493 | p = buf; | 493 | p = buf; |
494 | cmd = *p++; | 494 | cmd = *p++; |
495 | if (*p != ' ' || !(isascii (*++p) && isalpha (*p))) | 495 | if (*p != ' ' || !(isascii (*++p) && isalpha (*p))) |
496 | { | 496 | { |
497 | logmsg (L_ERR, "%s:%u: invalid input: %s", | 497 | logmsg (L_ERR, _("%s:%u: invalid input: %s"), |
498 | name, line, buf); | 498 | name, line, buf); |
499 | status = 1; | 499 | status = 1; |
500 | break; | 500 | break; |
501 | } | 501 | } |
502 | var = p; | 502 | var = p; |
503 | p = strchr (var, ' '); | 503 | p = strchr (var, ' '); |
504 | if (!p) | 504 | if (!p) |
505 | { | 505 | { |
506 | logmsg (L_ERR, "%s:%u: invalid input: %s", | 506 | logmsg (L_ERR, _("%s:%u: invalid input: %s"), |
507 | name, line, buf); | 507 | name, line, buf); |
508 | status = 1; | 508 | status = 1; |
509 | break |