%{
/*
- * Copyright © 2021 Nick Bowler
+ * Copyright © 2021, 2023-2024 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include <config.h>
#include <stdio.h>
#include <string.h>
-#include <stdint.h>
+#include <inttypes.h>
#include <assert.h>
#include "cdecl99.h"
int w;
w = printf(" %s", stringpool+c->name);
- if (w < 0 || w > 13) {
+ if (w <= 0 || w > 13) {
putchar('\n');
w = 0;
}
}
switch (c->cmd) {
- case cmd_help: return run_cmd_help();
- case cmd_declare: case cmd_type: return run_command_declare(cmd);
- case cmd_simplify: return run_command_simplify(arg);
- case cmd_explain: return run_command_explain(arg);
- case cmd_quit: return 1;
+ case cmd_help:
+ return run_cmd_help();
+ case cmd_declare: case cmd_type:
+ return run_command_cdecl(cmd, INPUT_ENGLISH, OUTPUT_C);
+ case cmd_simplify:
+ return run_command_cdecl(arg, INPUT_C, OUTPUT_C);
+ case cmd_explain:
+ return run_command_cdecl(arg, INPUT_C, OUTPUT_ENGLISH);
+ case cmd_quit:
+ return 1;
}
assert(0);