reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
/* -*- Mode: C; c-file-style: "gnu"; -*- */
|
2005-05-09 16:24:46 +02:00
|
|
|
/* GObject introspection: IDL generator
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Matthias Clasen
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <errno.h>
|
Hush compiler warnings about return values, signedness mismatches, unused
* src/compiler.c, src/generate.c, src/gidlnode.c,
src/gidlparser.c, src/ginfo.c, src/girepository.c,
tests/invoke/invoke.c, test/invoke/testfns.c: Hush compiler
warnings about return values, signedness mismatches, unused
variables, and unhandles enum values in switch statements.
* tests/invoke/Makefile.am: Don't install the invoke test program.
Add -I ../../src to the cflags used for the test functions files.
2006-10-03 16:38:07 +02:00
|
|
|
#include <string.h>
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <glib/gstdio.h>
|
|
|
|
|
|
|
|
#include "girepository.h"
|
2008-06-08 16:37:30 +02:00
|
|
|
#include "gtypelib.h"
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-03-11 15:25:08 +01:00
|
|
|
/* FIXME: Avoid global */
|
|
|
|
static gchar *output = NULL;
|
2008-08-30 22:31:07 +02:00
|
|
|
gchar **includedirs = NULL;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
typedef struct {
|
|
|
|
FILE *file;
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
GSList *stack;
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
} Xml;
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
typedef struct {
|
|
|
|
char *name;
|
|
|
|
guint has_children : 1;
|
|
|
|
} XmlElement;
|
|
|
|
|
|
|
|
static XmlElement *
|
|
|
|
xml_element_new (const char *name)
|
|
|
|
{
|
|
|
|
XmlElement *elem;
|
|
|
|
|
|
|
|
elem = g_new (XmlElement, 1);
|
|
|
|
elem->name = g_strdup (name);
|
|
|
|
elem->has_children = FALSE;
|
|
|
|
return elem;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
xml_element_free (XmlElement *elem)
|
|
|
|
{
|
|
|
|
g_free (elem->name);
|
|
|
|
g_free (elem);
|
|
|
|
}
|
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
static void
|
|
|
|
xml_printf (Xml *xml, const char *fmt, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
2008-10-16 00:07:57 +02:00
|
|
|
char *s;
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
|
|
|
|
va_start (ap, fmt);
|
2008-10-16 00:07:57 +02:00
|
|
|
s = g_markup_vprintf_escaped (fmt, ap);
|
|
|
|
fputs (s, xml->file);
|
|
|
|
g_free (s);
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
va_end (ap);
|
|
|
|
}
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
static void
|
|
|
|
xml_start_element (Xml *xml, const char *element_name)
|
|
|
|
{
|
|
|
|
XmlElement *parent = NULL;
|
|
|
|
|
|
|
|
if (xml->stack)
|
|
|
|
{
|
|
|
|
parent = xml->stack->data;
|
|
|
|
|
|
|
|
if (!parent->has_children)
|
|
|
|
xml_printf (xml, ">\n");
|
|
|
|
|
|
|
|
parent->has_children = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
xml_printf (xml, "%*s<%s", g_slist_length(xml->stack)*2, "", element_name);
|
|
|
|
|
|
|
|
xml->stack = g_slist_prepend (xml->stack, xml_element_new (element_name));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
xml_end_element (Xml *xml, const char *name)
|
|
|
|
{
|
|
|
|
XmlElement *elem;
|
|
|
|
|
|
|
|
g_assert (xml->stack != NULL);
|
|
|
|
|
|
|
|
elem = xml->stack->data;
|
|
|
|
xml->stack = g_slist_delete_link (xml->stack, xml->stack);
|
|
|
|
|
|
|
|
if (name != NULL)
|
|
|
|
g_assert_cmpstr (name, ==, elem->name);
|
|
|
|
|
|
|
|
if (elem->has_children)
|
|
|
|
xml_printf (xml, "%*s</%s>\n", g_slist_length (xml->stack)*2, "", elem->name);
|
|
|
|
else
|
|
|
|
xml_printf (xml, "/>\n");
|
|
|
|
|
|
|
|
xml_element_free (elem);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
xml_end_element_unchecked (Xml *xml)
|
|
|
|
{
|
|
|
|
xml_end_element (xml, NULL);
|
|
|
|
}
|
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
static Xml *
|
|
|
|
xml_open (FILE *file)
|
|
|
|
{
|
|
|
|
Xml *xml;
|
|
|
|
|
|
|
|
xml = g_new (Xml, 1);
|
|
|
|
xml->file = file;
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml->stack = NULL;
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
|
|
|
|
return xml;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
xml_close (Xml *xml)
|
|
|
|
{
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
g_assert (xml->stack == NULL);
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
if (xml->file != NULL)
|
|
|
|
{
|
|
|
|
fflush (xml->file);
|
|
|
|
if (xml->file != stdout)
|
|
|
|
fclose (xml->file);
|
|
|
|
xml->file = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
xml_free (Xml *xml)
|
|
|
|
{
|
|
|
|
xml_close (xml);
|
|
|
|
g_free (xml);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-09-19 18:16:18 +02:00
|
|
|
static void
|
|
|
|
check_unresolved (GIBaseInfo *info)
|
|
|
|
{
|
|
|
|
if (g_base_info_get_type (info) != GI_INFO_TYPE_UNRESOLVED)
|
|
|
|
return;
|
|
|
|
|
|
|
|
g_critical ("Found unresolved type '%s' '%s'\n",
|
|
|
|
g_base_info_get_name (info), g_base_info_get_namespace (info));
|
|
|
|
}
|
|
|
|
|
2005-05-13 00:49:59 +02:00
|
|
|
static void
|
|
|
|
write_type_name (const gchar *namespace,
|
|
|
|
GIBaseInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-13 00:49:59 +02:00
|
|
|
{
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
if (strcmp (namespace, g_base_info_get_namespace (info)) != 0)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%s.", g_base_info_get_namespace (info));
|
2005-05-13 00:49:59 +02:00
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%s", g_base_info_get_name (info));
|
2005-05-13 00:49:59 +02:00
|
|
|
}
|
|
|
|
|
2008-10-16 00:08:40 +02:00
|
|
|
static void
|
|
|
|
write_type_name_attribute (const gchar *namespace,
|
|
|
|
GIBaseInfo *info,
|
|
|
|
const char *attr_name,
|
|
|
|
Xml *file)
|
|
|
|
{
|
|
|
|
xml_printf (file, " %s=\"", attr_name);
|
|
|
|
write_type_name (namespace, info, file);
|
|
|
|
xml_printf (file, "\"");
|
|
|
|
}
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_type_info (const gchar *namespace,
|
|
|
|
GITypeInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
gint tag;
|
|
|
|
gint i;
|
|
|
|
GITypeInfo *type;
|
2008-09-16 21:44:26 +02:00
|
|
|
gboolean is_pointer;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-09-19 18:16:18 +02:00
|
|
|
check_unresolved ((GIBaseInfo*)info);
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
tag = g_type_info_get_tag (info);
|
2008-09-16 21:44:26 +02:00
|
|
|
is_pointer = g_type_info_is_pointer (info);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-09-19 20:54:50 +02:00
|
|
|
if (tag == GI_TYPE_TAG_VOID)
|
|
|
|
{
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_start_element (file, "type");
|
|
|
|
|
|
|
|
xml_printf (file, " name=\"%s\"", is_pointer ? "any" : "none");
|
|
|
|
|
|
|
|
xml_end_element (file, "type");
|
2008-09-19 20:54:50 +02:00
|
|
|
}
|
2008-10-02 15:25:46 +02:00
|
|
|
else if (G_TYPE_TAG_IS_BASIC (tag))
|
2008-10-16 00:08:26 +02:00
|
|
|
{
|
|
|
|
xml_start_element (file, "type");
|
|
|
|
xml_printf (file, " name=\"%s\"", g_type_tag_to_string (tag));
|
|
|
|
xml_end_element (file, "type");
|
|
|
|
}
|
2008-09-24 00:18:06 +02:00
|
|
|
else if (tag == GI_TYPE_TAG_ARRAY)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
gint length;
|
|
|
|
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_start_element (file, "array");
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
type = g_type_info_get_param_type (info, 0);
|
|
|
|
|
|
|
|
length = g_type_info_get_array_length (info);
|
|
|
|
|
|
|
|
if (length >= 0)
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_printf (file, " length=\"%d\"", length);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (g_type_info_is_zero_terminated (info))
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_printf (file, " zero-terminated=\"1\"");
|
|
|
|
|
|
|
|
write_type_info (namespace, type, file);
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)type);
|
2008-10-16 00:08:26 +02:00
|
|
|
|
|
|
|
xml_end_element (file, "array");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
2008-09-24 00:18:06 +02:00
|
|
|
else if (tag == GI_TYPE_TAG_INTERFACE)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
GIBaseInfo *iface = g_type_info_get_interface (info);
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_start_element (file, "type");
|
2008-10-16 00:08:40 +02:00
|
|
|
write_type_name_attribute (namespace, iface, "name", file);
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_end_element (file, "type");
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref (iface);
|
|
|
|
}
|
2008-09-24 00:18:06 +02:00
|
|
|
else if (tag == GI_TYPE_TAG_GLIST)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_start_element (file, "type");
|
|
|
|
xml_printf (file, " name=\"GLib.List\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
type = g_type_info_get_param_type (info, 0);
|
2005-05-19 21:05:05 +02:00
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
write_type_info (namespace, type, file);
|
|
|
|
g_base_info_unref ((GIBaseInfo *)type);
|
|
|
|
}
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_end_element (file, "type");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
2008-09-24 00:18:06 +02:00
|
|
|
else if (tag == GI_TYPE_TAG_GSLIST)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_start_element (file, "type");
|
|
|
|
xml_printf (file, " name=\"GLib.SList\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
type = g_type_info_get_param_type (info, 0);
|
2005-05-19 21:05:05 +02:00
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
write_type_info (namespace, type, file);
|
|
|
|
g_base_info_unref ((GIBaseInfo *)type);
|
|
|
|
}
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_end_element (file, "type");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
2008-09-24 00:18:06 +02:00
|
|
|
else if (tag == GI_TYPE_TAG_GHASH)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_start_element (file, "type");
|
|
|
|
xml_printf (file, " name=\"GLib.HashTable\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
type = g_type_info_get_param_type (info, 0);
|
2005-05-19 21:05:05 +02:00
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
write_type_info (namespace, type, file);
|
|
|
|
g_base_info_unref ((GIBaseInfo *)type);
|
|
|
|
type = g_type_info_get_param_type (info, 1);
|
|
|
|
write_type_info (namespace, type, file);
|
|
|
|
g_base_info_unref ((GIBaseInfo *)type);
|
|
|
|
}
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_end_element (file, "type");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
2008-09-24 00:18:06 +02:00
|
|
|
else if (tag == GI_TYPE_TAG_ERROR)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2005-05-19 21:05:05 +02:00
|
|
|
gint n;
|
|
|
|
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_start_element (file, "type");
|
|
|
|
xml_printf (file, " name=\"GLib.Error\"");
|
|
|
|
|
2005-05-19 21:05:05 +02:00
|
|
|
n = g_type_info_get_n_error_domains (info);
|
|
|
|
if (n > 0)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2005-05-19 21:05:05 +02:00
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
{
|
|
|
|
GIErrorDomainInfo *ed = g_type_info_get_error_domain (info, i);
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_start_element (file, "type");
|
2008-10-16 00:08:40 +02:00
|
|
|
write_type_name_attribute (namespace, (GIBaseInfo *)ed, "name", file);
|
2008-10-16 00:08:26 +02:00
|
|
|
xml_end_element (file, "type");
|
2005-05-19 21:05:05 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)ed);
|
|
|
|
}
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
2008-10-16 00:08:26 +02:00
|
|
|
|
|
|
|
xml_end_element (file, "type");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
2008-09-20 01:43:33 +02:00
|
|
|
else
|
2008-09-24 00:18:06 +02:00
|
|
|
{
|
|
|
|
g_printerr ("Unhandled type tag %d\n", tag);
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
2005-05-15 06:30:43 +02:00
|
|
|
static void
|
|
|
|
write_constant_value (const gchar *namespace,
|
|
|
|
GITypeInfo *info,
|
|
|
|
GArgument *argument,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file);
|
2005-05-15 06:30:43 +02:00
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_field_info (const gchar *namespace,
|
|
|
|
GIFieldInfo *info,
|
2005-05-15 06:30:43 +02:00
|
|
|
GIConstantInfo *branch,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
const gchar *name;
|
|
|
|
GIFieldInfoFlags flags;
|
|
|
|
gint size;
|
|
|
|
gint offset;
|
|
|
|
GITypeInfo *type;
|
2005-05-15 06:30:43 +02:00
|
|
|
GArgument value;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
flags = g_field_info_get_flags (info);
|
|
|
|
size = g_field_info_get_size (info);
|
|
|
|
offset = g_field_info_get_offset (info);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "field");
|
2008-10-17 16:58:37 +02:00
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
|
|
|
|
|
|
|
/* Fields are assumed to be read-only
|
|
|
|
* (see also girwriter.py and girparser.c)
|
|
|
|
*/
|
|
|
|
if (!(flags & GI_FIELD_IS_READABLE))
|
|
|
|
xml_printf (file, " readable=\"0\"");
|
|
|
|
if (flags & GI_FIELD_IS_WRITABLE)
|
|
|
|
xml_printf (file, " writable=\"1\"");
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
if (size)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " bits=\"%d\"", size);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " offset=\"%d\"", offset);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
type = g_field_info_get_type (info);
|
2005-05-15 06:30:43 +02:00
|
|
|
|
|
|
|
if (branch)
|
|
|
|
{
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " branch=\"");
|
2005-05-15 06:30:43 +02:00
|
|
|
type = g_constant_info_get_type (branch);
|
|
|
|
g_constant_info_get_value (branch, &value);
|
|
|
|
write_constant_value (namespace, type, &value, file);
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "\"");
|
2005-05-15 06:30:43 +02:00
|
|
|
}
|
|
|
|
|
2008-08-14 21:07:34 +02:00
|
|
|
write_type_info (namespace, type, file);
|
|
|
|
g_base_info_unref ((GIBaseInfo *)type);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "field");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_callable_info (const gchar *namespace,
|
|
|
|
GICallableInfo *info,
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
GITypeInfo *type;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
type = g_callable_info_get_return_type (info);
|
2005-05-13 00:49:59 +02:00
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "return-value");
|
2008-10-12 23:07:39 +02:00
|
|
|
|
2005-05-13 00:49:59 +02:00
|
|
|
if (g_type_info_is_pointer (type))
|
|
|
|
{
|
|
|
|
switch (g_callable_info_get_caller_owns (info))
|
|
|
|
{
|
|
|
|
case GI_TRANSFER_NOTHING:
|
|
|
|
break;
|
|
|
|
case GI_TRANSFER_CONTAINER:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " transfer-ownership=\"container\"");
|
2005-05-13 00:49:59 +02:00
|
|
|
break;
|
|
|
|
case GI_TRANSFER_EVERYTHING:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " transfer-ownership=\"full\"");
|
2005-05-13 00:49:59 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
|
|
|
}
|
Clear up constant parsing
2008-08-14 Johan Dahlin <johan@gnome.org>
* girepository/girparser.c (start_field), (start_constant),
(start_type), (end_element_handler):
Clear up constant parsing
* tests/object.gir:
Update
* tools/generate.c (write_callable_info), (write_function_info),
(write_callback_info), (write_constant_info), (write_signal_info),
(write_vfunc_info), (write_property_info), (write_object_info),
(write_interface_info):
Constants/Signals are handled now.
svn path=/trunk/; revision=377
2008-08-14 21:32:26 +02:00
|
|
|
|
2005-05-13 19:31:10 +02:00
|
|
|
if (g_callable_info_may_return_null (info))
|
2008-10-22 16:02:02 +02:00
|
|
|
xml_printf (file, " allow-none=\"1\"");
|
2005-05-13 19:31:10 +02:00
|
|
|
|
2008-08-14 21:07:34 +02:00
|
|
|
write_type_info (namespace, type, file);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "return-value");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-08-14 21:07:34 +02:00
|
|
|
if (g_callable_info_get_n_args (info) <= 0)
|
|
|
|
return;
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "parameters");
|
2008-08-14 21:07:34 +02:00
|
|
|
for (i = 0; i < g_callable_info_get_n_args (info); i++)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2008-08-14 21:07:34 +02:00
|
|
|
GIArgInfo *arg = g_callable_info_get_arg (info, i);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "parameter");
|
|
|
|
xml_printf (file, " name=\"%s\"",
|
|
|
|
g_base_info_get_name ((GIBaseInfo *) arg));
|
2008-08-14 21:07:34 +02:00
|
|
|
|
2008-08-22 22:05:23 +02:00
|
|
|
switch (g_arg_info_get_ownership_transfer (arg))
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2008-08-22 22:05:23 +02:00
|
|
|
case GI_TRANSFER_NOTHING:
|
|
|
|
break;
|
|
|
|
case GI_TRANSFER_CONTAINER:
|
2008-10-17 16:59:23 +02:00
|
|
|
xml_printf (file, " transfer-ownership=\"container\"");
|
2008-08-22 22:05:23 +02:00
|
|
|
break;
|
|
|
|
case GI_TRANSFER_EVERYTHING:
|
2008-10-17 16:59:23 +02:00
|
|
|
xml_printf (file, " transfer-ownership=\"full\"");
|
2008-08-22 22:05:23 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
2008-08-14 21:07:34 +02:00
|
|
|
|
|
|
|
switch (g_arg_info_get_direction (arg))
|
|
|
|
{
|
|
|
|
case GI_DIRECTION_IN:
|
|
|
|
break;
|
|
|
|
case GI_DIRECTION_OUT:
|
2008-10-17 16:59:07 +02:00
|
|
|
xml_printf (file, " direction=\"out\"");
|
2008-08-14 21:07:34 +02:00
|
|
|
break;
|
|
|
|
case GI_DIRECTION_INOUT:
|
2008-10-17 16:59:07 +02:00
|
|
|
xml_printf (file, " direction=\"inout\"");
|
2008-08-14 21:07:34 +02:00
|
|
|
break;
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
2008-08-14 21:07:34 +02:00
|
|
|
|
|
|
|
if (g_arg_info_may_be_null (arg))
|
2008-10-22 16:02:02 +02:00
|
|
|
xml_printf (file, " allow-none=\"1\"");
|
2008-08-14 21:07:34 +02:00
|
|
|
|
|
|
|
if (g_arg_info_is_dipper (arg))
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " dipper=\"1\"");
|
2008-08-14 21:07:34 +02:00
|
|
|
|
|
|
|
if (g_arg_info_is_return_value (arg))
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " retval=\"1\"");
|
2008-08-14 21:07:34 +02:00
|
|
|
|
|
|
|
if (g_arg_info_is_optional (arg))
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " optional=\"1\"");
|
2008-08-14 21:07:34 +02:00
|
|
|
|
|
|
|
type = g_arg_info_get_type (arg);
|
|
|
|
write_type_info (namespace, type, file);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "parameter");
|
2008-08-14 21:07:34 +02:00
|
|
|
|
|
|
|
g_base_info_unref ((GIBaseInfo *)arg);
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
2008-08-14 21:07:34 +02:00
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "parameters");
|
2008-08-22 19:34:29 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)type);
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_function_info (const gchar *namespace,
|
|
|
|
GIFunctionInfo *info,
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
GIFunctionInfoFlags flags;
|
|
|
|
const gchar *tag;
|
|
|
|
const gchar *name;
|
2005-05-09 21:32:10 +02:00
|
|
|
const gchar *symbol;
|
2005-05-09 16:24:46 +02:00
|
|
|
gboolean deprecated;
|
2008-10-21 20:20:25 +02:00
|
|
|
gboolean throws;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
flags = g_function_info_get_flags (info);
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
2005-05-09 21:32:10 +02:00
|
|
|
symbol = g_function_info_get_symbol (info);
|
2005-05-09 16:24:46 +02:00
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
2008-10-21 20:20:25 +02:00
|
|
|
throws = flags & GI_FUNCTION_THROWS;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & GI_FUNCTION_IS_CONSTRUCTOR)
|
|
|
|
tag = "constructor";
|
|
|
|
else if (flags & GI_FUNCTION_IS_METHOD)
|
|
|
|
tag = "method";
|
|
|
|
else
|
|
|
|
tag = "function";
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, tag);
|
|
|
|
xml_printf (file, " name=\"%s\" c:identifier=\"%s\"",
|
|
|
|
name, symbol);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & GI_FUNCTION_IS_SETTER)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " type=\"setter\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
else if (flags & GI_FUNCTION_IS_GETTER)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " type=\"getter\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2008-08-30 22:31:07 +02:00
|
|
|
|
2008-10-21 20:20:25 +02:00
|
|
|
if (throws)
|
|
|
|
xml_printf (file, " throws=\"1\"");
|
|
|
|
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_callable_info (namespace, (GICallableInfo*)info, file);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, tag);
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_callback_info (const gchar *namespace,
|
|
|
|
GICallbackInfo *info,
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
const gchar *name;
|
|
|
|
gboolean deprecated;
|
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "callback");
|
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_callable_info (namespace, (GICallableInfo*)info, file);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "callback");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_struct_info (const gchar *namespace,
|
|
|
|
GIStructInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
const gchar *name;
|
|
|
|
const gchar *type_name;
|
|
|
|
const gchar *type_init;
|
|
|
|
gboolean deprecated;
|
|
|
|
gint i;
|
2008-08-22 16:43:41 +02:00
|
|
|
int n_elts;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
|
|
|
|
2008-09-06 22:33:51 +02:00
|
|
|
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
|
|
|
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_BOXED)
|
|
|
|
{
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "glib:boxed");
|
|
|
|
xml_printf (file, " glib:name=\"%s\"", name);
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
else
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
{
|
|
|
|
xml_start_element (file, "record");
|
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
|
|
|
}
|
2008-09-06 22:33:51 +02:00
|
|
|
|
|
|
|
if (type_name != NULL)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " glib:type-name=\"%s\" glib:get-type=\"%s\"", type_name, type_init);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-08-22 16:43:41 +02:00
|
|
|
n_elts = g_struct_info_get_n_fields (info) + g_struct_info_get_n_methods (info);
|
|
|
|
if (n_elts > 0)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2008-08-22 16:43:41 +02:00
|
|
|
for (i = 0; i < g_struct_info_get_n_fields (info); i++)
|
|
|
|
{
|
|
|
|
GIFieldInfo *field = g_struct_info_get_field (info, i);
|
|
|
|
write_field_info (namespace, field, NULL, file);
|
|
|
|
g_base_info_unref ((GIBaseInfo *)field);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_struct_info_get_n_methods (info); i++)
|
|
|
|
{
|
|
|
|
GIFunctionInfo *function = g_struct_info_get_method (info, i);
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_function_info (namespace, function, file);
|
2008-08-22 16:43:41 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)function);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
|
|
|
|
xml_end_element_unchecked (file);
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_value_info (const gchar *namespace,
|
|
|
|
GIValueInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
const gchar *name;
|
|
|
|
glong value;
|
|
|
|
gboolean deprecated;
|
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
value = g_value_info_get_value (info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "member");
|
|
|
|
xml_printf (file, " name=\"%s\" value=\"%ld\"", name, value);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "member");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-15 06:30:43 +02:00
|
|
|
write_constant_value (const gchar *namespace,
|
|
|
|
GITypeInfo *type,
|
|
|
|
GArgument *value,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
switch (g_type_info_get_tag (type))
|
|
|
|
{
|
|
|
|
case GI_TYPE_TAG_BOOLEAN:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%d", value->v_boolean);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_INT8:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%d", value->v_int8);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT8:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%d", value->v_uint8);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_INT16:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%" G_GINT16_FORMAT, value->v_int16);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT16:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%" G_GUINT16_FORMAT, value->v_uint16);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_INT32:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%" G_GINT32_FORMAT, value->v_int32);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT32:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%" G_GUINT32_FORMAT, value->v_uint32);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_INT64:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%" G_GINT64_FORMAT, value->v_int64);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT64:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%" G_GUINT64_FORMAT, value->v_uint64);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_INT:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%d", value->v_int);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UINT:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%d", value->v_uint);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_LONG:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%ld", value->v_long);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_ULONG:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%ld", value->v_ulong);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
2005-05-21 02:08:27 +02:00
|
|
|
case GI_TYPE_TAG_SSIZE:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%zd", value->v_ssize);
|
2005-05-21 02:08:27 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_SIZE:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%zd", value->v_size);
|
2005-05-21 02:08:27 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_FLOAT:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%f", value->v_float);
|
2005-05-21 02:08:27 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_DOUBLE:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%f", value->v_double);
|
2005-05-21 02:08:27 +02:00
|
|
|
break;
|
|
|
|
case GI_TYPE_TAG_UTF8:
|
|
|
|
case GI_TYPE_TAG_FILENAME:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, "%s", value->v_string);
|
2005-05-21 02:08:27 +02:00
|
|
|
break;
|
Hush compiler warnings about return values, signedness mismatches, unused
* src/compiler.c, src/generate.c, src/gidlnode.c,
src/gidlparser.c, src/ginfo.c, src/girepository.c,
tests/invoke/invoke.c, test/invoke/testfns.c: Hush compiler
warnings about return values, signedness mismatches, unused
variables, and unhandles enum values in switch statements.
* tests/invoke/Makefile.am: Don't install the invoke test program.
Add -I ../../src to the cflags used for the test functions files.
2006-10-03 16:38:07 +02:00
|
|
|
default:
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
g_assert_not_reached ();
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
2005-05-15 06:30:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
write_constant_info (const gchar *namespace,
|
|
|
|
GIConstantInfo *info,
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
Xml *file)
|
2005-05-15 06:30:43 +02:00
|
|
|
{
|
|
|
|
GITypeInfo *type;
|
|
|
|
const gchar *name;
|
|
|
|
gboolean deprecated;
|
|
|
|
GArgument value;
|
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "constant");
|
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
2005-05-15 06:30:43 +02:00
|
|
|
|
|
|
|
type = g_constant_info_get_type (info);
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " value=\"");
|
2005-05-15 06:30:43 +02:00
|
|
|
|
|
|
|
g_constant_info_get_value (info, &value);
|
|
|
|
write_constant_value (namespace, type, &value, file);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_printf (file, "\"");
|
Clear up constant parsing
2008-08-14 Johan Dahlin <johan@gnome.org>
* girepository/girparser.c (start_field), (start_constant),
(start_type), (end_element_handler):
Clear up constant parsing
* tests/object.gir:
Update
* tools/generate.c (write_callable_info), (write_function_info),
(write_callback_info), (write_constant_info), (write_signal_info),
(write_vfunc_info), (write_property_info), (write_object_info),
(write_interface_info):
Constants/Signals are handled now.
svn path=/trunk/; revision=377
2008-08-14 21:32:26 +02:00
|
|
|
|
|
|
|
write_type_info (namespace, type, file);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "constant");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
g_base_info_unref ((GIBaseInfo *)type);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_enum_info (const gchar *namespace,
|
|
|
|
GIEnumInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
const gchar *name;
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
const gchar *type_name;
|
|
|
|
const gchar *type_init;
|
2005-05-09 16:24:46 +02:00
|
|
|
gboolean deprecated;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
|
|
|
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
|
|
|
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_ENUM)
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "enumeration");
|
2005-05-09 16:24:46 +02:00
|
|
|
else
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "bitfield");
|
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (type_init)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " glib:type-name=\"%s\" glib:get-type=\"%s\"", type_name, type_init);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < g_enum_info_get_n_values (info); i++)
|
|
|
|
{
|
|
|
|
GIValueInfo *value = g_enum_info_get_value (info, i);
|
2005-05-13 00:49:59 +02:00
|
|
|
write_value_info (namespace, value, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)value);
|
|
|
|
}
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element_unchecked (file);
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_signal_info (const gchar *namespace,
|
|
|
|
GISignalInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
GSignalFlags flags;
|
|
|
|
const gchar *name;
|
|
|
|
gboolean deprecated;
|
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
flags = g_signal_info_get_flags (info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "glib:signal");
|
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & G_SIGNAL_RUN_FIRST)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " when=\"FIRST\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
else if (flags & G_SIGNAL_RUN_LAST)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " when=\"LAST\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
else if (flags & G_SIGNAL_RUN_CLEANUP)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " when=\"CLEANUP\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & G_SIGNAL_NO_RECURSE)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " no-recurse=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & G_SIGNAL_DETAILED)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " detailed=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & G_SIGNAL_ACTION)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " action=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & G_SIGNAL_NO_HOOKS)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " no-hooks=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_callable_info (namespace, (GICallableInfo*)info, file);
|
Clear up constant parsing
2008-08-14 Johan Dahlin <johan@gnome.org>
* girepository/girparser.c (start_field), (start_constant),
(start_type), (end_element_handler):
Clear up constant parsing
* tests/object.gir:
Update
* tools/generate.c (write_callable_info), (write_function_info),
(write_callback_info), (write_constant_info), (write_signal_info),
(write_vfunc_info), (write_property_info), (write_object_info),
(write_interface_info):
Constants/Signals are handled now.
svn path=/trunk/; revision=377
2008-08-14 21:32:26 +02:00
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "glib:signal");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_vfunc_info (const gchar *namespace,
|
|
|
|
GIVFuncInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
GIVFuncInfoFlags flags;
|
|
|
|
const gchar *name;
|
|
|
|
gboolean deprecated;
|
2005-05-22 06:22:51 +02:00
|
|
|
gint offset;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
flags = g_vfunc_info_get_flags (info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
2005-05-22 06:22:51 +02:00
|
|
|
offset = g_vfunc_info_get_offset (info);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "vfunc");
|
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & GI_VFUNC_MUST_CHAIN_UP)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " must-chain-up=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & GI_VFUNC_MUST_OVERRIDE)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " override=\"always\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
else if (flags & GI_VFUNC_MUST_NOT_OVERRIDE)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " override=\"never\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " offset=\"%d\"", offset);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_callable_info (namespace, (GICallableInfo*)info, file);
|
Clear up constant parsing
2008-08-14 Johan Dahlin <johan@gnome.org>
* girepository/girparser.c (start_field), (start_constant),
(start_type), (end_element_handler):
Clear up constant parsing
* tests/object.gir:
Update
* tools/generate.c (write_callable_info), (write_function_info),
(write_callback_info), (write_constant_info), (write_signal_info),
(write_vfunc_info), (write_property_info), (write_object_info),
(write_interface_info):
Constants/Signals are handled now.
svn path=/trunk/; revision=377
2008-08-14 21:32:26 +02:00
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "vfunc");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_property_info (const gchar *namespace,
|
|
|
|
GIPropertyInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
GParamFlags flags;
|
|
|
|
const gchar *name;
|
|
|
|
gboolean deprecated;
|
|
|
|
GITypeInfo *type;
|
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
flags = g_property_info_get_flags (info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "property");
|
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-10-17 16:57:38 +02:00
|
|
|
/* Properties are assumed to be read-only (see also girwriter.py) */
|
|
|
|
if (!(flags & G_PARAM_READABLE))
|
|
|
|
xml_printf (file, " readable=\"0\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
if (flags & G_PARAM_WRITABLE)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " writable=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & G_PARAM_CONSTRUCT)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " construct=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (flags & G_PARAM_CONSTRUCT_ONLY)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " construct-only=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
type = g_property_info_get_type (info);
|
Clear up constant parsing
2008-08-14 Johan Dahlin <johan@gnome.org>
* girepository/girparser.c (start_field), (start_constant),
(start_type), (end_element_handler):
Clear up constant parsing
* tests/object.gir:
Update
* tools/generate.c (write_callable_info), (write_function_info),
(write_callback_info), (write_constant_info), (write_signal_info),
(write_vfunc_info), (write_property_info), (write_object_info),
(write_interface_info):
Constants/Signals are handled now.
svn path=/trunk/; revision=377
2008-08-14 21:32:26 +02:00
|
|
|
|
2005-05-13 00:49:59 +02:00
|
|
|
write_type_info (namespace, type, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "property");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_object_info (const gchar *namespace,
|
|
|
|
GIObjectInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
const gchar *name;
|
|
|
|
const gchar *type_name;
|
|
|
|
const gchar *type_init;
|
|
|
|
gboolean deprecated;
|
2008-10-22 18:46:19 +02:00
|
|
|
gboolean is_abstract;
|
2005-05-09 16:24:46 +02:00
|
|
|
GIObjectInfo *pnode;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
2008-10-22 18:46:19 +02:00
|
|
|
is_abstract = g_object_info_get_abstract (info);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
|
|
|
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "class");
|
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2005-05-13 00:49:59 +02:00
|
|
|
pnode = g_object_info_get_parent (info);
|
|
|
|
if (pnode)
|
|
|
|
{
|
2008-10-16 00:08:40 +02:00
|
|
|
write_type_name_attribute (namespace, (GIBaseInfo *)pnode, "parent", file);
|
2005-05-24 22:45:26 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)pnode);
|
2005-05-13 00:49:59 +02:00
|
|
|
}
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-10-22 18:46:19 +02:00
|
|
|
if (is_abstract)
|
|
|
|
xml_printf (file, " abstract=\"1\"");
|
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " glib:type-name=\"%s\" glib:get-type=\"%s\"", type_name, type_init);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
if (g_object_info_get_n_interfaces (info) > 0)
|
|
|
|
{
|
|
|
|
for (i = 0; i < g_object_info_get_n_interfaces (info); i++)
|
|
|
|
{
|
|
|
|
GIInterfaceInfo *imp = g_object_info_get_interface (info, i);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "implements");
|
2008-10-16 00:08:40 +02:00
|
|
|
write_type_name_attribute (namespace, (GIBaseInfo *)imp, "name", file);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "implements");
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo*)imp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_object_info_get_n_fields (info); i++)
|
|
|
|
{
|
|
|
|
GIFieldInfo *field = g_object_info_get_field (info, i);
|
2005-05-15 06:30:43 +02:00
|
|
|
write_field_info (namespace, field, NULL, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)field);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_object_info_get_n_methods (info); i++)
|
|
|
|
{
|
|
|
|
GIFunctionInfo *function = g_object_info_get_method (info, i);
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_function_info (namespace, function, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)function);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_object_info_get_n_properties (info); i++)
|
|
|
|
{
|
|
|
|
GIPropertyInfo *prop = g_object_info_get_property (info, i);
|
2005-05-13 00:49:59 +02:00
|
|
|
write_property_info (namespace, prop, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)prop);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_object_info_get_n_signals (info); i++)
|
|
|
|
{
|
|
|
|
GISignalInfo *signal = g_object_info_get_signal (info, i);
|
2005-05-13 00:49:59 +02:00
|
|
|
write_signal_info (namespace, signal, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)signal);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_object_info_get_n_vfuncs (info); i++)
|
|
|
|
{
|
|
|
|
GIVFuncInfo *vfunc = g_object_info_get_vfunc (info, i);
|
2005-05-13 00:49:59 +02:00
|
|
|
write_vfunc_info (namespace, vfunc, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)vfunc);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_object_info_get_n_constants (info); i++)
|
|
|
|
{
|
|
|
|
GIConstantInfo *constant = g_object_info_get_constant (info, i);
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_constant_info (namespace, constant, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)constant);
|
|
|
|
}
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "class");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_interface_info (const gchar *namespace,
|
|
|
|
GIInterfaceInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
const gchar *name;
|
|
|
|
const gchar *type_name;
|
|
|
|
const gchar *type_init;
|
|
|
|
gboolean deprecated;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
|
|
|
|
|
|
|
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
|
|
|
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "interface");
|
|
|
|
xml_printf (file, " name=\"%s\" glib:type-name=\"%s\" glib:get-type=\"%s\"",
|
2005-05-09 16:24:46 +02:00
|
|
|
name, type_name, type_init);
|
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
if (g_interface_info_get_n_prerequisites (info) > 0)
|
|
|
|
{
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "requires");
|
2005-05-09 16:24:46 +02:00
|
|
|
for (i = 0; i < g_interface_info_get_n_prerequisites (info); i++)
|
|
|
|
{
|
|
|
|
GIBaseInfo *req = g_interface_info_get_prerequisite (info, i);
|
|
|
|
|
|
|
|
if (g_base_info_get_type (req) == GI_INFO_TYPE_INTERFACE)
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "interface");
|
2005-05-09 16:24:46 +02:00
|
|
|
else
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "object");
|
2008-10-16 00:08:40 +02:00
|
|
|
write_type_name_attribute (namespace, req, "name", file);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element_unchecked (file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref (req);
|
|
|
|
}
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "requires");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_interface_info_get_n_methods (info); i++)
|
|
|
|
{
|
|
|
|
GIFunctionInfo *function = g_interface_info_get_method (info, i);
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_function_info (namespace, function, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)function);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_interface_info_get_n_properties (info); i++)
|
|
|
|
{
|
|
|
|
GIPropertyInfo *prop = g_interface_info_get_property (info, i);
|
2005-05-13 00:49:59 +02:00
|
|
|
write_property_info (namespace, prop, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)prop);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_interface_info_get_n_signals (info); i++)
|
|
|
|
{
|
|
|
|
GISignalInfo *signal = g_interface_info_get_signal (info, i);
|
2005-05-13 00:49:59 +02:00
|
|
|
write_signal_info (namespace, signal, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)signal);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_interface_info_get_n_vfuncs (info); i++)
|
|
|
|
{
|
|
|
|
GIVFuncInfo *vfunc = g_interface_info_get_vfunc (info, i);
|
2005-05-13 00:49:59 +02:00
|
|
|
write_vfunc_info (namespace, vfunc, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)vfunc);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_interface_info_get_n_constants (info); i++)
|
|
|
|
{
|
|
|
|
GIConstantInfo *constant = g_interface_info_get_constant (info, i);
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_constant_info (namespace, constant, file);
|
2005-05-09 16:24:46 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)constant);
|
|
|
|
}
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "interface");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-05-13 00:49:59 +02:00
|
|
|
write_error_domain_info (const gchar *namespace,
|
|
|
|
GIErrorDomainInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
GIBaseInfo *enum_;
|
2005-05-13 00:49:59 +02:00
|
|
|
const gchar *name, *quark;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
quark = g_error_domain_info_get_quark (info);
|
|
|
|
enum_ = (GIBaseInfo *)g_error_domain_info_get_codes (info);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "errordomain");
|
2008-10-16 00:08:40 +02:00
|
|
|
xml_printf (file, " name=\"%s\" get-quark=\"%s\"",
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
name, quark);
|
2008-10-16 00:08:40 +02:00
|
|
|
write_type_name_attribute (namespace, enum_, "codes", file);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "errordomain");
|
2005-05-13 00:49:59 +02:00
|
|
|
g_base_info_unref (enum_);
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
2005-05-15 06:30:43 +02:00
|
|
|
static void
|
|
|
|
write_union_info (const gchar *namespace,
|
|
|
|
GIUnionInfo *info,
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *file)
|
2005-05-15 06:30:43 +02:00
|
|
|
{
|
|
|
|
const gchar *name;
|
|
|
|
const gchar *type_name;
|
|
|
|
const gchar *type_init;
|
|
|
|
gboolean deprecated;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
name = g_base_info_get_name ((GIBaseInfo *)info);
|
|
|
|
deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info);
|
|
|
|
|
|
|
|
type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
|
|
|
|
type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "union");
|
|
|
|
xml_printf (file, " name=\"%s\"", name);
|
2005-05-15 06:30:43 +02:00
|
|
|
|
|
|
|
if (type_name)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " type-name=\"%s\" get-type=\"%s\"", type_name, type_init);
|
2005-05-15 06:30:43 +02:00
|
|
|
|
|
|
|
if (deprecated)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (file, " deprecated=\"1\"");
|
2005-05-15 06:30:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
if (g_union_info_is_discriminated (info))
|
|
|
|
{
|
|
|
|
gint offset;
|
|
|
|
GITypeInfo *type;
|
|
|
|
|
|
|
|
offset = g_union_info_get_discriminator_offset (info);
|
|
|
|
type = g_union_info_get_discriminator_type (info);
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (file, "discriminator");
|
|
|
|
xml_printf (file, " offset=\"%d\" type=\"", offset);
|
2005-05-15 06:30:43 +02:00
|
|
|
write_type_info (namespace, type, file);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "discriminator");
|
2005-05-15 06:30:43 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)type);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_union_info_get_n_fields (info); i++)
|
|
|
|
{
|
|
|
|
GIFieldInfo *field = g_union_info_get_field (info, i);
|
|
|
|
GIConstantInfo *constant = g_union_info_get_discriminator (info, i);
|
|
|
|
write_field_info (namespace, field, constant, file);
|
|
|
|
g_base_info_unref ((GIBaseInfo *)field);
|
|
|
|
if (constant)
|
|
|
|
g_base_info_unref ((GIBaseInfo *)constant);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < g_union_info_get_n_methods (info); i++)
|
|
|
|
{
|
|
|
|
GIFunctionInfo *function = g_union_info_get_method (info, i);
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_function_info (namespace, function, file);
|
2005-05-15 06:30:43 +02:00
|
|
|
g_base_info_unref ((GIBaseInfo *)function);
|
|
|
|
}
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (file, "union");
|
2005-05-15 06:30:43 +02:00
|
|
|
}
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
static void
|
2008-08-30 22:31:07 +02:00
|
|
|
write_repository (const char *namespace,
|
2005-05-09 16:24:46 +02:00
|
|
|
gboolean needs_prefix)
|
|
|
|
{
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
FILE *ofile;
|
2005-05-09 16:24:46 +02:00
|
|
|
gint i, j;
|
2008-08-30 22:31:07 +02:00
|
|
|
char **dependencies;
|
|
|
|
GIRepository *repository;
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
Xml *xml;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-08-30 22:31:07 +02:00
|
|
|
repository = g_irepository_get_default ();
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (output == NULL)
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
ofile = stdout;
|
2005-05-09 16:24:46 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
gchar *filename;
|
|
|
|
|
|
|
|
if (needs_prefix)
|
2008-08-30 22:31:07 +02:00
|
|
|
filename = g_strdup_printf ("%s-%s", namespace, output);
|
2005-05-09 16:24:46 +02:00
|
|
|
else
|
|
|
|
filename = g_strdup (output);
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
ofile = g_fopen (filename, "w");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
if (ofile == NULL)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
g_fprintf (stderr, "failed to open '%s': %s\n",
|
|
|
|
filename, g_strerror (errno));
|
|
|
|
g_free (filename);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (filename);
|
|
|
|
}
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
|
|
|
|
xml = xml_open (ofile);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_printf (xml, "<?xml version=\"1.0\"?>\n");
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (xml, "repository");
|
|
|
|
xml_printf (xml, " version=\"1.0\"\n"
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
" xmlns=\"http://www.gtk.org/introspection/core/1.0\"\n"
|
|
|
|
" xmlns:c=\"http://www.gtk.org/introspection/c/1.0\"\n"
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
" xmlns:glib=\"http://www.gtk.org/introspection/glib/1.0\"");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-08-30 22:31:07 +02:00
|
|
|
dependencies = g_irepository_get_dependencies (repository,
|
|
|
|
namespace);
|
|
|
|
if (dependencies != NULL)
|
|
|
|
{
|
|
|
|
for (i = 0; dependencies[i]; i++)
|
|
|
|
{
|
2008-10-16 15:16:30 +02:00
|
|
|
char **parts = g_strsplit (dependencies[i], "-", 2);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (xml, "include");
|
2008-10-16 15:16:30 +02:00
|
|
|
xml_printf (xml, " name=\"%s\" version=\"%s\"", parts[0], parts[1]);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (xml, "include");
|
2008-10-16 15:16:30 +02:00
|
|
|
g_strfreev (parts);
|
2008-08-30 22:31:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (TRUE)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
const gchar *shared_library;
|
2008-08-30 22:31:07 +02:00
|
|
|
const char *ns = namespace;
|
2008-10-12 06:51:48 +02:00
|
|
|
const char *version;
|
|
|
|
|
|
|
|
version = g_irepository_get_version (repository, ns);
|
2008-08-30 22:31:07 +02:00
|
|
|
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
shared_library = g_irepository_get_shared_library (repository, ns);
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_start_element (xml, "namespace");
|
|
|
|
xml_printf (xml, " name=\"%s\" version=\"%s\"", ns, version);
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
if (shared_library)
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_printf (xml, " shared-library=\"%s\"", shared_library);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2005-05-13 00:49:59 +02:00
|
|
|
for (j = 0; j < g_irepository_get_n_infos (repository, ns); j++)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2005-05-13 00:49:59 +02:00
|
|
|
GIBaseInfo *info = g_irepository_get_info (repository, ns, j);
|
2005-05-09 16:24:46 +02:00
|
|
|
switch (g_base_info_get_type (info))
|
|
|
|
{
|
|
|
|
case GI_INFO_TYPE_FUNCTION:
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_function_info (ns, (GIFunctionInfo *)info, xml);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GI_INFO_TYPE_CALLBACK:
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_callback_info (ns, (GICallbackInfo *)info, xml);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GI_INFO_TYPE_STRUCT:
|
|
|
|
case GI_INFO_TYPE_BOXED:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
write_struct_info (ns, (GIStructInfo *)info, xml);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
2005-05-15 06:30:43 +02:00
|
|
|
|
|
|
|
case GI_INFO_TYPE_UNION:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
write_union_info (ns, (GIUnionInfo *)info, xml);
|
2005-05-15 06:30:43 +02:00
|
|
|
break;
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
case GI_INFO_TYPE_ENUM:
|
|
|
|
case GI_INFO_TYPE_FLAGS:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
write_enum_info (ns, (GIEnumInfo *)info, xml);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GI_INFO_TYPE_CONSTANT:
|
remove unused indent parameters, xmlwriter keeps track of necessary
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (write_field_info, write_callable_info,
write_function_info, write_callback_info, write_struct_info,
write_constant_value, write_signal_info, write_vfunc_info,
write_object_info, write_interface_info, write_union_info,
write_repository): remove unused indent parameters, xmlwriter
keeps track of necessary indentation
svn path=/trunk/; revision=714
2008-10-16 00:07:33 +02:00
|
|
|
write_constant_info (ns, (GIConstantInfo *)info, xml);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GI_INFO_TYPE_OBJECT:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
write_object_info (ns, (GIObjectInfo *)info, xml);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GI_INFO_TYPE_INTERFACE:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
write_interface_info (ns, (GIInterfaceInfo *)info, xml);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GI_INFO_TYPE_ERROR_DOMAIN:
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
write_error_domain_info (ns, (GIErrorDomainInfo *)info, xml);
|
2005-05-09 16:24:46 +02:00
|
|
|
break;
|
2005-05-15 06:30:43 +02:00
|
|
|
|
|
|
|
default:
|
|
|
|
g_error ("unknown info type %d\n", g_base_info_get_type (info));
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
g_base_info_unref (info);
|
|
|
|
}
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (xml, "namespace");
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
Keep track of generated XML tree and handle indentation and closing tags
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_element_new, xml_element_free,
xml_start_element, xml_end_element, xml_end_element_unchecked,
xml_open, xml_close): Keep track of generated XML tree and
handle indentation and closing tags properly.
(write_field_info, write_callable_info, write_function_info,
write_callback_info, write_struct_info, write_value_info,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): Use xml_start_element and xml_end_element to
open/close tags.
svn path=/trunk/; revision=713
2008-10-16 00:06:52 +02:00
|
|
|
xml_end_element (xml, "repository");
|
2005-05-09 16:24:46 +02:00
|
|
|
|
wrap all FILE access to go through simple xmlwriter
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* tools/generate.c (xml_printf, xml_open, xml_close, xml_free):
(write_type_name, write_type_info, write_field_info,
write_callable_info, write_function_info, write_callback_info,
write_struct_info, write_value_info, write_constant_value,
write_constant_info, write_enum_info, write_signal_info,
write_vfunc_info, write_property_info, write_object_info,
write_interface_info, write_error_domain_info, write_union_info,
write_repository): wrap all FILE access to go through simple xmlwriter
svn path=/trunk/; revision=712
2008-10-16 00:06:37 +02:00
|
|
|
xml_free (xml);
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static const guchar *
|
2008-08-09 14:55:32 +02:00
|
|
|
load_typelib (const gchar *filename,
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
GModule **dlhandle,
|
|
|
|
gsize *len)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2008-08-09 14:55:32 +02:00
|
|
|
guchar *typelib;
|
|
|
|
gsize *typelib_size;
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
GModule *handle;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
handle = g_module_open (filename, G_MODULE_BIND_LOCAL|G_MODULE_BIND_LAZY);
|
2008-08-22 23:08:06 +02:00
|
|
|
if (handle == NULL)
|
|
|
|
{
|
|
|
|
g_printerr ("Could not load typelib from '%s': %s\n",
|
|
|
|
filename, g_module_error ());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-08-09 14:55:32 +02:00
|
|
|
if (!g_module_symbol (handle, "_G_TYPELIB", (gpointer *) &typelib))
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
{
|
2008-08-09 14:55:32 +02:00
|
|
|
g_printerr ("Could not load typelib from '%s': %s\n",
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
filename, g_module_error ());
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-08-09 14:55:32 +02:00
|
|
|
if (!g_module_symbol (handle, "_G_TYPELIB_SIZE", (gpointer *) &typelib_size))
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
{
|
2008-08-09 14:55:32 +02:00
|
|
|
g_printerr ("Could not load typelib from '%s': %s\n",
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
filename, g_module_error ());
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-08-09 14:55:32 +02:00
|
|
|
*len = *typelib_size;
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
if (dlhandle)
|
|
|
|
*dlhandle = handle;
|
|
|
|
|
2008-08-09 14:55:32 +02:00
|
|
|
return typelib;
|
2005-05-09 16:24:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
2008-08-22 23:14:31 +02:00
|
|
|
gboolean shlib = FALSE;
|
2008-03-11 15:25:08 +01:00
|
|
|
gchar **input = NULL;
|
2005-05-09 16:24:46 +02:00
|
|
|
GOptionContext *context;
|
|
|
|
GError *error = NULL;
|
|
|
|
gboolean needs_prefix;
|
|
|
|
gint i;
|
2008-06-08 16:37:30 +02:00
|
|
|
GTypelib *data;
|
2008-03-11 15:25:08 +01:00
|
|
|
GOptionEntry options[] =
|
|
|
|
{
|
2008-08-22 23:14:31 +02:00
|
|
|
{ "shlib", 0, 0, G_OPTION_ARG_NONE, &shlib, "handle typelib embedded in shlib", NULL },
|
2008-03-11 15:25:08 +01:00
|
|
|
{ "output", 'o', 0, G_OPTION_ARG_FILENAME, &output, "output file", "FILE" },
|
2008-08-30 22:31:07 +02:00
|
|
|
{ "includedir", 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &includedirs, "include directories in GIR search path", NULL },
|
2008-03-11 15:25:08 +01:00
|
|
|
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &input, NULL, NULL },
|
|
|
|
{ NULL, }
|
|
|
|
};
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-08-30 22:31:07 +02:00
|
|
|
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL);
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
g_type_init ();
|
|
|
|
|
2008-06-08 16:37:30 +02:00
|
|
|
g_typelib_check_sanity ();
|
Revert revisions 157,149-148,136-129 and 120. Move back to using
2008-04-22 Johan Dahlin <johan@gnome.org>
* girepository/ginfo.c (g_info_from_entry), (g_type_info_new),
(g_type_info_is_pointer), (g_type_info_get_tag),
(g_type_info_get_param_type), (g_type_info_get_interface),
(g_type_info_get_array_length), (g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_codes), (g_enum_info_get_value),
(g_object_info_get_interface), (g_object_info_get_field),
(g_interface_info_get_prerequisite),
(g_signal_info_get_class_closure), (g_constant_info_get_value):
* girepository/ginvoke.c (get_ffi_type):
* girepository/girepository.h:
* girepository/gmetadata.c (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_constant_blob),
(validate_struct_blob), (validate_enum_blob):
* girepository/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke.c (main):
* tests/roundtrips.sh:
* tools/Makefile.am:
* tools/compiler.c (format_output), (write_out_metadata), (main):
* tools/generate.c (write_type_name), (write_type_info),
(write_constant_value), (write_enum_info), (load_metadata), (main):
* tools/gidlcompilercontext.c:
* tools/gidlcompilercontext.h:
* tools/gidlcompilerentrynode.c:
* tools/gidlcompilerentrynode.h:
* tools/gidlcompilertypenode.c:
* tools/gidlcompilertypenode.h:
* tools/gidlmodule.c (g_idl_module_build_metadata):
* tools/gidlmodule.h:
* tools/gidlnode.c (init_stats), (dump_stats),
(g_idl_node_get_size), (g_idl_node_get_full_size),
(g_idl_node_cmp), (g_idl_node_can_have_member),
(g_idl_node_add_member), (g_idl_node_param_direction_string),
(parse_int_value), (parse_uint_value), (parse_float_value),
(parse_boolean_value), (find_entry_node), (find_entry),
(serialize_type), (g_idl_node_build_metadata), (write_string):
* tools/gidlnode.h:
* tools/gidlparser.c (parse_type_internal):
* tools/quote-file.sh:
Revert revisions 157,149-148,136-129 and 120.
Move back to using g-idl-generate to generate the metadata and
avoids dependency on a c compiler.
svn path=/trunk/; revision=214
2008-04-23 00:48:16 +02:00
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
context = g_option_context_new ("");
|
|
|
|
g_option_context_add_main_entries (context, options, NULL);
|
|
|
|
g_option_context_parse (context, &argc, &argv, &error);
|
|
|
|
|
|
|
|
if (!input)
|
|
|
|
{
|
|
|
|
g_fprintf (stderr, "no input files\n");
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-08-30 22:31:07 +02:00
|
|
|
if (includedirs != NULL)
|
|
|
|
for (i = 0; includedirs[i]; i++)
|
|
|
|
g_irepository_prepend_search_path (includedirs[i]);
|
|
|
|
|
2005-05-09 16:24:46 +02:00
|
|
|
for (i = 0; input[i]; i++)
|
|
|
|
{
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
GModule *dlhandle = NULL;
|
2008-08-09 14:55:32 +02:00
|
|
|
const guchar *typelib;
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
gsize len;
|
2008-08-30 22:31:07 +02:00
|
|
|
const char *namespace;
|
2005-05-09 16:24:46 +02:00
|
|
|
|
2008-08-22 23:14:31 +02:00
|
|
|
if (!shlib)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2008-08-09 14:55:32 +02:00
|
|
|
if (!g_file_get_contents (input[i], (gchar **)&typelib, &len, &error))
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
|
|
|
g_fprintf (stderr, "failed to read '%s': %s\n",
|
|
|
|
input[i], error->message);
|
|
|
|
g_clear_error (&error);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-09 14:55:32 +02:00
|
|
|
typelib = load_typelib (input[i], &dlhandle, &len);
|
|
|
|
if (!typelib)
|
2005-05-09 16:24:46 +02:00
|
|
|
{
|
2008-08-09 14:55:32 +02:00
|
|
|
g_fprintf (stderr, "failed to load typelib from '%s'\n",
|
2005-05-09 16:24:46 +02:00
|
|
|
input[i]);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (input[i + 1] && output)
|
|
|
|
needs_prefix = TRUE;
|
|
|
|
else
|
|
|
|
needs_prefix = FALSE;
|
|
|
|
|
2008-08-09 14:55:32 +02:00
|
|
|
data = g_typelib_new_from_const_memory (typelib, len);
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
{
|
|
|
|
GError *error = NULL;
|
2008-06-08 16:37:30 +02:00
|
|
|
if (!g_typelib_validate (data, &error)) {
|
2008-08-09 14:55:32 +02:00
|
|
|
g_printerr ("typelib not valid: %s\n", error->message);
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
g_clear_error (&error);
|
2008-08-30 22:31:07 +02:00
|
|
|
return 1;
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
}
|
|
|
|
}
|
2008-08-30 22:31:12 +02:00
|
|
|
namespace = g_irepository_load_typelib (g_irepository_get_default (), data, 0,
|
2008-08-30 22:31:07 +02:00
|
|
|
&error);
|
|
|
|
if (namespace == NULL)
|
|
|
|
{
|
|
|
|
g_printerr ("failed to load typelib: %s\n", error->message);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
write_repository (namespace, needs_prefix);
|
2005-05-09 16:24:46 +02:00
|
|
|
|
|
|
|
if (dlhandle)
|
|
|
|
{
|
reviewed by: Johan Dahlin <johan@gnome.org>
2007-12-06 Gustavo J. A. M. Carneiro <gjc@gnome.org>
reviewed by: Johan Dahlin <johan@gnome.org>
* configure.ac:
* gobject-introspection.pc.in:
* src/Makefile.am:
* src/compiler.c: (format_output), (write_out_metadata), (main):
* src/gen-introspect.c: (main):
* src/gen-introspect.h:
* src/generate.c: (write_callable_info), (write_repository),
(load_metadata), (main):
* src/gidlmodule.c: (g_idl_module_new),
(g_idl_module_build_metadata):
* src/gidlmodule.h:
* src/gidlparser.c: (start_element_handler):
* src/ginfo.c: (g_info_new), (g_info_from_entry),
(g_base_info_get_name), (g_base_info_get_namespace),
(g_base_info_is_deprecated), (g_base_info_get_annotation),
(g_base_info_get_metadata), (g_function_info_get_symbol),
(g_function_info_get_flags), (g_function_info_get_property),
(g_function_info_get_vfunc), (signature_offset), (g_type_info_new),
(g_callable_info_may_return_null),
(g_callable_info_get_caller_owns), (g_callable_info_get_n_args),
(g_callable_info_get_arg), (g_arg_info_get_direction),
(g_arg_info_is_return_value), (g_arg_info_is_dipper),
(g_arg_info_is_optional), (g_arg_info_may_be_null),
(g_arg_info_get_ownership_transfer), (g_type_info_is_pointer),
(g_type_info_get_tag), (g_type_info_get_param_type),
(g_type_info_get_interface), (g_type_info_get_array_length),
(g_type_info_is_zero_terminated),
(g_type_info_get_n_error_domains), (g_type_info_get_error_domain),
(g_error_domain_info_get_quark), (g_error_domain_info_get_codes),
(g_value_info_get_value), (g_field_info_get_flags),
(g_field_info_get_size), (g_field_info_get_offset),
(g_registered_type_info_get_type_name),
(g_registered_type_info_get_type_init),
(g_struct_info_get_n_fields), (g_struct_info_get_field),
(g_struct_info_get_n_methods), (g_struct_info_get_method),
(find_method), (g_struct_info_find_method),
(g_enum_info_get_n_values), (g_enum_info_get_value),
(g_object_info_get_parent), (g_object_info_get_type_name),
(g_object_info_get_type_init), (g_object_info_get_n_interfaces),
(g_object_info_get_interface), (g_object_info_get_n_fields),
(g_object_info_get_field), (g_object_info_get_n_properties),
(g_object_info_get_property), (g_object_info_get_n_methods),
(g_object_info_get_method), (g_object_info_find_method),
(g_object_info_get_n_signals), (g_object_info_get_signal),
(g_object_info_get_n_vfuncs), (g_object_info_get_vfunc),
(g_object_info_get_n_constants), (g_object_info_get_constant),
(g_interface_info_get_n_prerequisites),
(g_interface_info_get_prerequisite),
(g_interface_info_get_n_properties),
(g_interface_info_get_property), (g_interface_info_get_n_methods),
(g_interface_info_get_method), (g_interface_info_find_method),
(g_interface_info_get_n_signals), (g_interface_info_get_signal),
(g_interface_info_get_n_vfuncs), (g_interface_info_get_vfunc),
(g_interface_info_get_n_constants),
(g_interface_info_get_constant), (g_property_info_get_flags),
(g_signal_info_get_flags), (g_signal_info_get_class_closure),
(g_signal_info_true_stops_emit), (g_vfunc_info_get_flags),
(g_vfunc_info_get_offset), (g_vfunc_info_get_signal),
(g_constant_info_get_value), (g_union_info_get_n_fields),
(g_union_info_get_field), (g_union_info_get_n_methods),
(g_union_info_get_method), (g_union_info_is_discriminated),
(g_union_info_get_discriminator_offset),
(g_union_info_get_discriminator):
* src/ginvoke.c: (g_function_info_invoke):
* src/girepository.c: (g_irepository_register),
(g_irepository_unregister), (g_irepository_get_default),
(count_interfaces), (g_irepository_get_n_infos), (find_interface),
(g_irepository_get_info), (g_irepository_find_by_name),
(g_irepository_get_shared_library),
(g_irepository_build_search_path), (g_irepository_register_file),
(g_irepository_error_quark):
* src/girepository.h:
* src/gmetadata.c: (g_metadata_get_dir_entry),
(g_metadata_check_sanity), (validate_header),
(validate_array_type_blob), (validate_iface_type_blob),
(validate_param_type_blob), (validate_error_type_blob),
(validate_type_blob), (validate_arg_blob),
(validate_signature_blob), (validate_function_blob),
(validate_callback_blob), (validate_constant_blob),
(validate_value_blob), (validate_field_blob),
(validate_property_blob), (validate_signal_blob),
(validate_vfunc_blob), (validate_struct_blob),
(validate_enum_blob), (validate_object_blob),
(validate_interface_blob), (validate_errordomain_blob),
(validate_union_blob), (validate_blob), (validate_directory),
(validate_annotations), (g_metadata_validate), (_g_metadata_init),
(g_metadata_new_from_memory), (g_metadata_new_from_const_memory),
(g_metadata_new_from_mapped_file), (g_metadata_free),
(g_metadata_set_module), (g_metadata_get_namespace):
* src/gmetadata.h:
* tests/Makefile.am:
* tests/invoke/Makefile.am:
* tests/invoke/invoke-namespace-find.sh:
* tests/invoke/invoke.c: (main):
Add a namespace/shared library mapping. fixes #313268.
svn path=/trunk/; revision=66
2007-12-06 01:16:15 +01:00
|
|
|
g_module_close (dlhandle);
|
2005-05-09 16:24:46 +02:00
|
|
|
dlhandle = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* when writing to stdout, stop after the first module */
|
|
|
|
if (input[i + 1] && !output)
|
|
|
|
{
|
|
|
|
g_fprintf (stderr, "warning, %d modules omitted\n",
|
|
|
|
g_strv_length (input) - 1);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|