Commit Graph

30150 Commits

Author SHA1 Message Date
Colin Walters
c0114d8811 Bug 554632: Create type tag for GType
svn path=/trunk/; revision=641
2024-02-08 13:53:59 +00:00
Colin Walters
11a41321a3 Use symbolic names for type tags instead of hardcoded integers
svn path=/trunk/; revision=626
2024-02-08 13:53:59 +00:00
Colin Walters
68fb7868d3 Merge branch 'bug552566-timet/wip'
svn path=/trunk/; revision=624
2024-02-08 13:53:59 +00:00
Colin Walters
78c7abb34f Explode immediately if we don't recognize a type
svn path=/trunk/; revision=619
2024-02-08 13:53:59 +00:00
Colin Walters
ff45096d96 Fix indentation
svn path=/trunk/; revision=618
2024-02-08 13:53:59 +00:00
Colin Walters
4ae9d0f2fa Add check to make sure we're not hitting out unresolved types
svn path=/trunk/; revision=616
2024-02-08 13:53:59 +00:00
Colin Walters
95b9645166 Print out "any" for VOID+pointer, not "none"
* tools/generate.c: Print out "any" for VOID+pointer,
	not "none"

svn path=/trunk/; revision=610
2024-02-08 13:53:59 +00:00
Colin Walters
77683a327f Allow both union and struct to be boxed or not
* girepository/girnode.c: Allow gtype_name
	and gtype_init in struct and union.
	* girepository/girparser.c: Parse glib:
	boxed bits for both structure and union.
	* girepository/gtypelib.c: Don't barf
	if structure is boxed.
	* giscanner/girparser.py: Parse new XML
	format.
	* giscanner/girwriter.py: Write out new
	XML format.
	* giscanner/glibast.py: Define new classes
	which are both Boxed and Struct/Union, as
	well as an "Other" for everything else.
	* giscanner/glibtransformer.py: Handle
	boxed types specially; we try to merge
	them with a struct/union if one exists,
	otherwise fall back to generic boxed.
	* tests/*: Update.
	* tools/generate.c: Write out new format.

svn path=/trunk/; revision=575
2024-02-08 13:53:59 +00:00
Colin Walters
886b9c66c5 Remove g_irepository_unregister, add GIRepositoryLoadFlags
svn path=/trunk/; revision=543
2024-02-08 13:53:59 +00:00
Colin Walters
030b17bc9f Put dependencies in typelibs, resolve them when loading
* gir/Makefile.am: Dep on Makefile
	* girepository/ginfo.c: Print out a nicer error
	message if we failed to load something.
	* girepository/girepository.c: Clean up
	default typelib handling; remove global
	default_typelib variable.  Ensure we handle
	NULL repository in more places.
	Support dependency resolution.
	* tests/Makefile.am: Kill off gobject.gir,
	it conflicts with the real one.
	* tests/Object.gir: Depend on GObject.
	* tools/generate.c: Take --includedir
	argument to say which directories to search
	for typelibs.  Print out dependencies.

svn path=/trunk/; revision=541
2024-02-08 13:53:59 +00:00
Colin Walters
56428ae349 Correctly handle GLib.List, GLib.Error etc
* girepository/girparser.c: Accept both List (for
	compiling GLib) and GLib.List (what the scanner
	generates).
	* tests/ - Update.
	* tools/generate.c: Generate canonical form.

svn path=/trunk/; revision=522
2024-02-08 13:53:59 +00:00
Tor Lillqvist
97e04b2b5d Make g-ir-scanner work on Windows. Still problems with the typelib code.
2008-08-27  Tor Lillqvist  <tml@novell.com>

	Make g-ir-scanner work on Windows. Still problems with the typelib
	code. Changes okayed by jdahlin.

	* configure.ac: Check for Windows, set Automake conditional
	OS_WIN32. Change backslashes to forward slashes in pyexecdir to
	avoid shell quoting issues
	
	* girepository/Makefile.am: Use -no-undefined so that libtool
	agrees to build a shared library on Windows.

	* girepository/girparser.c (backtrace_stderr): No backtrace() on
	Windows. Empty implementation on Windows so far.

	* girepository/gtypelib.c (g_typelib_check_sanity): Give more
	informative error message for the assertion failures. Tell also
	what the expected size of the struct is. Check all sizes first and
	fail afterwards if at least one size was different from expected.

	* tools/Makefile.am: Reorder libraries into proper logical
	dependency order.

	* tools/generate.c: Don't include <dlfcn.h>, not used.

	* giscanner/Makefile.am: On Windows, link with the Python library,
	and install the module DLL as _giscanner.pyd. Remove the
	unnecessary import library and libtool library that libtool has
	installed.

	* giscanner/scannerlexer.l: Recognize the gcc __attribute__ syntax
	and just skip it. Recognize also two "l" suffixes for long long
	constants. Recognize also __inline__.

	* giscanner/grealpath.h (g_realpath): Implement on Windows, using
	GetFullPathName(). As such, GetFullPathName() does more than the
	UNIX realpath(). It also changes relative paths into absolute
	paths. But for our purposes that shouldn't matter.

	* giscanner/giscannermodule.c (pygi_source_scanner_parse_file): On
	Windows the file descriptor passed to us is from Python. Python
	Python2.5 uses the msvcr71.dll C library, while mingw-built code
	uses msvcrt.dll. On Windows, file descriptors are specific to
	which C library is used. So we must find out what underlying OS
	handle corresponds to the file descriptor Python passes us, and
	then make that into a file descriptor valid for the C library this
	code uses.

	* giscanner/sourcescanner.py (_parse): Don't need to bypass
	__attribute__ as the lexer now handles it. The definition as empty
	was ineffective for mingw anyway, as mingw's _mingw.h undefines
	__attribute__. Close the temp file before unlinking it.

	* giscanner/cgobject.py: Use correct library name for the gobject
	DLL on Windows.

	* gir/Makefile.am: Must pass the full basename of the DLLs on
	Windows to g-ir-scanner. It's a bit ugly that we have to "know"
	that the names of the GLib DLLs are like libglib-2.0-0.dll, but in
	reality they won't change, until there is a GLib 3, and then also
	the Unix code here needs changing.

	Must pass CPPFLAGS to g-ir-scanner when building GLib.gir so that
	libintl.h is found.


svn path=/trunk/; revision=503
2024-02-08 13:53:59 +00:00
Colin Walters
c306fea286 Parse new implements syntax, drop gapi one. Update. Generate new syntax.
2008-08-25  Colin Walters  <walters@verbum.org>

	* girepository/girparser.c: Parse new implements
	syntax, drop gapi one.
	* tests/object.gir: Update.
	* tools/generate.c: Generate new syntax.

svn path=/trunk/; revision=492
2024-02-08 13:53:59 +00:00
Colin Walters
fc4cffc61d Default to --raw. Update.
2008-08-22  Colin Walters  <walters@verbum.org>

	* tools/generate.c, tools/compiler.c: Default
	to --raw.
	* all Makefile.am: Update.

svn path=/trunk/; revision=462
2024-02-08 13:53:59 +00:00
Colin Walters
a91b3dba67 Install config.py, better error handling if we forget --raw
svn path=/trunk/; revision=461
2024-02-08 13:53:59 +00:00
Colin Walters
cf73901c6b Pass through recursive types. Avoid overwriting errors. Always write the
2008-08-22  Colin Walters  <walters@verbum.org>

	* girepository/girparser.c: Pass through
	recursive types.  Avoid overwriting errors.
	* giscanner/xmlwriter.py: Always write the
	XML header.
	* tests/*.gir: Adjust.
	* tests/scanner/Makefile.am: Build typelibs,
	and generate XML from those.  Once we
	have a good diff mechanism...
	* tests/scanner/*-expected.gir: Add XML
	header.
	* tools/g-ir-scanner: Accept --typelib-xml
	option.
	* tools/generate.c: Better defaults for transfer.

svn path=/trunk/; revision=457
2024-02-08 13:53:59 +00:00
Colin Walters
ab1e9433db Don't put * in types, suppress transfer="none"
svn path=/trunk/; revision=453
2024-02-08 13:53:59 +00:00
Colin Walters
e1cd668950 Fix unref sequence.
2008-08-22  Colin Walters  <walters@verbum.org>

	* tools/generate.c (write_callable_info): Fix unref
	sequence.

svn path=/trunk/; revision=449
2024-02-08 13:53:59 +00:00
Colin Walters
d922fdb5fc Add g-ir-generate. Support $(DEBUG) Do immediate close tags if no
2008-08-22  Colin Walters  <walters@verbum.org>

	* gobject-introspection-1.0.pc.in: Add g-ir-generate.
	* tests/Makefile.am: Support $(DEBUG)
	* tools/generate.c: Do immediate close tags if no
	sub-elements.

svn path=/trunk/; revision=448
2024-02-08 13:53:59 +00:00
Johan Dahlin
2f803f62e6 Fix generator for constant/gobject/struct
2008-08-14  Johan Dahlin  <johan@gnome.org>

    * tests/Makefile.am:
    * tests/constant.gir:
    * tests/gobject.gir:
    * tests/struct.gir:
    * tools/generate.c (write_struct_info):
    Fix generator for constant/gobject/struct


svn path=/trunk/; revision=379
2024-02-08 13:53:59 +00:00
Johan Dahlin
5d3fe6f2f0 Fix generation of enum/bitfields
2008-08-14  Johan Dahlin  <johan@gnome.org>

    * tests/Makefile.am:
    * tests/enum.gir:
    * tools/generate.c (write_enum_info):
    Fix generation of enum/bitfields


svn path=/trunk/; revision=378
2024-02-08 13:53:59 +00:00
Johan Dahlin
f49fa21c31 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
2024-02-08 13:53:59 +00:00
Johan Dahlin
8ed19c3d86 Don't require c:type. Test boxed.gir Update, remove parts we don't support
2008-08-14  Johan Dahlin  <johan@gnome.org>

    * girepository/girparser.c (start_type):
    Don't require c:type.
    * tests/Makefile.am:
    Test boxed.gir
    * tests/boxed.gir:
    Update, remove parts we don't support yet
    * tests/roundtrips.sh:
    Remove
    * tools/generate.c (write_type_info), (write_field_info),
    (write_callable_info), (write_struct_info):
    Make it emit proper gir.


svn path=/trunk/; revision=376
2024-02-08 13:53:59 +00:00
Johan Dahlin
c2bbd6ecba Rename metadata to typelib in variable names, comments and apis.
2008-08-09  Johan Dahlin  <johan@gnome.org>

    * *.[ch]:
    Rename metadata to typelib in variable names,
    comments and apis.


svn path=/trunk/; revision=339
2024-02-08 13:53:59 +00:00
Johan Dahlin
dcd26fddc7 Merge in the gir-compiler branch. Thanks to Philip and Colin for their
2008-08-08  Johan Dahlin  <johan@gnome.org>

    * girepository/gtypelib.c (validate_header):
    * girepository/gtypelib.h:
    * giscanner/ast.py:
    * giscanner/girwriter.py:
    * giscanner/sourcescanner.c (gi_source_symbol_ref),
    (gi_source_symbol_unref):
    * tests/array.test:
    * tests/boxed.test:
    * tests/constant.test:
    * tests/enum.test:
    * tests/errors.test:
    * tests/function.test:
    * tests/gobject.test:
    * tests/interface.test:
    * tests/invoke/Makefile.am:
    * tests/invoke/testfns.xml:
    * tests/object.test:
    * tests/parser/Makefile.am:
    * tests/roundtrips.sh:
    * tests/struct.test:
    * tests/types.test:
    * tests/union.test:
    * tests/xref1.test:
    * tests/xref2.test:
    * tools/Makefile.am:
    * tools/compiler.c (main):
    * tools/generate.c (write_callable_info), (write_function_info),
    (write_repository):
    * tools/gidlmodule.c:
    * tools/gidlmodule.h:
    * tools/gidlnode.c:
    * tools/gidlnode.h:
    * tools/gidlparser.c:
    * tools/gidlparser.h:
    * tools/gidlwriter.c:
    * tools/gidlwriter.h:
    * tools/scanner.c (create_node_from_gtype),
    (create_node_from_ctype), (g_igenerator_process_properties),
    (g_igenerator_process_signals), (g_igenerator_create_object),
    (g_igenerator_create_interface), (g_igenerator_create_boxed),
    (g_igenerator_create_enum), (g_igenerator_create_flags),
    (g_igenerator_process_function_symbol),
    (g_igenerator_process_unregistered_struct_typedef),
    (g_igenerator_process_struct_typedef),
    (g_igenerator_process_union_typedef),
    (g_igenerator_process_enum_typedef),
    (g_igenerator_process_function_typedef),
    (g_igenerator_process_constant), (g_igenerator_process_symbols),
    (g_igenerator_add_module), (g_igenerator_add_include_idl):
    Merge in the gir-compiler branch.
    Thanks to Philip and Colin for their help.


svn path=/trunk/; revision=325
2024-02-08 13:53:59 +00:00
Philip Van Hoof
5d80d5082c tools/gidlnode.c
2008-06-08  Philip Van Hoof  <pvanhoof@gnome.org>

        * girepository/girepository.c:
        * girepository/gtypelib.c:
        * girepository/ginfo.c:
        * girepository/ginvoke.c:
        * girepository/girepository.h:
        * girepository/gtypelib.h:
        * girepository/gmetadata.c:
        * girepository/Makefile.am:
        * girepository/gmetadata.h:
        * tools/compiler.c:
        * tools/gidlmodule.c:
        * tools/gidlnode.c
        * tools/generate.c:
        * tools/gidlmodule.h:
        * tools/gidlparser.c:

        Renamed GMetadata to GTypelib


svn path=/trunk/; revision=288
2024-02-08 13:53:59 +00:00
Johan Dahlin
64d32c97b5 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
2024-02-08 13:53:59 +00:00
Johan Dahlin
c7c1c96c2b Remove most global variables
2008-03-11  Johan Dahlin  <johan@gnome.org>

        * tools/compiler.c:
        * tools/generate.c:
        Remove most global variables


svn path=/trunk/; revision=153
2024-02-08 13:53:59 +00:00
Mark Doffman
cff3cc7ad9 tools/quote-file.sh tools/compiler.c tools/generate.c
2008-02-22  Mark Doffman  <mark.doffman@codethink.co.uk>

    * tools/quote-file.sh
    * tools/compiler.c
    * tools/generate.c

      Move to using the 'C' struct compiler code.

WARNING: This commit does not compile. It is a partial change.

svn path=/trunk/; revision=135
2024-02-08 13:53:59 +00:00
Mark Doffman
eb13d2e55b girepository/ginfo.c tools/generate.c
2008-02-21  Mark Doffman  <mark.doffman@codethink.co.uk>

    * girepository/ginfo.c
    * tools/generate.c

    Change the way that external references with no namespace
    are dealt with. External references with no namespace
    are placed into the XML as-if they are a local reference.
    This is temporary, but helps with roundtrip tests.

WARNING: This commit does not compile. It is a partial change.

svn path=/trunk/; revision=134
2024-02-08 13:53:59 +00:00
Mark Doffman
e56744c907 girepository/ginfo.c girepository/girepository.h tools/generate.c
2008-02-21  Mark Doffman  <mark.doffman@codethink.co.uk>

    * girepository/ginfo.c
    * girepository/girepository.h
    * tools/generate.c

      Add a function to check if an enum is registered or not.
      Previously anything testing this relied on the g-type
      string offset having a value of 0.

    * girepository/gmetadata.c
    * girepository/gmetadata.h
    * tools/generate.c

      Remove unneccesary or erroneous checks. There were two
      metadata validation checks which made sure that the blob
      sizes were the same as some magic numbers compiled into the code.
      This is wrong as it breaks any forwards compatibility that may
      be possible.

      Checks were also present that made sure that unregistered type
      blobs had a value of 0 in the g-type offset field. This is
      unneccessary. If a type blob is unregistered then any value
      in its g-type field is simply invalid.

WARNING: This commit does not compile. It is a partial change.

svn path=/trunk/; revision=132
2024-02-08 13:53:59 +00:00
Mark Doffman
9e6472853a girepository/ginvoke.c girepository/girepository.h
2008-02-21  Mark Doffman  <mark.doffman@codethink.co.uk>

    * girepository/ginvoke.c
    * girepository/girepository.h
    * girepository/gmetadata.c
    * girepository/gmetadata.h
    * tools/generate.c
    * tools/gidlparser.c

      Modify TYPE_TAG_INTERFACE to TYPE_TAG_SYMBOL
      to avoid confusion with the interface blob.

    * tools/generate.c
    * tools/gidlparser.c

      Remove magic numbers and replace with type-tag
      enumeration symbols.

    * girepository/gmetadata.c
      Add validate declaration.

WARNING: This commit does not compile. It is a partial change.

svn path=/trunk/; revision=129
2024-02-08 13:53:59 +00:00
Rob Taylor
a7d0962d46 Added: Added: Renamed to tools/Makefile.am: Renamed to tools/compiler.c:
2008-02-08  Rob Taylor  <rob.taylor@codethink.co.uk>

	* Makefile.am:
	* configure.ac:
	* gidl/Makefile.am: Added:
	* girepository/Makefile.am: Added:
	* src/Makefile.am: Renamed to tools/Makefile.am:
	* src/compiler.c: Renamed to tools/compiler.c:
	* src/g-idl-offsets.pl: Renamed to tools/g-idl-offsets.pl:
	* src/generate.c: Renamed to tools/generate.c:
	* src/gidlmodule.c: Renamed to tools/gidlmodule.c:
	* src/gidlmodule.h: Renamed to tools/gidlmodule.h:
	* src/gidlnode.c: Renamed to tools/gidlnode.c:
	* src/gidlnode.h: Renamed to tools/gidlnode.h:
	* src/gidlparser.c: Renamed to tools/gidlparser.c:
	* src/gidlparser.h: Renamed to tools/gidlparser.h:
	* src/gidlwriter.c: Renamed to tools/gidlwriter.c:
	* src/gidlwriter.h: Renamed to tools/gidlwriter.h:
	* src/ginfo.c: Renamed to girepository/ginfo.c:
	* src/ginvoke.c: Renamed to girepository/ginvoke.c:
	* src/girepository.c: Renamed to girepository/girepository.c:
	* src/girepository.h: Renamed to girepository/girepository.h:
	* src/gmetadata.c: Renamed to girepository/gmetadata.c:
	* src/gmetadata.h: Renamed to girepository/gmetadata.h:
	* src/scanner.c: Renamed to tools/scanner.c:
	* src/scanner.h: Renamed to tools/scanner.h:
	* src/scannerlexer.l: Renamed to tools/scannerlexer.l:
	* src/scannerparser.y: Renamed to tools/scannerparser.y:
	* tests/invoke/Makefile.am:
	Split src/ into girepository/ and tools/

	* Makefile.am:
	* configure.ac:
	* girepository/Makefile.am:
	* tests/Makefile.am:
	* tests/invoke/Makefile.am:
	* tests/parser/Makefile.am:
	* tests/roundtrips.sh:
	* tools/Makefile.am:
	Make distcheck work.

svn path=/trunk/; revision=104
2024-02-08 13:53:59 +00:00
Gustavo J. A. M. Carneiro
2b0304b865 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
2024-02-08 13:53:59 +00:00
Torsten Schönfeld
00a6f8ada0 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.
2024-02-08 13:53:59 +00:00
Matthias Clasen
94d45e70a0 Fix a segfault 2024-02-08 13:53:59 +00:00
Matthias Clasen
b1cf4d87c9 Add struct offsets to field and vfunc elements.
2005-05-22  Matthias Clasen  <mclasen@redhat.com>

	* tests/*: Add struct offsets to field and vfunc
	elements.

	* src/generate.c (write_vfunc_info): Write offset
	information for vfuncs.

	* src/gidlnode.c (g_idl_node_build_metadata): Write
	the struct offsets into the metadata.

	* src/gidlparser.c: Parse the offset attributes of
	field and vfunc elements.

	* src/gidlnode.h: Add offset members to field and
	vfunc nodes.
2024-02-08 13:53:59 +00:00
Matthias Clasen
1ae704b2b7 Basic type cleanup 2024-02-08 13:53:59 +00:00
Matthias Clasen
45405a6143 Add gdk-pixbuf.gidl as an example, and fix the code to handle it. 2024-02-08 13:53:59 +00:00
Matthias Clasen
45cf94a492 Add union.test.
2005-05-15  Matthias Clasen  <mclasen@redhat.com>

        * tests/roundtrips.sh (SIMPLE_TESTS): Add union.test.

        * tests/union.test: Add a union test.

        * src/generate.c: Handle unions.

        * src/girepository.h:
        * src/ginfo.c: Add GIUnionInfo and functions to access it.

        * src/gidlnode.c: Handle GIdlNodeUnion nodes.

        * src/gidlparser.c (start_union): Parse <union> elements.

        * src/gidlnode.h: Add a GIdlNodeUnion.

        * gidl.dtd: Add a <union> element.

        * src/gmetadata.c (g_metadata_check_sanity): Check
        union_blob_size.

        * src/gmetadata.h: Add union_blob_size to Header,
        add a UnionBlob.

        * metadata-format.txt: Add a UnionBlob.
2024-02-08 13:53:59 +00:00
Matthias Clasen
264b3adc76 Update testcases.
2005-05-13  Matthias Clasen  <mclasen@redhat.com>

	* tests/*: Update testcases.

	* src/generate.c (write_callable_info): Don't forget to
	write transfer and null-ok attributes for return types
	and parameters.

	* src/girepository.h:
	* src/ginfo.c (g_callable_info_may_return_null):
	New function to find out if a function may return NULL.
2024-02-08 13:53:59 +00:00
Johan Dahlin
02ef0d66f2 Generate consistent end tags.
* src/generate.c: Generate consistent end tags.

	* tests/*: Update
2024-02-08 13:53:59 +00:00
Matthias Clasen
b0fa1e8965 Some fixes 2024-02-08 13:53:58 +00:00
Matthias Clasen
bf4631bf28 Clean up handling of names. All elements have a "name", only the elements
2005-05-09  Matthias Clasen  <mclasen@redhat.com>

	* gidl.dtd: Clean up handling of names. All elements
	have a "name", only the elements corresponding to
	actual callable functions (function, method, constructor),
	have an additional "symbol" attribute holding the
	dlsym()-able function name.

	* src/generate.c: Adapt to generate xml matching the
	new dtd.

	* src/gidlparser.c:
	* src/gidlnode.c: Adapt to parse the new dtd.

	* tests/*.test: Adjust to the new dtd.

	* metadata-format.txt:
	* src/gmetadata.h: Remove the short_name field
	from the ValueBlob.
	* src/gmetadata.c: Shrink size of ValueBlob to 12.
	* src/girepository.h:
	* src/ginfo.c (g_value_info_get_short_name): Removed
2024-02-08 13:53:58 +00:00
Matthias Clasen
f1ad63b762 Import the GObject introspection prototype 2024-02-08 13:53:58 +00:00
Matthias Clasen
34f49b2ca9 Initial revision 2024-02-08 13:53:58 +00:00
Philip Withnall
343027d5de girepository: Make GIInfoType private
Eventually, we want to move to using `GType` directly for everything,
since `GIBaseInfo` and its subclasses are all using `GTypeInstance`.

However, that requires quite a lot of changes and we’re about to hit the
API freeze.

So do the smallest set of changes possible to remove `GIInfoType` and
related functions from the public API, which gives us freedom to make
more changes later without breaking API.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3155
2024-02-08 12:56:02 +00:00
Philip Withnall
86cd95f1ae Merge branch 'gi-info-new' into 'main'
gibaseinfo: Rename gi_info_new() to gi_base_info_new()

See merge request GNOME/glib!3903
2024-02-08 10:34:40 +00:00
Philip Withnall
beb59595b7 gibaseinfo: Rename gi_info_new() to gi_base_info_new()
It’s actually a factory method rather than a constructor, since
`GIBaseInfo` is abstract, but despite that, changing the name so it sits
inside the `GIBaseInfo` class makes sense. There is no `GIInfo` type.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3155
2024-02-08 10:34:40 +00:00
Philip Withnall
a7a6b93cf6 Merge branch 'th/meson-werror-fixes-2' into 'main'
[th/meson-werror-fixes-2] more workarounds for compiler warnings in meson compiler checks

See merge request GNOME/glib!3904
2024-02-08 10:28:01 +00:00