#include <stdbool.h>
#define INUNKNOWN 0
#define INCPP 1
#define INCC 2
#define INAS 3
#define INLD 4
#define INLINT 5
#define INF77 6
#define INPI 7
#define INPC 8
#define INFRANZ 9
#define INLISP 10
#define INVAXIMA 11
#define INRATFOR 12
#define INLEX 13
#define INYACC 14
#define INAPL 15
#define INMAKE 16
#define INRI 17
#define INTROFF 18
#define INMOD2 19
typedef int Errorclass;
#define C_FIRST 0
#define C_UNKNOWN 0
#define C_IGNORE 1
#define C_SYNC 2
#define C_DISCARD 3
#define C_NONSPEC 4
#define C_THISFILE 5
#define C_NULLED 6
#define C_TRUE 7
#define C_DUPL 8
#define C_LAST 9
#define SORTABLE(x) (!(NOTSORTABLE(x)))
#define NOTSORTABLE(x) (x <= C_NONSPEC)
extern const char *class_table[];
extern int class_count[];
extern size_t filelevel;
#define nunknown class_count[C_UNKNOWN]
#define nignore class_count[C_IGNORE]
#define nsyncerrors class_count[C_SYNC]
#define ndiscard class_count[C_DISCARD]
#define nnonspec class_count[C_NONSPEC]
#define nthisfile class_count[C_THISFILE]
#define nnulled class_count[C_NULLED]
#define ntrue class_count[C_TRUE]
#define ndupl class_count[C_DUPL]
#define TOTHEFILE 1
#define TOSTDOUT 2
extern FILE *errorfile;
extern FILE *queryfile;
extern char *scriptname;
extern const char *suffixlist;
extern bool query;
extern bool terse;
int inquire(const char *, ...) __printflike(1, 2);
#define Q_error -1
#define Q_NO 1
#define Q_no 2
#define Q_YES 3
#define Q_yes 4
struct lang_desc {
const char *lang_name;
const char *lang_incomment;
const char *lang_outcomment;
};
extern struct lang_desc lang_table[];
#define CINCOMMENT "/*###"
#define COUTCOMMENT "%%%*/\n"
#define FINCOMMENT "C###"
#define FOUTCOMMENT "%%%\n"
#define NEWLINE "%%%\n"
#define PIINCOMMENT "(*###"
#define PIOUTCOMMENT "%%%*)\n"
#define LISPINCOMMENT ";###"
#define ASINCOMMENT "####"
#define RIINCOMMENT CINCOMMENT
#define RIOUTCOMMENT COUTCOMMENT
#define TROFFINCOMMENT ".\\\"###"
#define TROFFOUTCOMMENT NEWLINE
#define MOD2INCOMMENT "(*###"
#define MOD2OUTCOMMENT "%%%*)\n"
#define ERRORNAME "/.errorrc"
extern int nignored;
extern char **names_ignored;
typedef struct edesc Edesc;
typedef Edesc *Eptr;
struct edesc {
Eptr error_next;
int error_lgtext;
char **error_text;
Errorclass error_e_class;
Errorclass error_s_class;
int error_language;
int error_position;
int error_line;
int error_no;
};
extern int nerrors;
extern Eptr er_head;
extern int cur_wordc;
extern char **cur_wordv;
extern int nfiles;
extern Eptr **files;
extern bool *touchedfiles;
extern int language;
extern char *currentfilename;
extern char default_currentfilename[];
#define DECL_STR(sym, num, str) static char sym##_##num[] = str
#define DECL_S1(sym, s, ...) __VA_ARGS__ DECL_STR(sym, 0, s)
#define DECL_S2(sym, s, ...) DECL_STR(sym, 1, s); DECL_S1(sym, __VA_ARGS__)
#define DECL_S3(sym, s, ...) DECL_STR(sym, 2, s); DECL_S2(sym, __VA_ARGS__)
#define DECL_S4(sym, s, ...) DECL_STR(sym, 3, s); DECL_S3(sym, __VA_ARGS__)
#define DECL_S5(sym, s, ...) DECL_STR(sym, 4, s); DECL_S4(sym, __VA_ARGS__)
#define DECL_S6(sym, s, ...) DECL_STR(sym, 5, s); DECL_S5(sym, __VA_ARGS__)
#define USE_S1(sym) sym##_0
#define USE_S2(sym) sym##_1, USE_S1(sym)
#define USE_S3(sym) sym##_2, USE_S2(sym)
#define USE_S4(sym) sym##_3, USE_S3(sym)
#define USE_S5(sym) sym##_4, USE_S4(sym)
#define USE_S6(sym) sym##_5, USE_S5(sym)
#define DECL_STRS(num, class, sym, ...) \
DECL_S##num(sym, __VA_ARGS__); \
class char *sym[num] = { USE_S##num(sym) }
#define DECL_STRINGS_1(class, sym, ...) DECL_STRS(1, class, sym, __VA_ARGS__)
#define DECL_STRINGS_2(class, sym, ...) DECL_STRS(2, class, sym, __VA_ARGS__)
#define DECL_STRINGS_3(class, sym, ...) DECL_STRS(3, class, sym, __VA_ARGS__)
#define DECL_STRINGS_4(class, sym, ...) DECL_STRS(4, class, sym, __VA_ARGS__)
#define DECL_STRINGS_5(class, sym, ...) DECL_STRS(5, class, sym, __VA_ARGS__)
#define DECL_STRINGS_6(class, sym, ...) DECL_STRS(6, class, sym, __VA_ARGS__)
void arrayify(int *, Eptr **, Eptr);
void *Calloc(size_t, size_t);
void clob_last(char *, char);
Errorclass discardit(Eptr);
void eaterrors(int *, Eptr **);
void erroradd(int, char **, Errorclass, Errorclass);
void filenames(int, Eptr **);
void findfiles(int, Eptr *, int *, Eptr ***);
char firstchar(const char *);
void getignored(const char *);
char lastchar(const char *);
char next_lastchar(const char *);
void onintr(int);
bool persperdexplode(char *, char **, char **);
Errorclass pi(void);
int position(const char *, char);
void printerrors(bool, int, Eptr []);
const char *plural(int);
char *Strdup(const char *);
char *substitute(char *, char, char);
bool touchfiles(int, Eptr **, int *, char ***);
const char *verbform(int);
void wordvbuild(char *, int*, char ***);
bool wordv_eq(char **, int, char **);
void wordvprint(FILE *, int, char **);
char **wordvsplice(int, int, char **);