aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/graph.c1
-rw-r--r--src/html.gram.y34
-rw-r--r--src/html.lex.l10
-rw-r--r--src/log.c16
-rw-r--r--src/main.c77
-rw-r--r--src/readconfig.c32
-rw-r--r--src/report.c40
-rw-r--r--src/stat.c65
-rw-r--r--src/tagr.h5
9 files changed, 149 insertions, 131 deletions
diff --git a/src/graph.c b/src/graph.c
index bfd00cb..1464e8b 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -55,4 +55,5 @@ int graph_h_margin[2] = { 100, 14 };
55int graph_v_margin[2] = { 14, 35 }; 55int graph_v_margin[2] = { 14, 35 };
56 56
57/* FIXME: I18N?? */
57char *rate_unit = "Bytes per Second"; 58char *rate_unit = "Bytes per Second";
58 59
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
@@ -114,5 +114,5 @@ expr : value
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 }
@@ -146,10 +146,10 @@ expr : value
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 }
@@ -168,10 +168,10 @@ expr : value
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 }
@@ -190,15 +190,15 @@ expr : value
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 }
@@ -216,5 +216,5 @@ expr : value
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 }
@@ -231,5 +231,5 @@ expr : value
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 }
@@ -274,5 +274,5 @@ create_html (pp_tab_t *tab, char *file, char *dest)
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 ();
@@ -287,5 +287,5 @@ create_html (pp_tab_t *tab, char *file, char *dest)
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;
@@ -294,5 +294,5 @@ create_html (pp_tab_t *tab, char *file, char *dest)
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));
@@ -495,5 +495,5 @@ read_symtab (pp_tab_t **tab, const char *name)
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;
@@ -504,5 +504,5 @@ read_symtab (pp_tab_t **tab, const char *name)
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;
@@ -524,5 +524,5 @@ read_symtab (pp_tab_t **tab, const char *name)
524 if (*p) 524 if (*p)
525 { 525 {
526 logmsg (L_ERR, "%s:%u: invalid numeric value: %s", 526 logmsg (L_ERR, _("%s:%u: invalid numeric value: %s"),
527 name, line, value); 527 name, line, value);
528 status = 1; 528 status = 1;
@@ -534,5 +534,5 @@ read_symtab (pp_tab_t **tab, const char *name)
534 534
535 default: 535 default:
536 logmsg (L_NOTICE, "%s:%u: ignoring unknown command %#03o", 536 logmsg (L_NOTICE, _("%s:%u: ignoring unknown command %#03o"),
537 name, line, cmd); 537 name, line, cmd);
538 } 538 }
diff --git a/src/html.lex.l b/src/html.lex.l
index 931bfc1..0e0d423 100644
--- a/src/html.lex.l
+++ b/src/html.lex.l
@@ -44,5 +44,5 @@ N [0-9]+
44 if (find_value (yytext+1, &yylval.value)) 44 if (find_value (yytext+1, &yylval.value))
45 { 45 {
46 yyerror ("unknown identifier"); 46 yyerror (_("unknown identifier"));
47 init_value (&yylval.value, unspecified_value, NULL); 47 init_value (&yylval.value, unspecified_value, NULL);
48 } 48 }
@@ -53,5 +53,5 @@ N [0-9]+
53 if (find_value (yytext+2, &yylval.value)) 53 if (find_value (yytext+2, &yylval.value))
54 { 54 {
55 yyerror ("unknown identifier"); 55 yyerror (_("unknown identifier"));
56 init_value (&yylval.value, unspecified_value, NULL); 56 init_value (&yylval.value, unspecified_value, NULL);
57 } 57 }
@@ -63,5 +63,5 @@ N [0-9]+
63 if (find_value (yytext+2, &yylval.value)) 63 if (find_value (yytext+2, &yylval.value))
64 { 64 {
65 yyerror ("unknown identifier"); 65 yyerror (_("unknown identifier"));
66 init_value (&yylval.value, unspecified_value, NULL); 66 init_value (&yylval.value, unspecified_value, NULL);
67 } 67 }
@@ -78,5 +78,5 @@ N [0-9]+
78 if (find_value (yytext+2, &val)) 78 if (find_value (yytext+2, &val))
79 { 79 {
80 yyerror ("unknown identifier"); 80 yyerror (_("unknown identifier"));
81 init_value (&yylval.value, unspecified_value, NULL); 81 init_value (&yylval.value, unspecified_value, NULL);
82 } 82 }
@@ -131,5 +131,5 @@ html_open (char *file)
131 if (!yyin) 131 if (!yyin)
132 { 132 {
133 logmsg (L_ERR, "cannot open input file `%s': %s", 133 logmsg (L_ERR, _("cannot open input file `%s': %s"),
134 file, strerror (errno)); 134 file, strerror (errno));
135 return 1; 135 return 1;
diff --git a/src/log.c b/src/log.c
index de847c9..e5ae4e1 100644
--- a/src/log.c
+++ b/src/log.c
@@ -30,5 +30,5 @@
30#include <tagr.h> 30#include <tagr.h>
31 31
32int log_facility = LOGFACILITY; 32int log_facility = LOG_FACILITY;
33char *log_tag; 33char *log_tag;
34int log_print_severity; /* FIXME: not used */ 34int log_print_severity; /* FIXME: not used */
@@ -52,10 +52,10 @@ int syslog_level[] = {
52 52
53char *level_str[] = { 53char *level_str[] = {
54 "debug", 54 N_("debug"),
55 "info", 55 N_("info"),
56 "notice", 56 N_("notice"),
57 "warning", 57 N_("warning"),
58 "error", 58 N_("error"),
59 "CRITICAL", 59 N_("CRITICAL"),
60}; 60};
61 61
@@ -66,5 +66,5 @@ vlogmsg (int level, const char *fmt, va_list ap)
66 if (grecs_log_to_stderr) 66 if (grecs_log_to_stderr)
67 { 67 {
68 fprintf (stderr, "%s: %s: ", log_tag, level_str[level]); 68 fprintf (stderr, "%s: %s: ", log_tag, gettext (level_str[level]));
69 vfprintf (stderr, fmt, ap); 69 vfprintf (stderr, fmt, ap);
70 fprintf (stderr, "\n"); 70 fprintf (stderr, "\n");
diff --git a/src/main.c b/src/main.c
index 2a20ba9..9b98ec5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -81,6 +81,6 @@ static char *html_template_option = NULL;
81 81
82const char *program_version = "tagr (" PACKAGE_STRING ")"; 82const char *program_version = "tagr (" PACKAGE_STRING ")";