# include <config.h>
#endif
-#include "type_identify.h"
+#include "type_identify_t.h"
#include <stdlib.h>
#include <stddef.h>
/* The hash set for types. */
static pset *type_table = NULL;
+/* hash and compare types */
+static hash_types_func_t *hash_types_func;
+static compare_types_func_t *compare_types_func;
int compare_names (const void *tp1, const void *tp2) {
type *t1 = (type *) tp1;
return t1 != t2;
}
-compare_types_func_tp compare_types_func = compare_strict;
-
/* stuff to compute a hash value for a type. */
int hash_name (type *tp) {
unsigned h = (unsigned)tp->type_op;
return h;
}
-hash_types_func_tp hash_types_func = hash_name;
-
-
/* The function that hashes a type. */
type *mature_type(type *tp) {
type *o;
return o;
}
-void init_type_identify(void) {
+/* initialize this module */
+void init_type_identify(type_identify_if_t *ti_if) {
+ compare_types_func = ti_if && ti_if->cmp ? ti_if->cmp : compare_strict;
+ hash_types_func = ti_if && ti_if->hash ? ti_if->hash : hash_name;
+
type_table = new_pset (compare_types_func, 8);
}