summaryrefslogtreecommitdiffabout
path: root/src/config.c
Unidiff
Diffstat (limited to 'src/config.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/config.c476
1 files changed, 238 insertions, 238 deletions
diff --git a/src/config.c b/src/config.c
index 11ac92d..60b5792 100644
--- a/src/config.c
+++ b/src/config.c
@@ -127,18 +127,18 @@ int
127string_to (const char *what, const char *str, 127string_to (const char *what, const char *str,
128 const char **args, int *vals, 128 const char **args, int *vals,
129 int *pret, 129 int *pret,
130 gconf_locus_t *locus) 130 grecs_locus_t *locus)
131{ 131{
132 ptrdiff_t x = ARGMATCH (str, args, vals); 132 ptrdiff_t x = ARGMATCH (str, args, vals);
133 133
134 if (x == (ptrdiff_t)-1) 134 if (x == (ptrdiff_t)-1)
135 { 135 {
136 gconf_error (locus, 0, _("unknown %s: %s"), what, str); 136 grecs_error (locus, 0, _("unknown %s: %s"), what, str);
137 return 1; 137 return 1;
138 } 138 }
139 else if (x == (ptrdiff_t)-2) 139 else if (x == (ptrdiff_t)-2)
140 { 140 {
141 gconf_error (locus, 0, _("ambiguous %s: %s"), what, str); 141 grecs_error (locus, 0, _("ambiguous %s: %s"), what, str);
142 return 1; 142 return 1;
143 } 143 }
144 *pret = vals[x]; 144 *pret = vals[x];
@@ -169,7 +169,7 @@ notification_event_str (enum notification_event evt)
169} 169}
170 170
171int 171int
172string_to_notification_event (gconf_locus_t *locus, const char *val, 172string_to_notification_event (grecs_locus_t *locus, const char *val,
173 enum notification_event *pret) 173 enum notification_event *pret)
174{ 174{
175 int rc, res; 175 int rc, res;
@@ -203,7 +203,7 @@ notification_target_str (enum notification_target tgt)
203} 203}
204 204
205int 205int
206string_to_notification_target (gconf_locus_t *locus, const char *val, 206string_to_notification_target (grecs_locus_t *locus, const char *val,
207 enum notification_target *pret) 207 enum notification_target *pret)
208{ 208{
209 int rc, res; 209 int rc, res;
@@ -217,35 +217,35 @@ string_to_notification_target (gconf_locus_t *locus, const char *val,
217 217
218 218
219int 219int
220assert_string_arg (gconf_locus_t *locus, 220assert_string_arg (grecs_locus_t *locus,
221 enum gconf_callback_command cmd, 221 enum grecs_callback_command cmd,
222 const gconf_value_t *value) 222 const grecs_value_t *value)
223{ 223{
224 if (cmd != gconf_callback_set_value) 224 if (cmd != grecs_callback_set_value)
225 { 225 {
226 gconf_error (locus, 0, _("Unexpected block statement")); 226 grecs_error (locus, 0, _("Unexpected block statement"));
227 return 1; 227 return 1;
228 } 228 }
229 if (!value || value->type != GCONF_TYPE_STRING) 229 if (!value || value->type != GCONF_TYPE_STRING)
230 { 230 {
231 gconf_error (locus, 0, _("expected scalar value as a tag")); 231 grecs_error (locus, 0, _("expected scalar value as a tag"));
232 return 1; 232 return 1;
233 } 233 }
234 return 0; 234 return 0;
235} 235}
236 236
237gconf_value_t * 237grecs_value_t *
238get_arg (gconf_locus_t *locus, gconf_value_t *value, unsigned n, int type) 238get_arg (grecs_locus_t *locus, grecs_value_t *value, unsigned n, int type)
239{ 239{
240 if (n >= value->v.arg.c) 240 if (n >= value->v.arg.c)
241 { 241 {
242 gconf_error (locus, 0, _("not enough arguments")); 242 grecs_error (locus, 0, _("not enough arguments"));
243 return NULL; 243 return NULL;
244 } 244 }
245 value = value->v.arg.v + n; 245 value = value->v.arg.v + n;
246 if (value->type != type) 246 if (value->type != type)
247 { 247 {
248 gconf_error (locus, 0, _("argument %d has wrong type"), n); 248 grecs_error (locus, 0, _("argument %d has wrong type"), n);
249 return NULL; 249 return NULL;
250 } 250 }
251 return value; 251 return value;
@@ -253,10 +253,10 @@ get_arg (gconf_locus_t *locus, gconf_value_t *value, unsigned n, int type)
253 253
254 254
255static int 255static int
256cb_mailer (enum gconf_callback_command cmd, 256cb_mailer (enum grecs_callback_command cmd,
257 gconf_locus_t *locus, 257 grecs_locus_t *locus,
258 void *varptr, 258 void *varptr,
259 gconf_value_t *value, 259 grecs_value_t *value,
260 void *cb_data) 260 void *cb_data)
261{ 261{
262 int rc; 262 int rc;
@@ -265,16 +265,16 @@ cb_mailer (enum gconf_callback_command cmd,
265 return 1; 265 return 1;
266 rc = mu_mailer_create (&mailer, value->v.string); 266 rc = mu_mailer_create (&mailer, value->v.string);
267 if (rc) 267 if (rc)
268 gconf_error (locus, 0, _("cannot create mailer `%s': %s"), 268 grecs_error (locus, 0, _("cannot create mailer `%s': %s"),
269 value->v.string, mu_strerror (rc)); 269 value->v.string, mu_strerror (rc));
270 return rc; 270 return rc;
271} 271}
272 272
273static int 273static int
274cb_email_address (enum gconf_callback_command cmd, 274cb_email_address (enum grecs_callback_command cmd,
275 gconf_locus_t *locus, 275 grecs_locus_t *locus,
276 void *varptr, 276 void *varptr,
277 gconf_value_t *value, 277 grecs_value_t *value,
278 void *cb_data) 278 void *cb_data)
279{ 279{
280 int rc; 280 int rc;
@@ -286,7 +286,7 @@ cb_email_address (enum gconf_callback_command cmd,
286 rc = mu_address_create (&addr, value->v.string); 286 rc = mu_address_create (&addr, value->v.string);
287 if (rc) 287 if (rc)
288 { 288 {
289 gconf_error (locus, 0, _("%s: invalid email address: %s"), 289 grecs_error (locus, 0, _("%s: invalid email address: %s"),
290 value->v.string, mu_strerror (rc)); 290 value->v.string, mu_strerror (rc));
291 return rc; 291 return rc;
292 } 292 }
@@ -299,7 +299,7 @@ cb_email_address (enum gconf_callback_command cmd,
299 299
300 while (gl_list_iterator_next (&itr, &p, NULL)) 300 while (gl_list_iterator_next (&itr, &p, NULL))
301 { 301 {
302 const gconf_value_t *vp = p; 302 const grecs_value_t *vp = p;
303 mu_address_t a; 303 mu_address_t a;
304 if (assert_string_arg (locus, cmd, vp)) 304 if (assert_string_arg (locus, cmd, vp))
305 return 1; 305 return 1;
@@ -309,7 +309,7 @@ cb_email_address (enum gconf_callback_command cmd,
309 rc = mu_address_union (&addr, a); 309 rc = mu_address_union (&addr, a);
310 else 310 else
311 { 311 {
312 gconf_error (locus, 0, _("%s: invalid email address: %s"), 312 grecs_error (locus, 0, _("%s: invalid email address: %s"),
313 vp->v.string, mu_strerror (rc)); 313 vp->v.string, mu_strerror (rc));
314 } 314 }
315 mu_address_destroy (&a); 315 mu_address_destroy (&a);
@@ -320,7 +320,7 @@ cb_email_address (enum gconf_callback_command cmd,
320 break; 320 break;
321 321
322 case GCONF_TYPE_ARRAY: 322 case GCONF_TYPE_ARRAY:
323 gconf_error (locus, 0, _("too many arguments")); 323 grecs_error (locus, 0, _("too many arguments"));
324 return 1; 324 return 1;
325 } 325 }
326 326
@@ -329,10 +329,10 @@ cb_email_address (enum gconf_callback_command cmd,
329} 329}
330 330
331static int 331static int
332cb_interval (enum gconf_callback_command cmd, 332cb_interval (enum grecs_callback_command cmd,
333 gconf_locus_t *locus, 333 grecs_locus_t *locus,
334 void *varptr, 334 void *varptr,
335 gconf_value_t *value, 335 grecs_value_t *value,
336 void *cb_data) 336 void *cb_data)
337{ 337{
338 int rc; 338 int rc;
@@ -346,7 +346,7 @@ cb_interval (enum gconf_callback_command cmd,
346 /* FIXME 2: Support ISO intervals? */ 346 /* FIXME 2: Support ISO intervals? */
347 rc = parse_time_interval (value->v.string, &interval, &endp); 347 rc = parse_time_interval (value->v.string, &interval, &endp);
348 if (rc) 348 if (rc)
349 gconf_error (locus, 0, _("unrecognized interval format (near `%s')"), 349 grecs_error (locus, 0, _("unrecognized interval format (near `%s')"),
350 endp); 350 endp);
351 else 351 else
352 *(time_t*) varptr = interval; 352 *(time_t*) varptr = interval;
@@ -354,10 +354,10 @@ cb_interval (enum gconf_callback_command cmd,
354} 354}
355 355
356static int 356static int
357cb_absolute_name (enum gconf_callback_command cmd, 357cb_absolute_name (enum grecs_callback_command cmd,
358 gconf_locus_t *locus, 358 grecs_locus_t *locus,
359 void *varptr, 359 void *varptr,
360 gconf_value_t *value, 360 grecs_value_t *value,
361 void *cb_data) 361 void *cb_data)
362{ 362{
363 char *word; 363 char *word;
@@ -368,17 +368,17 @@ cb_absolute_name (enum gconf_callback_command cmd,
368 368
369 word = safe_file_name ((char*)value->v.string); 369 word = safe_file_name ((char*)value->v.string);
370 if (!word || word[0] != '/') 370 if (!word || word[0] != '/')
371 gconf_error (locus, 0, _("must be an absolute file name")); 371 grecs_error (locus, 0, _("must be an absolute file name"));
372 else 372 else
373 *(char**) varptr = word; 373 *(char**) varptr = word;
374 return 0; 374 return 0;
375} 375}
376 376
377static int 377static int
378cb_set_umask (enum gconf_callback_command cmd, 378cb_set_umask (enum grecs_callback_command cmd,
379 gconf_locus_t *locus, 379 grecs_locus_t *locus,
380 void *varptr, 380 void *varptr,
381 gconf_value_t *value, 381 grecs_value_t *value,
382 void *cb_data) 382 void *cb_data)
383{ 383{
384 char *p; 384 char *p;
@@ -388,7 +388,7 @@ cb_set_umask (enum gconf_callback_command cmd,
388 return 1; 388 return 1;
389 m = strtoul (value->v.string, &p, 8) & 0777; 389 m = strtoul (value->v.string, &p, 8) & 0777;
390 if (*p) 390 if (*p)
391 gconf_error (locus, 0, _("invalid umask (near %s)"), p); 391 grecs_error (locus, 0, _("invalid umask (near %s)"), p);
392 else 392 else
393 umask (m); 393 umask (m);
394 return 0; 394 return 0;
@@ -431,7 +431,7 @@ static unsigned long stat_types[] = {
431ARGMATCH_VERIFY (stat_args, stat_types); 431ARGMATCH_VERIFY (stat_args, stat_types);
432 432
433static int 433static int
434parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val, 434parse_single_statmask (grecs_locus_t *locus, const grecs_value_t *val,
435 unsigned long *pmask, int *invert) 435 unsigned long *pmask, int *invert)
436{ 436{
437 const char *arg; 437 const char *arg;
@@ -439,7 +439,7 @@ parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val,
439 439
440 if (val->type != GCONF_TYPE_STRING) 440 if (val->type != GCONF_TYPE_STRING)
441 { 441 {
442 gconf_error (locus, 0, _("expected scalar value but found list")); 442 grecs_error (locus, 0, _("expected scalar value but found list"));
443 return 1; 443 return 1;
444 } 444 }
445 445
@@ -462,12 +462,12 @@ parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val,
462 462
463 if (x == (ptrdiff_t)-1) 463 if (x == (ptrdiff_t)-1)
464 { 464 {
465 gconf_error (locus, 0, _("unknown statistics type: %s"), arg); 465 grecs_error (locus, 0, _("unknown statistics type: %s"), arg);
466 return 1; 466 return 1;
467 } 467 }
468 else if (x == (ptrdiff_t)-2) 468 else if (x == (ptrdiff_t)-2)
469 { 469 {
470 gconf_error (locus, 0, _("ambiguous statistics type: %s"), arg); 470 grecs_error (locus, 0, _("ambiguous statistics type: %s"), arg);
471 return 1; 471 return 1;
472 } 472 }
473 *pmask = STAT_MASK (stat_types[x]); 473 *pmask = STAT_MASK (stat_types[x]);
@@ -475,7 +475,7 @@ parse_single_statmask (gconf_locus_t *locus, const gconf_value_t *val,
475} 475}
476 476
477static int 477static int
478parse_statmask (gconf_locus_t *loc, gconf_value_t *val, unsigned long *pmask) 478parse_statmask (grecs_locus_t *loc, grecs_value_t *val, unsigned long *pmask)
479{ 479{
480 int err = 0; 480 int err = 0;
481 int invert = 0; 481 int invert = 0;
@@ -511,7 +511,7 @@ parse_statmask (gconf_locus_t *loc, gconf_value_t *val, unsigned long *pmask)
511 511
512 while (gl_list_iterator_next (&itr, &p, NULL)) 512 while (gl_list_iterator_next (&itr, &p, NULL))
513 { 513 {
514 const gconf_value_t *vp = p; 514 const grecs_value_t *vp = p;
515 unsigned long x; 515 unsigned long x;
516 516
517 if (parse_single_statmask (loc, vp, &x, &invert)) 517 if (parse_single_statmask (loc, vp, &x, &invert))
@@ -530,10 +530,10 @@ parse_statmask (gconf_locus_t *loc, gconf_value_t *val, unsigned long *pmask)
530} 530}
531 531
532static int 532static int
533cb_statistics (enum gconf_callback_command cmd, 533cb_statistics (enum grecs_callback_command cmd,
534 gconf_locus_t *locus, 534 grecs_locus_t *locus,
535 void *varptr, 535 void *varptr,
536 gconf_value_t *value, 536 grecs_value_t *value,
537 void *cb_data) 537 void *cb_data)
538{ 538{
539 return parse_statmask (locus, value, varptr); 539 return parse_statmask (locus, value, varptr);
@@ -541,10 +541,10 @@ cb_statistics (enum gconf_callback_command cmd,
541 541
542 542
543static int 543static int
544cb_sql_host (enum gconf_callback_command cmd, 544cb_sql_host (enum grecs_callback_command cmd,
545 gconf_locus_t *locus, 545 grecs_locus_t *locus,
546 void *varptr, 546 void *varptr,
547 gconf_value_t *value, 547 grecs_value_t *value,
548 void *cb_data) 548 void *cb_data)
549{ 549{
550 struct sqlconn *pconn = varptr; 550 struct sqlconn *pconn = varptr;
@@ -569,12 +569,12 @@ cb_sql_host (enum gconf_callback_command cmd,
569 unsigned long n = strtoul (p, &end, 10); 569 unsigned long n = strtoul (p, &end, 10);
570 if (*end) 570 if (*end)
571 { 571 {
572 gconf_error (locus, 0, _("invalid port number (near %s)"), end); 572 grecs_error (locus, 0, _("invalid port number (near %s)"), end);
573 return 0; 573 return 0;
574 } 574 }
575 if (n == 0 || n > USHRT_MAX) 575 if (n == 0 || n > USHRT_MAX)
576 { 576 {
577 gconf_error (locus, 0, _("port number out of range 1..%d"), 577 grecs_error (locus, 0, _("port number out of range 1..%d"),
578 USHRT_MAX); 578 USHRT_MAX);
579 return 0; 579 return 0;
580 } 580 }
@@ -589,20 +589,20 @@ cb_sql_host (enum gconf_callback_command cmd,
589} 589}
590 590
591static int 591static int
592cb_sql (enum gconf_callback_command cmd, 592cb_sql (enum grecs_callback_command cmd,
593 gconf_locus_t *locus, 593 grecs_locus_t *locus,
594 void *varptr, 594 void *varptr,
595 gconf_value_t *value, 595 grecs_value_t *value,
596 void *cb_data) 596 void *cb_data)
597{ 597{
598 struct sqlconn *pconn; 598 struct sqlconn *pconn;
599 void **pdata = cb_data; 599 void **pdata = cb_data;
600 600
601 switch (cmd) { 601 switch (cmd) {
602 case gconf_callback_section_begin: 602 case grecs_callback_section_begin:
603 if (!value || value->type != GCONF_TYPE_STRING) 603 if (!value || value->type != GCONF_TYPE_STRING)
604 { 604 {
605 gconf_error(locus, 0, _("tag must be a string")); 605 grecs_error(locus, 0, _("tag must be a string"));
606 return 0; 606 return 0;
607 } 607 }
608 pconn = xzalloc (sizeof (*pconn)); 608 pconn = xzalloc (sizeof (*pconn));
@@ -610,79 +610,79 @@ cb_sql (enum gconf_callback_command cmd,
610 *pdata = pconn; 610 *pdata = pconn;
611 break; 611 break;
612 612
613 case gconf_callback_section_end: 613 case grecs_callback_section_end:
614 pconn = *pdata; 614 pconn = *pdata;
615 sql_register_conn (pconn); 615 sql_register_conn (pconn);
616 free (pconn); 616 free (pconn);
617 *pdata = NULL; 617 *pdata = NULL;
618 break; 618 break;
619 619
620 case gconf_callback_set_value: 620 case grecs_callback_set_value:
621 gconf_error (locus, 0, _("invalid use of block statement")); 621 grecs_error (locus, 0, _("invalid use of block statement"));
622 } 622 }
623 return 0; 623 return 0;
624} 624}
625 625
626static struct gconf_keyword sql_kw[] = { 626static struct grecs_keyword sql_kw[] = {
627 { "host", N_("host"), N_("Set SQL server hostname or IP address"), 627 { "host", N_("host"), N_("Set SQL server hostname or IP address"),
628 gconf_type_string, NULL, 0, cb_sql_host }, 628 grecs_type_string, NULL, 0, cb_sql_host },
629 { "database", N_("dbname"), N_("Set database name"), 629 { "database", N_("dbname"), N_("Set database name"),
630 gconf_type_string, NULL, offsetof(struct sqlconn, database), }, 630 grecs_type_string, NULL, offsetof(struct sqlconn, database), },
631 { "user", N_("name"), N_("Set SQL user name"), 631 { "user", N_("name"), N_("Set SQL user name"),
632 gconf_type_string, NULL, offsetof(struct sqlconn, user) }, 632 grecs_type_string, NULL, offsetof(struct sqlconn, user) },
633 { "password", N_("arg"), N_("Set SQL user password"), 633 { "password", N_("arg"), N_("Set SQL user password"),
634 gconf_type_string, NULL, offsetof(struct sqlconn, password) }, 634 grecs_type_string, NULL, offsetof(struct sqlconn, password) },
635 { NULL } 635 { NULL }
636}; 636};
637 637
638 638
639static int 639static int
640cb_syslog_facility (enum gconf_callback_command cmd, 640cb_syslog_facility (enum grecs_callback_command cmd,
641 gconf_locus_t *locus, 641 grecs_locus_t *locus,
642 void *varptr, 642 void *varptr,
643 gconf_value_t *value, 643 grecs_value_t *value,
644 void *cb_data) 644 void *cb_data)
645{ 645{
646 if (assert_string_arg (locus, cmd, value)) 646 if (assert_string_arg (locus, cmd, value))
647 return 1; 647 return 1;
648 648
649 if (mu_string_to_syslog_facility (value->v.string, varptr)) 649 if (mu_string_to_syslog_facility (value->v.string, varptr))
650 gconf_error (locus, 0, _("Unknown syslog facility `%s'"), 650 grecs_error (locus, 0, _("Unknown syslog facility `%s'"),
651 value->v.string); 651 value->v.string);
652 return 0; 652 return 0;
653} 653}
654 654
655 655
656static int 656static int
657cb_define_message (enum gconf_callback_command cmd, 657cb_define_message (enum grecs_callback_command cmd,
658 gconf_locus_t *locus, 658 grecs_locus_t *locus,
659 void *varptr, 659 void *varptr,
660 gconf_value_t *value, 660 grecs_value_t *value,
661 void *cb_data) 661 void *cb_data)
662{ 662{
663 const char *ident; 663 const char *ident;
664 664
665 if (cmd != gconf_callback_set_value) 665 if (cmd != grecs_callback_set_value)
666 { 666 {
667 gconf_error (locus, 0, _("Unexpected block statement")); 667 grecs_error (locus, 0, _("Unexpected block statement"));
668 return 1; 668 return 1;
669 } 669 }
670 if (!value || value->type != GCONF_TYPE_ARRAY || value->v.arg.c != 2) 670 if (!value || value->type != GCONF_TYPE_ARRAY || value->v.arg.c != 2)
671 { 671 {
672 gconf_error (locus, 0, _("expected two arguments")); 672 grecs_error (locus, 0, _("expected two arguments"));
673 return 1; 673 return 1;
674 } 674 }
675 675
676 if (value->v.arg.v[0].type != GCONF_TYPE_STRING) 676 if (value->v.arg.v[0].type != GCONF_TYPE_STRING)
677 { 677 {
678 gconf_error (locus, 0, _("first argument not a string")); 678 grecs_error (locus, 0, _("first argument not a string"));
679 return 1; 679 return 1;
680 } 680 }
681 ident = value->v.arg.v[0].v.string; 681 ident = value->v.arg.v[0].v.string;
682 682
683 if (value->v.arg.v[1].type != GCONF_TYPE_STRING) 683 if (value->v.arg.v[1].type != GCONF_TYPE_STRING)
684 { 684 {
685 gconf_error (locus, 0, _("second argument not a string")); 685 grecs_error (locus, 0, _("second argument not a string"));
686 return 1; 686 return 1;
687 } 687 }
688 688
@@ -692,17 +692,17 @@ cb_define_message (enum gconf_callback_command cmd,
692 692
693 693
694 694
695static struct gconf_keyword syslog_kw[] = { 695static struct grecs_keyword syslog_kw[] = {
696 { "facility", 696 { "facility",
697 N_("name"), 697 N_("name"),
698 N_("Set syslog facility. Arg is one of the following: user, daemon, " 698 N_("Set syslog facility. Arg is one of the following: user, daemon, "
699 "auth, authpriv, mail, cron, local0 through local7 (case-insensitive), " 699 "auth, authpriv, mail, cron, local0 through local7 (case-insensitive), "
700 "or a facility number."), 700 "or a facility number."),
701 gconf_type_string, &log_facility, 0, cb_syslog_facility }, 701 grecs_type_string, &log_facility, 0, cb_syslog_facility },
702 { "tag", N_("string"), N_("Tag syslog messages with this string"), 702 { "tag", N_("string"), N_("Tag syslog messages with this string"),
703 gconf_type_string, &syslog_tag }, 703 grecs_type_string, &syslog_tag },
704 { "print-priority", N_("arg"), N_("Prefix each message with its priority"), 704 { "print-priority", N_("arg"), N_("Prefix each message with its priority"),
705 gconf_type_bool, &syslog_include_prio }, 705 grecs_type_bool, &syslog_include_prio },
706 { NULL }, 706 { NULL },
707}; 707};
708 708
@@ -731,7 +731,7 @@ static const enum backup_type backup_types[] =
731ARGMATCH_VERIFY (backup_args, backup_types); 731ARGMATCH_VERIFY (backup_args, backup_types);
732 732
733static enum backup_type 733static enum backup_type
734get_backup_version (gconf_locus_t *locus, const char *ctx, 734get_backup_version (grecs_locus_t *locus, const char *ctx,
735 const char *version) 735 const char *version)
736{ 736{
737 if (version == 0 || *version == 0) 737 if (version == 0 || *version == 0)
@@ -742,19 +742,19 @@ get_backup_version (gconf_locus_t *locus, const char *ctx,
742 if (d == -2) 742 if (d == -2)
743 { 743 {
744 if (ctx) 744 if (ctx)
745 gconf_error (locus, 0, _("%s: ambiguous backup type `%s'"), 745 grecs_error (locus, 0, _("%s: ambiguous backup type `%s'"),
746 ctx, version); 746 ctx, version);
747 else 747 else
748 gconf_error (locus, 0, _("ambiguous backup type `%s'"), version); 748 grecs_error (locus, 0, _("ambiguous backup type `%s'"), version);
749 return no_backups; 749 return no_backups;
750 } 750 }
751 else if (d == -1) 751 else if (d == -1)
752 { 752 {
753 if (ctx) 753 if (ctx)
754 gconf_error (locus, 0, _("%s: invalid backup type `%s'"), 754 grecs_error (locus, 0, _("%s: invalid backup type `%s'"),
755 ctx, version); 755 ctx, version);
756 else 756 else
757 gconf_error (locus, 0, _("invalid backup type `%s'"), version); 757 grecs_error (locus, 0, _("invalid backup type `%s'"), version);
758 return no_backups; 758 return no_backups;
759 } 759 }
760 return backup_types[d]; 760 return backup_types[d];
@@ -762,10 +762,10 @@ get_backup_version (gconf_locus_t *locus, const char *ctx,
762} 762}
763 763
764static int 764static int
765cb_backup (enum gconf_callback_command cmd, 765cb_backup (enum grecs_callback_command cmd,
766 gconf_locus_t *locus, 766 grecs_locus_t *locus,
767 void *varptr, 767 void *varptr,
768 gconf_value_t *value, 768 grecs_value_t *value,
769 void *cb_data) 769 void *cb_data)
770{ 770{
771 enum backup_type *ptype = varptr; 771 enum backup_type *ptype = varptr;
@@ -776,20 +776,20 @@ cb_backup (enum gconf_callback_command cmd,
776 return 0; 776 return 0;
777} 777}
778 778
779static struct gconf_keyword archive_kw[] = { 779static struct grecs_keyword archive_kw[] = {
780 { "name", N_("file-or-dir"), N_("Name of archive file or directory"), 780 { "name", N_("file-or-dir"), N_("Name of archive file or directory"),
781 gconf_type_string, NULL, offsetof(struct archive_descr, name) }, 781 grecs_type_string, NULL, offsetof(struct archive_descr, name) },
782 { "backup", N_("type"), N_("Define backup type"), 782 { "backup", N_("type"), N_("Define backup type"),
783 gconf_type_string, NULL, offsetof(struct archive_descr, backup_type), 783 grecs_type_string, NULL, offsetof(struct archive_descr, backup_type),
784 cb_backup }, 784 cb_backup },
785 { NULL } 785 { NULL }
786}; 786};
787 787
788static int 788static int
789cb_archive (enum gconf_callback_command cmd, 789cb_archive (enum grecs_callback_command cmd,
790 gconf_locus_t *locus, 790 grecs_locus_t *locus,
791 void *varptr, 791 void *varptr,
792 gconf_value_t *value, 792 grecs_value_t *value,
793 void *cb_data) 793 void *cb_data)
794{ 794{
795 struct archive_descr *arch = varptr; 795 struct archive_descr *arch = varptr;
@@ -797,19 +797,19 @@ cb_archive (enum gconf_callback_command cmd,
797 797
798 switch (cmd) 798 switch (cmd)
799 { 799 {
800 case gconf_callback_section_begin: 800 case grecs_callback_section_begin:
801 *pdata = arch; 801 *pdata = arch;
802 /* fallthrough */ 802 /* fallthrough */
803 case gconf_callback_set_value: 803 case grecs_callback_set_value:
804 if (!value) 804 if (!value)
805 { 805 {
806 gconf_error (locus, 0, _("expected tag")); 806 grecs_error (locus, 0, _("expected tag"));
807 return 1; 807 return 1;
808 } 808 }
809 809
810 if (value->type != GCONF_TYPE_STRING) 810 if (value->type != GCONF_TYPE_STRING)
811 { 811 {
812 gconf_error (locus, 0, _("expected scalar value but found list")); 812 grecs_error (locus, 0, _("expected scalar value but found list"));
813 return 1; 813 return 1;
814 } 814 }
815 815
@@ -821,14 +821,14 @@ cb_archive (enum gconf_callback_command cmd,
821 arch->type = archive_directory; 821 arch->type = archive_directory;
822 else 822 else
823 { 823 {
824 gconf_error (locus, 0, _("unknown archive type")); 824 grecs_error (locus, 0, _("unknown archive type"));
825 return 1; 825 return 1;
826 } 826 }
827 if (cmd == gconf_callback_section_begin) 827 if (cmd == grecs_callback_section_begin)
828 return 0; 828 return 0;
829 break; 829 break;
830 830
831 case gconf_callback_section_end: 831 case grecs_callback_section_end:
832 break; 832 break;
833 } 833 }
834 834
@@ -837,13 +837,13 @@ cb_archive (enum gconf_callback_command cmd,
837 837
838 if (arch->name == NULL) 838 if (arch->name == NULL)
839 { 839 {
840 gconf_error (locus, 0, _("at least archive name must be set")); 840 grecs_error (locus, 0, _("at least archive name must be set"));
841 return 1; 841 return 1;
842 } 842 }
843 843
844 if (arch->type == archive_tar && arch->backup_type != no_backups) 844 if (arch->type == archive_tar && arch->backup_type != no_backups)
845 { 845 {
846 gconf_warning (locus, 0, _("backup type ignored for this archive type")); 846 grecs_warning (locus, 0, _("backup type ignored for this archive type"));
847 return 1; 847 return 1;
848 } 848 }
849 849
@@ -851,22 +851,22 @@ cb_archive (enum gconf_callback_command cmd,
851} 851}
852 852
853 853
854static struct gconf_keyword mail_statistics_kw[] = { 854static struct grecs_keyword mail_statistics_kw[] = {
855 { "message", N_("text"), N_("Message text"), 855 { "message", N_("text"), N_("Message text"),
856 gconf_type_string, &admin_stat_message }, 856 grecs_type_string, &admin_stat_message },
857 { "statistics", 857 { "statistics",
858 N_("items"), N_("Send mail if one or more of these items are set"), 858 N_("items"), N_("Send mail if one or more of these items are set"),
859 gconf_type_string, &mail_admin_mask, 0, cb_statistics }, 859 grecs_type_string, &mail_admin_mask, 0, cb_statistics },
860 { NULL } 860 { NULL }
861}; 861};
862 862
863 863
864 864
865static int 865static int
866cb_event (enum gconf_callback_command cmd, 866cb_event (enum grecs_callback_command cmd,
867 gconf_locus_t *locus, 867 grecs_locus_t *locus,
868 void *varptr, 868 void *varptr,
869 gconf_value_t *value, 869 grecs_value_t *value,
870 void *cb_data) 870 void *cb_data)
871{ 871{
872 enum notification_event *pev = varptr; 872 enum notification_event *pev = varptr;
@@ -878,10 +878,10 @@ cb_event (enum gconf_callback_command cmd,
878} 878}
879 879
880static int 880static int
881cb_recipient (enum gconf_callback_command cmd, 881cb_recipient (enum grecs_callback_command cmd,
882 gconf_locus_t *locus, 882 grecs_locus_t *locus,
883 void *varptr, 883 void *varptr,
884 gconf_value_t *value, 884 grecs_value_t *value,
885 void *cb_data) 885 void *cb_data)
886{ 886{
887 enum notification_target *tgt = varptr; 887 enum notification_target *tgt = varptr;
@@ -892,38 +892,38 @@ cb_recipient (enum gconf_callback_command cmd,
892 return 0; 892 return 0;
893} 893}
894 894
895static struct gconf_keyword notify_event_kw[] = { 895static struct grecs_keyword notify_event_kw[] = {
896 { "event", N_("ev-id"), N_("Event on which to notify"), 896 { "event", N_("ev-id"), N_("Event on which to notify"),
897 gconf_type_string, NULL, offsetof(struct notification, ev), cb_event }, 897 grecs_type_string, NULL, offsetof(struct notification, ev), cb_event },
898 { "recipient", N_("who"), N_("Notify this recipient"), 898 { "recipient", N_("who"), N_("Notify this recipient"),
899 gconf_type_string, NULL, offsetof(struct notification, tgt), 899 grecs_type_string, NULL, offsetof(struct notification, tgt),
900 cb_recipient }, 900 cb_recipient },
901 { "message", N_("text-or-id"), 901 { "message", N_("text-or-id"),
902 N_("Text of the notification or identifier of a defined message template"), 902 N_("Text of the notification or identifier of a defined message template"),
903 gconf_type_string, NULL, offsetof(struct notification, msg) }, 903 grecs_type_string, NULL, offsetof(struct notification, msg) },
904 { NULL } 904 { NULL }
905}; 905};
906 906
907static int 907static int
908cb_notify_event (enum gconf_callback_command cmd, 908cb_notify_event (enum grecs_callback_command cmd,
909 gconf_locus_t *locus, 909 grecs_locus_t *locus,
910 void *varptr, 910 void *varptr,
911 gconf_value_t *value, 911 grecs_value_t *value,
912 void *cb_data) 912 void *cb_data)
913{ 913{
914 struct notification *ntf; 914 struct notification *ntf;
915 void **pdata = cb_data; 915 void **pdata = cb_data;
916 916
917 switch (cmd) { 917 switch (cmd) {
918 case gconf_callback_section_begin: 918 case grecs_callback_section_begin:
919 ntf = xzalloc (sizeof (*ntf)); 919 ntf = xzalloc (sizeof (*ntf));
920 *pdata = ntf; 920 *pdata = ntf;
921 break; 921 break;
922 922
923 case gconf_callback_section_end: 923 case grecs_callback_section_end:
924 ntf = *pdata; 924 ntf = *pdata;
925 if (!ntf->msg) 925 if (!ntf->msg)
926 gconf_error (locus, 0, _("missing message definition")); 926 grecs_error (locus, 0, _("missing message definition"));
927 else 927 else
928 { 928 {
929 struct notification **p = (struct notification **) varptr; 929 struct notification **p = (struct notification **) varptr;
@@ -933,8 +933,8 @@ cb_notify_event (enum gconf_callback_command cmd,
933 } 933 }
934 break; 934 break;
935 935
936 case gconf_callback_set_value: 936 case grecs_callback_set_value:
937 gconf_error (locus, 0, _("invalid use of block statement")); 937 grecs_error (locus, 0, _("invalid use of block statement"));
938 } 938 }
939 return 0; 939 return 0;
940} 940}
@@ -955,10 +955,10 @@ string_to_access_method_type (const char *str)
955} 955}
956 956
957static int 957static int
958cb_access_method_type (enum gconf_callback_command cmd, 958cb_access_method_type (enum grecs_callback_command cmd,
959 gconf_locus_t *locus, 959 grecs_locus_t *locus,
960 void *varptr, 960 void *varptr,
961 gconf_value_t *value, 961 grecs_value_t *value,
962 void *cb_data) 962 void *cb_data)
963{ 963{
964 enum access_method_type *ptype = varptr; 964 enum access_method_type *ptype = varptr;
@@ -967,28 +967,28 @@ cb_access_method_type (enum gconf_callback_command cmd,
967 return 1; 967 return 1;
968 *ptype = string_to_access_method_type (value->v.string); 968 *ptype = string_to_access_method_type (value->v.string);
969 if (*ptype == method_none) 969 if (*ptype == method_none)
970 gconf_error (locus, 0, _("unknown access method: %s"), value->v.string); 970 grecs_error (locus, 0, _("unknown access method: %s"), value->v.string);
971 return 0; 971 return 0;
972} 972}
973 973
974static int 974static int
975cb_access_method_params (enum gconf_callback_command cmd, 975cb_access_method_params (enum grecs_callback_command cmd,
976 gconf_locus_t *locus, 976 grecs_locus_t *locus,
977 void *varptr, 977 void *varptr,
978 gconf_value_t *value, 978 grecs_value_t *value,
979 void *cb_data) 979 void *cb_data)
980{ 980{
981 struct access_method *meth = varptr; 981 struct access_method *meth = varptr;
982 size_t size; 982 size_t size;
983 983
984 if (cmd != gconf_callback_set_value) 984 if (cmd != grecs_callback_set_value)
985 { 985 {
986 gconf_error (locus, 0, _("Unexpected block statement")); 986 grecs_error (locus, 0, _("Unexpected block statement"));
987 return 1; 987 return 1;
988 } 988 }
989 if (!value || value->type != GCONF_TYPE_LIST) 989 if (!value || value->type != GCONF_TYPE_LIST)
990 { 990 {
991 gconf_error (locus, 0, _("expected list value")); 991 grecs_error (locus, 0, _("expected list value"));
992 return 1; 992 return 1;
993 } 993 }
994 994
@@ -1009,7 +1009,7 @@ cb_access_method_params (enum gconf_callback_command cmd,
1009 1009
1010 for (i = 0; gl_list_iterator_next (&itr, &p, NULL); i++) 1010 for (i = 0; gl_list_iterator_next (&itr, &p, NULL); i++)
1011 { 1011 {
1012 const gconf_value_t *vp = p; 1012 const grecs_value_t *vp = p;
1013 1013
1014 if (assert_string_arg (locus, cmd, vp)) 1014 if (assert_string_arg (locus, cmd, vp))
1015 break; 1015 break;
@@ -1022,20 +1022,20 @@ cb_access_method_params (enum gconf_callback_command cmd,
1022 return 0; 1022 return 0;
1023} 1023}
1024 1024
1025static struct gconf_keyword access_method_kw[] = { 1025static struct grecs_keyword access_method_kw[] = {
1026 { "type", N_("type"), N_("Method type"), 1026 { "type", N_("type"), N_("Method type"),
1027 gconf_type_string, NULL, offsetof(struct access_method, type), 1027 grecs_type_string, NULL, offsetof(struct access_method, type),
1028 cb_access_method_type }, 1028 cb_access_method_type },
1029 { "query", N_("string"), N_("Query template"), 1029 { "query", N_("string"), N_("Query template"),
1030 gconf_type_string, NULL, offsetof(struct access_method, query) }, 1030 grecs_type_string, NULL, offsetof(struct access_method, query) },
1031 { "params", N_("arg"), N_("Set method parameters"), 1031 { "params", N_("arg"), N_("Set method parameters"),
1032 gconf_type_string|GCONF_LIST, NULL, 0, 1032 grecs_type_string|GCONF_LIST, NULL, 0,
1033 cb_access_method_params }, 1033 cb_access_method_params },
1034 { NULL } 1034 { NULL }
1035}; 1035};
1036 1036
1037int 1037int
1038string_to_access_method_id (gconf_locus_t *locus, 1038string_to_access_method_id (grecs_locus_t *locus,
1039 const char *str, enum access_method_id *idp) 1039 const char *str, enum access_method_id *idp)
1040{ 1040{
1041 static const char *id_str[] = { 1041 static const char *id_str[] = {
@@ -1063,10 +1063,10 @@ string_to_access_method_id (gconf_locus_t *locus,
1063} 1063}
1064 1064
1065static int 1065static int
1066cb_access_method (enum gconf_callback_command cmd, 1066cb_access_method (enum grecs_callback_command cmd,
1067 gconf_locus_t *locus, 1067 grecs_locus_t *locus,
1068 void *varptr, 1068 void *varptr,
1069 gconf_value_t *value, 1069 grecs_value_t *value,
1070 void *cb_data) 1070 void *cb_data)
1071{ 1071{
1072 struct access_method **pmeth, *meth; 1072 struct access_method **pmeth, *meth;
@@ -1074,10 +1074,10 @@ cb_access_method (enum gconf_callback_command cmd,
1074 enum access_method_id id; 1074 enum access_method_id id;
1075 1075
1076 switch (cmd) { 1076 switch (cmd) {
1077 case gconf_callback_section_begin: 1077 case grecs_callback_section_begin:
1078 if (!value || value->type != GCONF_TYPE_STRING) 1078 if (!value || value->type != GCONF_TYPE_STRING)
1079 { 1079 {
1080 gconf_error(locus, 0, _("tag must be a string")); 1080 grecs_error(locus, 0, _("tag must be a string"));
1081 return 0; 1081 return 0;
1082 } 1082 }
1083 if (string_to_access_method_id (locus, value->v.string, &id)) 1083 if (string_to_access_method_id (locus, value->v.string, &id))
@@ -1087,19 +1087,19 @@ cb_access_method (enum gconf_callback_command cmd,
1087 *pdata = *pmeth; 1087 *pdata = *pmeth;
1088 break; 1088 break;
1089 1089
1090 case gconf_callback_section_end: 1090 case grecs_callback_section_end:
1091 meth = *pdata; 1091 meth = *pdata;
1092 switch (meth->type) 1092 switch (meth->type)
1093 { 1093 {
1094 case method_sql: 1094 case method_sql:
1095 if (meth->parmc == 0 || !meth->parmv[0]) 1095 if (meth->parmc == 0 || !meth->parmv[0])
1096 { 1096 {
1097 gconf_error (locus, 0, _("SQL connection is not declared")); 1097 grecs_error (locus, 0, _("SQL connection is not declared"));
1098 meth->type = method_none; 1098 meth->type = method_none;
1099 } 1099 }
1100 else if (!sql_connection_exists_p (meth->parmv[0])) 1100 else if (!sql_connection_exists_p (meth->parmv[0]))
1101 { 1101 {
1102 gconf_error (locus, 0, _("SQL connection `%s' not declared"), 1102 grecs_error (locus, 0, _("SQL connection `%s' not declared"),
1103 meth->parmv[0]); 1103 meth->parmv[0]);
1104 meth->type = method_none; 1104 meth->type = method_none;
1105 } 1105 }
@@ -1112,17 +1112,17 @@ cb_access_method (enum gconf_callback_command cmd,
1112 *pdata = NULL; 1112 *pdata = NULL;
1113 break; 1113 break;
1114 1114
1115 case gconf_callback_set_value: 1115 case grecs_callback_set_value:
1116 gconf_error (locus, 0, _("invalid use of block statement")); 1116 grecs_error (locus, 0, _("invalid use of block statement"));
1117 } 1117 }
1118 return 0; 1118 return 0;
1119} 1119}
1120 1120
1121static int 1121static int
1122cb_url (enum gconf_callback_command cmd, 1122cb_url (enum grecs_callback_command cmd,
1123 gconf_locus_t *locus, 1123 grecs_locus_t *locus,
1124 void *varptr, 1124 void *varptr,
1125 gconf_value_t *value, 1125 grecs_value_t *value,
1126 void *cb_data) 1126 void *cb_data)
1127{ 1127{
1128 mu_url_t *purl = varptr, url; 1128 mu_url_t *purl = varptr, url;
@@ -1133,14 +1133,14 @@ cb_url (enum gconf_callback_command cmd,
1133 rc = mu_url_create (&url, value->v.string); 1133 rc = mu_url_create (&url, value->v.string);
1134 if (rc) 1134 if (rc)
1135 { 1135 {
1136 gconf_error (locus, 0, _("cannot create URL `%s': %s"), 1136 grecs_error (locus, 0, _("cannot create URL `%s': %s"),
1137 value->v.string, mu_strerror (rc)); 1137 value->v.string, mu_strerror (rc));
1138 return rc; 1138 return rc;
1139 } 1139 }
1140 rc = mu_url_parse (url); 1140 rc = mu_url_parse (url);
1141 if (rc) 1141 if (rc)
1142 { 1142 {
1143 gconf_error (locus, 0, _("cannot parse URL `%s': %s"), 1143 grecs_error (locus, 0, _("cannot parse URL `%s': %s"),
1144 value->v.string, mu_strerror (rc)); 1144 value->v.string, mu_strerror (rc));
1145 mu_url_destroy (&url); 1145 mu_url_destroy (&url);
1146 return rc; 1146 return rc;
@@ -1150,39 +1150,39 @@ cb_url (enum gconf_callback_command cmd,
1150} 1150}
1151 1151
1152 1152
1153static struct gconf_keyword spool_kw[] = { 1153static struct grecs_keyword spool_kw[] = {
1154 { "url", N_("arg"), N_("URL corresponding to this spool"), 1154 { "url", N_("arg"), N_("URL corresponding to this spool"),
1155 gconf_type_string, NULL, offsetof(struct spool, url) }, 1155 grecs_type_string, NULL, offsetof(struct spool, url) },
1156 { "alias", N_("arg"), N_("Aliases"), 1156 { "alias", N_("arg"), N_("Aliases"),
1157 gconf_type_string|GCONF_LIST, NULL, offsetof(struct spool, aliases) }, 1157 grecs_type_string|GCONF_LIST, NULL, offsetof(struct spool, aliases) },
1158 { "source", N_("dir"), N_("Source directory"), 1158 { "source", N_("dir"), N_("Source directory"),
1159 gconf_type_string, NULL, offsetof(struct spool, source_dir) }, 1159 grecs_type_string, NULL, offsetof(struct spool, source_dir) },
1160 { "destination", N_("dir"), N_("Destination directory"), 1160 { "destination", N_("dir"), N_("Destination directory"),
1161 gconf_type_string, NULL, offsetof(struct spool, dest_url), 1161 grecs_type_string, NULL, offsetof(struct spool, dest_url),
1162 cb_url }, 1162 cb_url },
1163 { "file-sweep-time", N_("interval"), N_("Define file sweep time"), 1163 { "file-sweep-time", N_("interval"), N_("Define file sweep time"),
1164 gconf_type_string, NULL, offsetof(struct spool, file_sweep_time), 1164 grecs_type_string, NULL, offsetof(struct spool, file_sweep_time),
1165 cb_interval }, 1165 cb_interval },
1166 { "access-method", N_("ident"), N_("Define access method"), 1166 { "access-method", N_("ident"), N_("Define access method"),
1167 gconf_type_section, NULL, offsetof(struct spool, access_method), 1167 grecs_type_section, NULL, offsetof(struct spool, access_method),
1168 cb_access_method, NULL, access_method_kw }, 1168 cb_access_method, NULL, access_method_kw },
1169 { "archive", N_("type: string"), N_("Set up archivation"), 1169 { "archive", N_("type: string"), N_("Set up archivation"),
1170 gconf_type_section, NULL, offsetof(struct spool, archive), 1170 grecs_type_section, NULL, offsetof(struct spool, archive),
1171 cb_archive, NULL, archive_kw }, 1171 cb_archive, NULL, archive_kw },
1172 { "archive-signatures", NULL, N_("Control implicit signature archivation"), 1172 { "archive-signatures", NULL, N_("Control implicit signature archivation"),
1173 gconf_type_bool, &archive_signatures }, 1173 grecs_type_bool, &archive_signatures },
1174 { "notify-event", NULL, N_("Configure notification"), 1174 { "notify-event", NULL, N_("Configure notification"),
1175 gconf_type_section, NULL, offsetof(struct spool, notification), 1175 grecs_type_section, NULL, offsetof(struct spool, notification),
1176 cb_notify_event, NULL, notify_event_kw }, 1176 cb_notify_event, NULL, notify_event_kw },
1177 1177
1178 { NULL } 1178 { NULL }
1179}; 1179};
1180 1180
1181static int 1181static int
1182cb_spool (enum gconf_callback_command cmd, 1182cb_spool (enum grecs_callback_command cmd,
1183 gconf_locus_t *locus, 1183 grecs_locus_t *locus,
1184 void *varptr, 1184 void *varptr,
1185 gconf_value_t *value, 1185 grecs_value_t *value,
1186 void *cb_data) 1186 void *cb_data)
1187{ 1187{
1188 struct spool *spool; 1188 struct spool *spool;
@@ -1191,10 +1191,10 @@ cb_spool (enum gconf_callback_command cmd,
1191 1191
1192 switch (cmd) 1192 switch (cmd)
1193 { 1193 {
1194 case gconf_callback_section_begin: 1194 case grecs_callback_section_begin:
1195 if (!value || value->type != GCONF_TYPE_STRING) 1195 if (!value || value->type != GCONF_TYPE_STRING)
1196 { 1196 {
1197 gconf_error (locus, 0, _("tag must be a string")); 1197 grecs_error (locus, 0, _("tag must be a string"));
1198 return 1; 1198 return 1;
1199 } 1199 }
1200 spool = xzalloc (sizeof (*spool)); 1200 spool = xzalloc (sizeof (*spool));
@@ -1206,32 +1206,32 @@ cb_spool (enum gconf_callback_command cmd,
1206 *pdata = spool; 1206 *pdata = spool;
1207 break; 1207 break;
1208 1208
1209 case gconf_callback_section_end: 1209 case grecs_callback_section_end:
1210 rc = 0; 1210 rc = 0;
1211 spool = *pdata; 1211 spool = *pdata;
1212 if (!spool->source_dir) 1212 if (!spool->source_dir)
1213 { 1213 {
1214 gconf_error (locus, 0, _("source is not given")); 1214 grecs_error (locus, 0, _("source is not given"));
1215 rc = 1; 1215 rc = 1;
1216 } 1216 }
1217 else if (test_dir (spool->source_dir, &ec)) 1217 else if (test_dir (spool->source_dir, &ec))
1218 { 1218 {
1219 if (ec) 1219 if (ec)
1220 gconf_error (locus, ec, _("cannot access %s"), spool->source_dir); 1220 grecs_error (locus, ec, _("cannot access %s"), spool->source_dir);
1221 else 1221 else
1222 gconf_error (locus, 0, _("%s is not a directory"), 1222 grecs_error (locus, 0, _("%s is not a directory"),
1223 spool->source_dir); 1223 spool->source_dir);
1224 rc = 1; 1224 rc = 1;
1225 } 1225 }
1226 1226
1227 if (!spool->dest_url) 1227 if (!spool->dest_url)
1228 { 1228 {
1229 gconf_error (locus, 0, _("destination is not given")); 1229 grecs_error (locus, 0, _("destination is not given"));
1230 rc = 1; 1230 rc = 1;
1231 } 1231 }
1232 else if (url_to_vtab (spool->dest_url, &spool->vtab)) 1232 else if (url_to_vtab (spool->dest_url, &spool->vtab))
1233 { 1233 {
1234 gconf_error (locus, 0, _("unsupported url: %s"), 1234 grecs_error (locus, 0, _("unsupported url: %s"),
1235 mu_url_to_string (spool->dest_url)); 1235 mu_url_to_string (spool->dest_url));
1236 rc = 1; 1236 rc = 1;
1237 } 1237 }
@@ -1242,7 +1242,7 @@ cb_spool (enum gconf_callback_command cmd,
1242 for (i = 0; i < access_method_count; i++) 1242 for (i = 0; i < access_method_count; i++)
1243 if (spool->access_method[i]->type == method_external) 1243 if (spool->access_method[i]->type == method_external)
1244 { 1244 {
1245 gconf_error (locus, 0, 1245 grecs_error (locus, 0,
1246 _("Sorry, method type `external' is not yet supported")); 1246 _("Sorry, method type `external' is not yet supported"));
1247 rc = 1; 1247 rc = 1;
1248 } 1248 }
@@ -1258,18 +1258,18 @@ cb_spool (enum gconf_callback_command cmd,
1258 *pdata = NULL; 1258 *pdata = NULL;
1259 break; 1259 break;
1260 1260
1261 case gconf_callback_set_value: 1261 case grecs_callback_set_value:
1262 gconf_error (locus, 0, _("invalid use of block statement")); 1262 grecs_error (locus, 0, _("invalid use of block statement"));
1263 } 1263 }
1264 return 0; 1264 return 0;
1265} 1265}
1266 1266
1267 1267
1268static int 1268static int
1269cb_user (enum gconf_callback_command cmd, 1269cb_user (enum grecs_callback_command cmd,
1270 gconf_locus_t *locus, 1270 grecs_locus_t *locus,
1271 void *varptr, 1271 void *varptr,
1272 gconf_value_t *value, 1272 grecs_value_t *value,
1273 void *cb_data) 1273 void *cb_data)
1274{ 1274{
1275 int rc; 1275 int rc;
@@ -1281,7 +1281,7 @@ cb_user (enum gconf_callback_command cmd,
1281 pw = getpwnam (value->v.string); 1281 pw = getpwnam (value->v.string);
1282 if (!pw) 1282 if (!pw)
1283 { 1283 {
1284 gconf_error (locus, 0, _("no such user: %s"), value->v.string); 1284 grecs_error (locus, 0, _("no such user: %s"), value->v.string);
1285 return 1; 1285 return 1;
1286 } 1286 }
1287 1287
@@ -1291,20 +1291,20 @@ cb_user (enum gconf_callback_command cmd,
1291} 1291}
1292 1292
1293static int 1293static int
1294cb_supp_groups (enum gconf_callback_command cmd, 1294cb_supp_groups (enum grecs_callback_command cmd,
1295 gconf_locus_t *locus, 1295 grecs_locus_t *locus,
1296 void *varptr, 1296 void *varptr,
1297 gconf_value_t *value, 1297 grecs_value_t *value,
1298 void *cb_data) 1298 void *cb_data)
1299{ 1299{
1300 if (cmd != gconf_callback_set_value) 1300 if (cmd != grecs_callback_set_value)
1301 { 1301 {
1302 gconf_error (locus, 0, _("Unexpected block statement")); 1302 grecs_error (locus, 0, _("Unexpected block statement"));
1303 return 1; 1303 return 1;
1304 } 1304 }
1305 if (!value || value->type != GCONF_TYPE_LIST) 1305 if (!value || value->type != GCONF_TYPE_LIST)
1306 { 1306 {
1307 gconf_error (locus, 0, _("expected list value")); 1307 grecs_error (locus, 0, _("expected list value"));
1308 return 1; 1308 return 1;
1309 } 1309 }
1310 1310
@@ -1322,7 +1322,7 @@ cb_supp_groups (enum gconf_callback_command cmd,
1322 itr = gl_list_iterator (value->v.list); 1322 itr = gl_list_iterator (value->v.list);
1323 for (i = 0; gl_list_iterator_next (&itr, &p, NULL); i++) 1323 for (i = 0; gl_list_iterator_next (&itr, &p, NULL); i++)
1324 { 1324 {
1325 const gconf_value_t *vp = p; 1325 const grecs_value_t *vp = p;
1326 struct group *grp; 1326 struct group *grp;
1327 1327
1328 if (assert_string_arg (locus, cmd, vp)) 1328 if (assert_string_arg (locus, cmd, vp))
@@ -1330,7 +1330,7 @@ cb_supp_groups (enum gconf_callback_command cmd,
1330 grp = getgrnam (vp->v.string); 1330 grp = getgrnam (vp->v.string);
1331 if (!grp) 1331 if (!grp)
1332 { 1332 {
1333 gconf_error (locus, 0, _("no such group: %s"), value->v.string); 1333 grecs_error (locus, 0, _("no such group: %s"), value->v.string);
1334 break; 1334 break;
1335 } 1335 }
1336 wydawca_supp_groups[i] = grp->gr_gid; 1336 wydawca_supp_groups[i] = grp->gr_gid;
@@ -1341,121 +1341,121 @@ cb_supp_groups (enum gconf_callback_command cmd,
1341} 1341}
1342 1342
1343 1343
1344static struct gconf_keyword locking_kw[] = { 1344static struct grecs_keyword locking_kw[] = {
1345 { "enable", NULL, N_("Enable or disable locking"), 1345 { "enable", NULL, N_("Enable or disable locking"),
1346 gconf_type_bool, &enable_locking }, 1346 grecs_type_bool, &enable_locking },
1347 { "directory", N_("dir"), N_("Set directory for lock files"), 1347 { "directory", N_("dir"), N_("Set directory for lock files"),
1348 gconf_type_string, &lockdir }, 1348 grecs_type_string, &lockdir },
1349 { "expire-time", N_("interval"), N_("Define lock expiration interval"), 1349 { "expire-time", N_("interval"), N_("Define lock expiration interval"),
1350 gconf_type_string, &lock_expire_time, 0, cb_interval }, 1350 grecs_type_string, &lock_expire_time, 0, cb_interval },
1351 { "retry-attempts", N_("n"), N_("Number of times to retry locking"), 1351 { "retry-attempts", N_("n"), N_("Number of times to retry locking"),
1352 gconf_type_uint, &lock_retry_attempts }, 1352 grecs_type_uint, &lock_retry_attempts },
1353 { "retry-interval", N_("interval"), N_("Delay between locking attempts"), 1353 { "retry-interval", N_("interval"), N_("Delay between locking attempts"),
1354 gconf_type_string, &lock_retry_interval, 0, cb_interval }, 1354 grecs_type_string, &lock_retry_interval, 0, cb_interval },
1355 { NULL } 1355 { NULL }
1356}; 1356};
1357 1357
1358static int 1358static int
1359cb_locking (enum gconf_callback_command cmd, 1359cb_locking (enum grecs_callback_command cmd,
1360 gconf_locus_t *locus, 1360 grecs_locus_t *locus,
1361 void *varptr, 1361 void *varptr,
1362 gconf_value_t *value, 1362 grecs_value_t *value,
1363 void *cb_data) 1363 void *cb_data)
1364{ 1364{
1365 if (cmd == gconf_callback_set_value) 1365 if (cmd == grecs_callback_set_value)
1366 { 1366 {
1367 if (!value || value->type != GCONF_TYPE_STRING) 1367 if (!value || value->type != GCONF_TYPE_STRING)
1368 { 1368 {
1369 gconf_error (locus, 0, _("expected scalar value as a tag")); 1369 grecs_error (locus, 0, _("expected scalar value as a tag"));
1370 return 1; 1370 return 1;
1371 } 1371 }
1372 gconf_string_convert (&enable_locking, gconf_type_bool, value->v.string); 1372 grecs_string_convert (&enable_locking, grecs_type_bool, value->v.string);
1373 } 1373 }
1374 return 0; 1374 return 0;
1375} 1375}
1376 1376
1377 1377
1378 1378
1379static struct gconf_keyword wydawca_kw[] = { 1379static struct grecs_keyword wydawca_kw[] = {
1380 { "daemon", NULL, N_("Enable daemon mode"), 1380 { "daemon", NULL, N_("Enable daemon mode"),
1381 gconf_type_bool, &daemon_mode }, 1381 grecs_type_bool, &daemon_mode },
1382 { "foreground", NULL, N_("Start in foreground even in daemon mode"), 1382 { "foreground", NULL, N_("Start in foreground even in daemon mode"),
1383 gconf_type_bool, &foreground }, 1383 grecs_type_bool, &foreground },
1384 { "single-process", NULL, N_("Do not spawn subprocesses"), 1384 { "single-process", NULL, N_("Do not spawn subprocesses"),
1385 gconf_type_bool, &single_process }, 1385 grecs_type_bool, &single_process },
1386 { "wakeup-interval", N_("time"), N_("Set wake-up interval"), 1386 { "wakeup-interval", N_("time"), N_("Set wake-up interval"),
1387 gconf_type_string, &wakeup_interval, 0, cb_interval }, 1387 grecs_type_string, &wakeup_interval, 0, cb_interval },
1388 { "pidfile", N_("file"), N_("Set pid file name"), 1388 { "pidfile", N_("file"), N_("Set pid file name"),
1389 gconf_type_string, &pidfile }, 1389 grecs_type_string, &pidfile },
1390 1390
1391 { "user", N_("name"), N_("Run with UID and GID of this user"), 1391 { "user", N_("name"), N_("Run with UID and GID of this user"),
1392 gconf_type_string, NULL, 0, cb_user }, 1392 grecs_type_string, NULL, 0, cb_user },
1393 { "group", NULL, N_("Retain these supplementary groups"), 1393 { "group", NULL, N_("Retain these supplementary groups"),
1394 gconf_type_string|GCONF_LIST, NULL, 0, cb_supp_groups }, 1394 grecs_type_string|GCONF_LIST, NULL, 0, cb_supp_groups },
1395 1395
1396 { "locking", NULL, N_("Configure locking"), 1396 { "locking", NULL, N_("Configure locking"),
1397 gconf_type_section, NULL, 0, 1397 grecs_type_section, NULL, 0,
1398 cb_locking, NULL, locking_kw }, 1398 cb_locking, NULL, locking_kw },
1399 1399
1400 { "listen", N_("socket"), N_("Listen on this address"), 1400 { "listen", N_("socket"), N_("Listen on this address"),
1401 gconf_type_sockaddr, &listen_sockaddr, }, 1401 grecs_type_sockaddr, &listen_sockaddr, },
1402 1402
1403#ifdef WITH_LIBWRAP 1403#ifdef WITH_LIBWRAP
1404 { "tcp-wrapper", NULL, N_("Configure TCP wrappers"), 1404 { "tcp-wrapper", NULL, N_("Configure TCP wrappers"),
1405 gconf_type_section, NULL, 0, 1405 grecs_type_section, NULL, 0,
1406 NULL, NULL, tcpwrapper_kw }, 1406 NULL, NULL, tcpwrapper_kw },
1407#endif 1407#endif
1408 1408
1409 { "mailer", N_("url"), N_("Set mailer URL"), 1409 { "mailer", N_("url"), N_("Set mailer URL"),
1410 gconf_type_string, &mailer, 0, cb_mailer }, 1410 grecs_type_string, &mailer, 0, cb_mailer },
1411 { "admin-address", N_("email"), N_("Set admin email address"), 1411 { "admin-address", N_("email"), N_("Set admin email address"),
1412 gconf_type_string, &admin_address, 0, cb_email_address }, 1412 grecs_type_string, &admin_address, 0, cb_email_address },
1413 { "from-address", N_("email"), N_("Set sender email address"), 1413 { "from-address", N_("email"), N_("Set sender email address"),
1414 gconf_type_string, &from_address, 0, cb_email_address }, 1414 grecs_type_string, &from_address, 0, cb_email_address },
1415 1415
1416 /* FIXME: Must be a built-in type? */ 1416 /* FIXME: Must be a built-in type? */
1417 { "file-sweep-time", N_("interval"), N_("Define file sweep time"), 1417 { "file-sweep-time", N_("interval"), N_("Define file sweep time"),
1418 gconf_type_string, &file_sweep_time, 0, cb_interval }, 1418 grecs_type_string, &file_sweep_time, 0, cb_interval },
1419 { "tar-program", N_("prog"), N_("Set tar invocation command line"), 1419 { "tar-program", N_("prog"), N_("Set tar invocation command line"),
1420 gconf_type_string, &tar_command_name, 0, cb_absolute_name }, 1420 grecs_type_string, &tar_command_name, 0, cb_absolute_name },
1421 1421
1422 { "umask", N_("mask: octal"), N_("Set umask"), 1422 { "umask", N_("mask: octal"), N_("Set umask"),
1423 gconf_type_string, NULL, 0, cb_set_umask }, 1423 grecs_type_string, NULL, 0, cb_set_umask },
1424 1424
1425 { "statistics", N_("items"), N_("Print these stats at the end of run"), 1425 { "statistics", N_("items"), N_("Print these stats at the end of run"),
1426 gconf_type_string, &print_stats, 0, cb_statistics }, 1426 grecs_type_string, &print_stats, 0, cb_statistics },
1427 1427
1428 { "sql", N_("id: string"), N_("Define SQL database"), 1428 { "sql", N_("id: string"), N_("Define SQL database"),
1429 gconf_type_section, NULL, 0, cb_sql, NULL, sql_kw }, 1429 grecs_type_section, NULL, 0, cb_sql, NULL, sql_kw },
1430 1430
1431 { "syslog", NULL, N_("Configure syslog logging"), 1431 { "syslog", NULL, N_("Configure syslog logging"),
1432 gconf_type_section, NULL, 0, NULL, NULL, syslog_kw }, 1432 grecs_type_section, NULL, 0, NULL, NULL, syslog_kw },
1433 1433
1434 { "define-message", N_("ident: string> <text: string"), 1434 { "define-message", N_("ident: string> <text: string"),
1435 N_("Define message text"), 1435 N_("Define message text"),
1436 gconf_type_string, NULL, 0, cb_define_message }, 1436 grecs_type_string, NULL, 0, cb_define_message },
1437 1437
1438 { "archive", N_("type: string"), N_("Set up archivation"), 1438 { "archive", N_("type: string"), N_("Set up archivation"),
1439 gconf_type_section, &default_archive_descr, 0, 1439 grecs_type_section, &default_archive_descr, 0,
1440 cb_archive, NULL, archive_kw }, 1440 cb_archive, NULL, archive_kw },
1441 1441
1442 { "mail-statistics", NULL, N_("Send statistics"), 1442 { "mail-statistics", NULL, N_("Send statistics"),
1443 gconf_type_section, NULL, 0, NULL, NULL, mail_statistics_kw }, 1443 grecs_type_section, NULL, 0, NULL, NULL, mail_statistics_kw },
1444 1444
1445 { "notify-event", NULL, N_("Configure notification"), 1445 { "notify-event", NULL, N_("Configure notification"),
1446 gconf_type_section, &default_notification, 0, 1446 grecs_type_section, &default_notification, 0,
1447 cb_notify_event, NULL, notify_event_kw }, 1447 cb_notify_event, NULL, notify_event_kw },
1448 1448
1449 { "access-method", N_("ident"), N_("Define access method"), 1449 { "access-method", N_("ident"), N_("Define access method"),
1450 gconf_type_section, default_access_method, 0, 1450 grecs_type_section, default_access_method, 0,
1451 cb_access_method, NULL, access_method_kw }, 1451 cb_access_method, NULL, access_method_kw },
1452 1452
1453 { "spool", N_("tag: string"), N_("Define distribution spool"), 1453 { "spool", N_("tag: string"), N_("Define distribution spool"),
1454 gconf_type_section, NULL, 0, 1454 grecs_type_section, NULL, 0,
1455 cb_spool, NULL, spool_kw }, 1455 cb_spool, NULL, spool_kw },
1456 1456
1457 { "all-spools", NULL, N_("Service names that request scanning all spools"), 1457 { "all-spools", NULL, N_("Service names that request scanning all spools"),
1458 gconf_type_string|GCONF_LIST, &all_spool_aliases }, 1458 grecs_type_string|GCONF_LIST, &all_spool_aliases },
1459 1459
1460 { NULL } 1460 { NULL }
1461}; 1461};
@@ -1466,8 +1466,8 @@ config_help ()
1466 static char docstring[] = 1466 static char docstring[] =
1467 N_("Configuration file structure for wydawca.\n" 1467 N_("Configuration file structure for wydawca.\n"
1468 "For more information, use `info wydawca configuration'."); 1468 "For more information, use `info wydawca configuration'.");
1469 gconf_format_docstring (stdout, docstring, 0); 1469 grecs_format_docstring (stdout, docstring, 0);
1470 gconf_format_statement_array (stdout, wydawca_kw, 1, 0); 1470 grecs_format_statement_array (stdout, wydawca_kw, 1, 0);
1471} 1471}
1472 1472
1473void 1473void
@@ -1476,15 +1476,15 @@ config_init()
1476 int i; 1476 int i;
1477 struct servent *serv; 1477 struct servent *serv;
1478 1478
1479 gconf_set_keywords (wydawca_kw); 1479 grecs_set_keywords (wydawca_kw);
1480 gconf_include_path_setup (DEFAULT_VERSION_INCLUDE_DIR, 1480 grecs_include_path_setup (DEFAULT_VERSION_INCLUDE_DIR,
1481 DEFAULT_INCLUDE_DIR, NULL); 1481 DEFAULT_INCLUDE_DIR, NULL);
1482 gconf_preprocessor = DEFAULT_PREPROCESSOR; 1482 grecs_preprocessor = DEFAULT_PREPROCESSOR;
1483 gconf_log_to_stderr = true; 1483 grecs_log_to_stderr = true;
1484 1484
1485 serv = getservbyname (PACKAGE, "tcp"); 1485 serv = getservbyname (PACKAGE, "tcp");
1486 if (serv != NULL) 1486 if (serv != NULL)
1487 gconf_default_port = serv->s_port; 1487 grecs_default_port = serv->s_port;
1488 1488
1489 for (i = 0; i < access_method_count; i++) 1489 for (i = 0; i < access_method_count; i++)
1490 default_access_method[i] = method_new (i, method_builtin); 1490 default_access_method[i] = method_new (i, method_builtin);

Return to:

Send suggestions and report system problems to the System administrator.