+ if (!name)
+ return -EPERM;
+
+ /* Only lookup in local scope */
+ if (lookup_type_scope(name, scope))
+ return -EEXIST;
+
+ g_hash_table_insert(scope->types,
+ (gpointer) (unsigned long) name,
+ type);
+ type_ref(type);
+ return 0;
+}
+
+static
+struct declaration *
+ lookup_declaration_scope(GQuark field_name, struct declaration_scope *scope)
+{
+ return g_hash_table_lookup(scope->declarations,
+ (gconstpointer) (unsigned long) field_name);