- if (0 == strcmp (at_directive_name, "@basename"))
- {
- if (at_directive_argc > 1)
- fail_for_at_directive_too_many_args ();
- fputs (last_component (at_directive_argv[0]), yyout);
- }
- else if (0 == strcmp (at_directive_name, "@warn")
- || 0 == strcmp (at_directive_name, "@complain")
- || 0 == strcmp (at_directive_name, "@fatal"))
- {
- void (*func)(char const *, ...);
- switch (at_directive_name[1])
- {
- case 'w': func = warn; break;
- case 'c': func = complain; break;
- case 'f': func = fatal; break;
- default: aver (false); func = NULL; break;
- }
- switch (at_directive_argc)
- {
- case 1:
- func (at_directive_argv[0]);
- break;
- case 2:
- func (at_directive_argv[0], at_directive_argv[1]);
- break;
- case 3:
- func (at_directive_argv[0], at_directive_argv[1],
- at_directive_argv[2]);
- break;
- case 4:
- func (at_directive_argv[0], at_directive_argv[1],
- at_directive_argv[2], at_directive_argv[3]);
- break;
- case 5:
- func (at_directive_argv[0], at_directive_argv[1],
- at_directive_argv[2], at_directive_argv[3],
- at_directive_argv[4]);
- break;
- default:
- fail_for_at_directive_too_many_args ();
- break;
- }
- }
- else if (0 == strcmp (at_directive_name, "@warn_at")
- || 0 == strcmp (at_directive_name, "@complain_at")
- || 0 == strcmp (at_directive_name, "@fatal_at"))
+ /* compare with values issued from b4_error */
+ if (STREQ (arg, "complain"))
+ return complaint;
+ else if (STREQ (arg, "deprecated"))
+ return Wdeprecated;
+ else if (STREQ (arg, "fatal"))
+ return fatal;
+ else if (STREQ (arg, "note"))
+ return silent | complaint | no_caret;
+ else if (STREQ (arg, "warn"))
+ return Wother;
+ else
+ abort ();
+}
+
+static void
+at_basename (int argc, char *argv[], char **out_namep, int *out_linenop)
+{
+ (void) out_namep;
+ (void) out_linenop;
+ if (2 < argc)
+ fail_for_at_directive_too_many_args (argv[0]);
+ fputs (last_component (argv[1]), yyout);
+}
+
+static void
+at_complain (int argc, char *argv[], char **out_namep, int *out_linenop)
+{
+ static unsigned indent;
+ warnings w = flag (argv[1]);
+ location loc;
+ location *locp = NULL;
+
+ (void) out_namep;
+ (void) out_linenop;
+
+ if (argc < 4)
+ fail_for_at_directive_too_few_args (argv[0]);
+ if (argv[2] && argv[2][0])