// SDB-CGEN V2.6.2
#include <ctype.h>
#include <stdio.h>
#include <string.h>

struct kv { const char *name; const char *value; };
static const struct kv kvs[] = {
// gcc -DMAIN=1 types_index.c ; ./a.out > types_index.h
	{"depends.types-gio", "types-gobject"},
	{"depends.types-gobject", "types-glib"},
	{"library.gio-2.0*", "types-gio"},
	{"library.glib-2.0*", "types-glib"},
	{"library.gobject-2.0*", "types-gobject"},
	{"os.android", "types-jni"},
	{"os.ios", "types-darwin"},
	{"os.macos", "types-darwin"},
	{"subsystem.xnu", "types-iokit"},
  {NULL, NULL}
};
typedef int (*GperfForeachCallback)(void *user, const char *k, const char *v);
int gperf_types_index_foreach(GperfForeachCallback cb, void *user) {
  int i = 0; while (kvs[i].name) {
  cb (user, kvs[i].name, kvs[i].value);
  i++;}
  return 0;
}
const char *gperf_types_index_get(const char *s) {
  int i = 0; while (kvs[i].name) {
  if (!strcmp (s, kvs[i].name)) return kvs[i].value;
  i++;}
  return NULL;
}
#define sdb_hash_c_types_index(x,y) gperf_types_index_hash(x)
const unsigned int gperf_types_index_hash(const char *s) {
  int sum = strlen (s);
  while (*s) { sum += *s; s++; }
  return sum;
}
struct {const char *name;void *get;void *hash;void *foreach;} gperf_types_index = {
  .name = "types-index",
  .get = &gperf_types_index_get,
  .hash = &gperf_types_index_hash,
  .foreach = &gperf_types_index_foreach
};

#if MAIN
int main () {
	const char *s = ((char*(*)(char*))gperf_types_index.get)("foo");
	printf ("%s\n", s);
}
#endif
