comparison lwlib/lw_expr.h @ 374:8e25147c2aa8

Clean up various "externs" Apparently some compilers seriously choke on the "extern" keyword in some circumstances where GCC does not. Remove most instances of "extern" to guard against that. Thanks to Erik G <erik@6809.org> for the patch.
author William Astle <lost@l-w.ca>
date Mon, 13 Jul 2015 20:31:56 -0600
parents 433dbc18fb41
children 67373a053c49
comparison
equal deleted inserted replaced
373:00fced888c5d 374:8e25147c2aa8
80 80
81 #else /* def ___lw_expr_c_seen___ */ 81 #else /* def ___lw_expr_c_seen___ */
82 82
83 typedef void * lw_expr_t; 83 typedef void * lw_expr_t;
84 84
85 extern lw_expr_t lwexpr_create(void); 85 lw_expr_t lwexpr_create(void);
86 extern void lw_expr_destroy(lw_expr_t E); 86 void lw_expr_destroy(lw_expr_t E);
87 extern lw_expr_t lw_expr_copy(lw_expr_t E); 87 lw_expr_t lw_expr_copy(lw_expr_t E);
88 extern void lw_expr_add_operand(lw_expr_t E, lw_expr_t O); 88 void lw_expr_add_operand(lw_expr_t E, lw_expr_t O);
89 extern lw_expr_t lw_expr_build(int exprtype, ...); 89 lw_expr_t lw_expr_build(int exprtype, ...);
90 extern char *lw_expr_print(lw_expr_t E); 90 char *lw_expr_print(lw_expr_t E);
91 extern int lw_expr_compare(lw_expr_t E1, lw_expr_t E2); 91 int lw_expr_compare(lw_expr_t E1, lw_expr_t E2);
92 extern void lw_expr_simplify(lw_expr_t E, void *priv); 92 void lw_expr_simplify(lw_expr_t E, void *priv);
93 93
94 typedef lw_expr_t lw_expr_fn_t(int t, void *ptr, void *priv); 94 typedef lw_expr_t lw_expr_fn_t(int t, void *ptr, void *priv);
95 typedef lw_expr_t lw_expr_fn2_t(char *var, void *priv); 95 typedef lw_expr_t lw_expr_fn2_t(char *var, void *priv);
96 typedef lw_expr_t lw_expr_fn3_t(char **p, void *priv); 96 typedef lw_expr_t lw_expr_fn3_t(char **p, void *priv);
97 97
98 extern void lw_expr_set_special_handler(lw_expr_fn_t *fn); 98 void lw_expr_set_special_handler(lw_expr_fn_t *fn);
99 extern void lw_expr_set_var_handler(lw_expr_fn2_t *fn); 99 void lw_expr_set_var_handler(lw_expr_fn2_t *fn);
100 extern void lw_expr_set_term_parser(lw_expr_fn3_t *fn); 100 void lw_expr_set_term_parser(lw_expr_fn3_t *fn);
101 101
102 extern lw_expr_t lw_expr_parse(char **p, void *priv); 102 lw_expr_t lw_expr_parse(char **p, void *priv);
103 extern int lw_expr_istype(lw_expr_t e, int t); 103 int lw_expr_istype(lw_expr_t e, int t);
104 extern int lw_expr_intval(lw_expr_t e); 104 int lw_expr_intval(lw_expr_t e);
105 extern int lw_expr_specint(lw_expr_t e); 105 int lw_expr_specint(lw_expr_t e);
106 extern void *lw_expr_specptr(lw_expr_t e); 106 void *lw_expr_specptr(lw_expr_t e);
107 extern int lw_expr_whichop(lw_expr_t e); 107 int lw_expr_whichop(lw_expr_t e);
108 108
109 extern int lw_expr_type(lw_expr_t e); 109 int lw_expr_type(lw_expr_t e);
110 110
111 typedef int lw_expr_testfn_t(lw_expr_t e, void *priv); 111 typedef int lw_expr_testfn_t(lw_expr_t e, void *priv);
112 112
113 extern int lw_expr_operandcount(lw_expr_t e); 113 int lw_expr_operandcount(lw_expr_t e);
114 114
115 extern void lw_expr_setwidth(int w); 115 void lw_expr_setwidth(int w);
116 116
117 // run a function on all terms in an expression; if the function 117 // run a function on all terms in an expression; if the function
118 // returns non-zero for any term, return non-zero, else return 118 // returns non-zero for any term, return non-zero, else return
119 // zero 119 // zero
120 extern int lw_expr_testterms(lw_expr_t e, lw_expr_testfn_t *fn, void *priv); 120 int lw_expr_testterms(lw_expr_t e, lw_expr_testfn_t *fn, void *priv);
121 121
122 extern void lw_expr_setdivzero(void (*fn)(void *priv)); 122 void lw_expr_setdivzero(void (*fn)(void *priv));
123 123
124 #endif /* def ___lw_expr_c_seen___ */ 124 #endif /* def ___lw_expr_c_seen___ */
125 125
126 #endif /* ___lw_expr_h_seen___ */ 126 #endif /* ___lw_expr_h_seen___ */