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