+// ------------------------------- type_t -------------------------------
+
+char charptr_equals(const void*o1, const void*o2)
+{
+ return !strcmp(o1,o2);
+}
+unsigned int charptr_hash(const void*o)
+{
+ return string_hash2(o);
+}
+void* charptr_dup(const void*o)
+{
+ return strdup(o);
+}
+void charptr_free(void*o)
+{
+ rfx_free(o);
+}
+char stringstruct_equals(const void*o1, const void*o2)
+{
+ string_t*s1 = (string_t*)o1;
+ string_t*s2 = (string_t*)o2;
+ int l = s1->len<s2->len?s1->len:s2->len;
+ int r = memcmp(s1->str, s2->str, l);
+ if(r)
+ return 0;
+ else
+ return s1->len==s2->len;
+}
+unsigned int stringstruct_hash(const void*o)
+{
+ return string_hash(o);
+}
+void*stringstruct_dup(const void*o)
+{
+ string_t*s = malloc(sizeof(string_t));
+ string_set2(s, ((string_t*)o)->str, ((string_t*)o)->len);
+ return s;
+}
+void stringstruct_free(void*o)
+{
+ rfx_free((void*)(((string_t*)o)->str));
+ rfx_free((void*)o);
+}
+
+
+type_t charptr_type = {
+ equals: charptr_equals,
+ hash: charptr_hash,
+ dup: charptr_dup,
+ free: charptr_free,
+};
+
+type_t stringstruct_type = {
+ equals: stringstruct_equals,
+ hash: stringstruct_hash,
+ dup: stringstruct_dup,
+ free: stringstruct_free,
+};