- if (0 == strcmp (at_directive_argv[0], "@basename"))
- {
- if (at_directive_argc > 2)
- fail_for_at_directive_too_many_args (at_directive_argv[0]);
- fputs (last_component (at_directive_argv[1]), yyout);
- }
- else if (0 == strcmp (at_directive_argv[0], "@warn")
- || 0 == strcmp (at_directive_argv[0], "@complain")
- || 0 == strcmp (at_directive_argv[0], "@fatal"))
- {
- void (*func)(char const *, ...);
- switch (at_directive_argv[0][1])
- {
- case 'w': func = warn; break;
- case 'c': func = complain; break;
- case 'f': func = fatal; break;
- default: aver (false); break;
- }
- switch (at_directive_argc)
- {
- case 2:
- func (_(at_directive_argv[1]));
- break;
- case 3:
- func (_(at_directive_argv[1]), at_directive_argv[2]);
- break;
- case 4:
- func (_(at_directive_argv[1]), at_directive_argv[2],
- at_directive_argv[3]);
- break;
- case 5:
- func (_(at_directive_argv[1]), at_directive_argv[2],
- at_directive_argv[3], at_directive_argv[4]);
- break;
- case 6:
- func (_(at_directive_argv[1]), at_directive_argv[2],
- at_directive_argv[3], at_directive_argv[4],
- at_directive_argv[5]);
- break;
- default:
- fail_for_at_directive_too_many_args (at_directive_argv[0]);
- break;
- }
- }
- else if (0 == strcmp (at_directive_argv[0], "@warn_at")
- || 0 == strcmp (at_directive_argv[0], "@complain_at")
- || 0 == strcmp (at_directive_argv[0], "@fatal_at"))
+ /* compare with values issued from b4_error */
+ if (STREQ (arg, "complain"))
+ return complaint;
+ else if (STREQ (arg, "fatal"))
+ return fatal;
+ else if (STREQ (arg, "note"))
+ return silent;
+ else if (STREQ (arg, "warn"))
+ return Wother;
+ else
+ aver (false);
+}
+
+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])