]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
support type_t naming convention
authorJuerg Billeter <j@bitron.ch>
Sat, 19 Jan 2008 20:23:18 +0000 (20:23 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 19 Jan 2008 20:23:18 +0000 (20:23 +0000)
2008-01-19  Juerg Billeter  <j@bitron.ch>

* gobject-introspection/scanner.c: support type_t naming convention

svn path=/trunk/; revision=871

ChangeLog
gobject-introspection/scanner.c

index af39ed4b1647431317a23e79d90fc34b9089c0fb..97b0521d75b1e8fc650309b7247a49ff4f5a8925 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-19  Jürg Billeter  <j@bitron.ch>
+
+       * gobject-introspection/scanner.c: support type_t naming convention
+
 2008-01-19  Jürg Billeter  <j@bitron.ch>
 
        * vapigen/valagidlparser.vala: support hiding enums
index 58885791a86c3f626088263544952158547bb933..0e45db7e32722f168f350efe968ee4dadd42b932 100644 (file)
@@ -762,6 +762,16 @@ g_igenerator_process_unregistered_struct_typedef (GIGenerator * igenerator,
     g_list_insert_sorted (igenerator->module->entries, ginode,
                          (GCompareFunc) g_idl_node_cmp);
   lower_case_prefix = g_ascii_strdown (sym->ident, -1);
+
+  /* support type_t naming convention */
+  if (g_str_has_suffix (lower_case_prefix, "_t"))
+    {
+      char *tmp = lower_case_prefix;
+      tmp[strlen (tmp) - strlen ("_t")] = '\0';
+      lower_case_prefix = str_replace (tmp, "_", "");
+      g_free (tmp);
+    }
+
   g_hash_table_insert (igenerator->type_map, sym->ident, ginode);
   g_hash_table_insert (igenerator->type_by_lower_case_prefix,
                       lower_case_prefix, ginode);