8 /* stuff from util.c */
13 extern BOOLEAN nonstandardFlag;
14 extern BOOLEAN hashIds;
17 extern BOOLEAN ignoreSCC;
19 extern unsigned hash_table_size;
21 void process_args PROTO((int, char **));
23 /* end of util.c stuff */
25 list mklcons PROTO((void *h, list t)); /* if we have PROTO, we have "void *" */
26 list lapp PROTO((list l1, void *l2));
27 list lconc PROTO((list l1, list l2));
29 #define lsing(l) mklcons(l, Lnil) /* Singleton Lists */
30 #define ldub(l1, l2) mklcons(l1, lsing(l2)) /* Two-element Lists */
32 #define FN fns[icontexts]
33 #define SAMEFN samefn[icontexts]
34 #define PREVPATT prevpatt[icontexts]
36 id installid PROTO((char *)); /* Create a new identifier */
37 hstring installHstring PROTO((int, char *)); /* Create a new literal string */
39 id install_literal PROTO((char *));
40 char *id_to_string PROTO((id));
42 id qid_to_id PROTO((qid));
43 char *qid_to_string PROTO((qid));
44 char *qid_to_mod PROTO((qid)); /* NULL if unqual */
45 char *qid_to_pmod PROTO((qid)); /* "?" if unqual */
46 qid creategid PROTO((long));
48 /* partain additions */
50 char *xmalloc PROTO((unsigned)); /* just a GNU-style error-checking malloc */
51 int printf PROTO((const char *, ...));
52 int fprintf PROTO((FILE *, const char *, ...));
53 /*varies (sun/alpha): int fputc PROTO((char, FILE *)); */
54 int fputs PROTO((const char *, FILE *));
55 int sscanf PROTO((const char *, const char *, ...));
56 long strtol PROTO((const char *, char **, int));
57 size_t fread PROTO((void *, size_t, size_t, FILE *));
58 int fclose PROTO((FILE *));
59 int isatty PROTO((int));
60 /*extern ??? _filbuf */
61 /*extern ??? _flsbuf */
63 void pprogram PROTO((tree));
65 void format_string PROTO((FILE *, unsigned char *, int));
66 list type2context PROTO((ttype));
67 void is_context_format PROTO((ttype, int));
68 pbinding createpat PROTO((pbinding, binding));
69 void process_args PROTO((int, char **));
70 void hash_init PROTO((void));
71 void print_hash_table PROTO((void));
72 long int hash_index PROTO((id));
73 void yyinit PROTO((void));
74 int yyparse PROTO((void));
75 int yylex PROTO((void));
76 void setyyin PROTO((char *));
77 void yyerror PROTO((char *));
78 void error PROTO((char *));
79 void hsperror PROTO((char *));
81 void makeinfix PROTO((id, int, int, id, long, long, id, id, long, long, long, list));
82 struct infix *infixlookup PROTO((qid));
83 int pprecedence PROTO((struct infix *));
84 int pfixity PROTO((struct infix *));
85 char * infixstr PROTO((int));
86 long infixint PROTO((int));
88 void hsincindent PROTO((void));
89 void hssetindent PROTO((void));
90 void hsendindent PROTO((void));
91 void hsindentoff PROTO((void));
93 int checkfixity PROTO((char *));
94 void checksamefn PROTO((qid));
95 void checkinpat PROTO((void));
97 void expORpat PROTO((int,tree));
98 /* the "int" arg says what we want; it is one of: */
102 BOOLEAN lhs_is_patt PROTO((tree));
103 tree function PROTO((tree));
104 void extendfn PROTO((binding, binding));
105 void checkorder PROTO((binding));
107 void checkdostmts PROTO((list));
108 void checknobangs PROTO((ttype));
109 void splittyconapp PROTO((ttype, qid *, list *));
112 void precparse PROTO((tree));
113 void checkprec PROTO((tree, qid, BOOLEAN));
116 BOOLEAN isconstr PROTO((char *));
117 void setstartlineno PROTO((void));
119 /* mattson additions */
120 char *xstrdup PROTO((char *)); /* Duplicate a string */
121 char *xstrndup PROTO((char *, unsigned)); /* Duplicate a substring */
122 char *xrealloc PROTO((char *, unsigned)); /* Re-allocate a string */
124 #endif /* __UTILS_H */