summaryrefslogtreecommitdiff
path: root/tools/compiler.c
Commit message (Collapse)AuthorAgeFilesLines
* g-ir-{compiler,generate,inspect}: Call setlocale in main functionTing-Wei Lan2017-05-051-0/+3
| | | | | | It is required to correctly show translated messages on some locales. https://bugzilla.gnome.org/show_bug.cgi?id=760419
* g-ir-compiler: Allow multiple --shared-libraryGarrett Regier2015-09-291-4/+4
| | | | | https://bugzilla.gnome.org/show_bug.cgi?id=744535 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* g-ir-compiler: message when arguments are wrongBen Boeckel2015-08-041-0/+9
| | | | | | | | Otherwise the error is "no input files" which is very confusing. https://bugzilla.gnome.org/show_bug.cgi?id=753160 Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
* g-ir-compiler: remove references to --code, remove --no-init optionsDieter Verfaillie2013-10-081-2/+0
| | | | | | | | | The "--code" option was removed years ago in ac81f3e8c5f1c380d16677232d67466e739da283 so remove references to it from README and g-ir-compiler(1) Remove the "--no-init" option from g-ir-compiler and g-ir-compiler(1) as it was documented to "can only be used if --code is also specified", so no reason to keep it around.
* Drop calls to g_type_init()Colin Walters2012-10-161-2/+0
| | | | And bump our GLib requirement.
* Add Emacs mode lines to C sourcesColin Walters2012-02-031-1/+2
|
* Fix error handling when writing out typelibOwen W. Taylor2010-12-221-8/+14
| | | | | | Return a non-zero result when opening the output file fails and don't use g_error() for other failures when writing out the file, since such errors should not produce a core dump.
* girepository: Consistently prefix internal functions with _Colin Walters2010-11-161-5/+5
| | | | | This should better avoid them being exported. Rename girepository-parser.la to girepository-internals.la for clarity.
* [GIRepository] Rename GTypelib to GITypelibJohan Dahlin2010-08-311-2/+2
| | | | | Keep a typedef for backwards compatibility, until the major bindings has moved over.
* [gircompiler] Clean up parsingColin Walters2010-08-171-40/+10
| | | | | | | | | | | | | | We never actually include multiple modules in the compiler, so just nuke that. Also rather than passing around GIrModule consistently pass around a GIrTypelibBuild structure which has various things. This lets us maintain a stack there which we can walk for better error messages. Also, fix up the node lookup in giroffsets.c; previously it didn't really handle includes correctly. We really need to switch to always using Foo.Bar (i.e. GIName) names internally...
* compiler: Remove --code argumentColin Walters2010-08-171-67/+6
| | | | | | It can't really work right now because we rely on dumping data at runtime, which requires the library. If in the future we support static scanning, we can reinvestigate embedded typelibs.
* [girepository] Actually verify header of loaded typelibs in ↵Colin Walters2010-07-141-1/+3
| | | | | | | | g_irepository_require Take a GError * for typelib loading code, validate the header. This fixes bizarre errors from gjs where g_irepository_require would happily load old typelibs.
* [gtypelib.ch] Rename to gitypelib.chJohan Dahlin2010-05-311-1/+1
| | | | | Rename gtypelib.h -> gitypelib-internal.h and rename gtypelib.c to gitypelib.c
* Bug 585584: Fix warnings in girparser backtrace functionality and compiler.cC. Scott Ananian2009-06-121-0/+2
|
* Bug 577534 - Use rename to write new typelibs, instead of in-place overwriteColin Walters2009-06-091-11/+27
| | | | | This avoids having processes with the typelibs currently open exploding immediately.
* Handle the return value to fwrite properlyJohan Dahlin2009-02-211-1/+9
|
* Misc warning fixesDan Winship2009-01-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | * giscanner/scannerparser.y: Fix the "Ignoring non-UTF-8 constant string" error to print the right value. * tests/scanner/annotation.c (backslash_parsing_tester) (backslash_parsing_tester_2): make these non-static to avoid a warning. (annotation_object_string_out) (annotation_string_zero_terminated): fix return values * tests/scanner/annotation.h (annotation_object_with_voidp): prototype this * tests/scanner/gtkfrob.c: * tests/scanner/gtkfrob.h (gtk_frob_language_manager_get_default): fix prototype. (s/()/(void)/). * tools/compiler.c (format_output): fix signed/unsigned warning. Output a prototype for register_typelib() to avoid warnings later. svn path=/trunk/; revision=1071
* Add a GirParser object to hold the state of a compilationOwen Taylor2008-11-121-1/+11
| | | | | | | | Add a toplevel GirParser object to hold state that is global across a compilation. Currently just holds the include path, but will eventually also keep a cached list of parsed modules. svn path=/trunk/; revision=901
* Bug 556543 – reduce compiler warningsTommi Komulainen2008-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-10-16 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556543 – reduce compiler warnings * girepository/ginfo.c: * girepository/girepository.c (register_internal, count_interfaces, find_interface, find_namespace_version, parse_version, g_irepository_require): * girepository/girmodule.c (g_ir_module_build_typelib): * girepository/girnode.c (init_stats, dump_stats, _g_irnode_init_stats, _g_irnode_dump_stats, g_ir_node_can_have_member): * girepository/girparser.c (firstpass_end_element_handler, locate_gir, parse_basic, parse_type_internal, resolve_aliases, start_alias, start_type, end_type_top, parse_include, cleanup, post_filter): * girepository/gtypelib.c (validate_function_blob, validate_enum_blob): * giscanner/giscannermodule.c (directive_get_options, type_get_child_list): * giscanner/scannerlexer.l (parse_gtkdoc): * giscanner/scannerparser.y (ctype_free): * giscanner/sourcescanner.c: * giscanner/sourcescanner.h (gi_source_scanner_parse_macros): * tests/types/gitesttypes.c: * tools/compiler.c (main): * tools/generate.c (write_repository): Remove unused variables and code, add missing includes, declarations and case statements. svn path=/trunk/; revision=730
* Remove g_irepository_unregister, add GIRepositoryLoadFlagsColin Walters2008-08-301-9/+1
| | | | svn path=/trunk/; revision=543
* Put dependencies in typelibs, resolve them when loadingColin Walters2008-08-301-1/+8
| | | | | | | | | | | | | | | | | | | * 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
* Fix --includedir handlingColin Walters2008-08-281-2/+3
| | | | | | | | | | | * tests/scanner/Makefile.am: Pass the right --includedir args. Add a Makefile dep. * tools/compiler.c: Pass includedirs down. * girepository/girparser.c: Actually put includedirs in context, pass down. Fix locate_gir. svn path=/trunk/; revision=514
* Expand aliases when generating typelibsColin Walters2008-08-281-0/+2
| | | | | | | | | | | * gir/Makefile.am: Use --includedir * girepository/girparser.c: Recursively parse includes to pull in aliases and expand them. We need this to avoid putting unknown names in the typelibs. * tools/compiler.c: Add --includedir option. svn path=/trunk/; revision=512
* Use binary mode for output file on Windows.Tor Lillqvist2008-08-281-2/+12
| | | | | | | | | | | | | | | | | | | 2008-08-28 Tor Lillqvist <tml@novell.com> * tools/compiler.c (write_out_typelib): Use binary mode for output file on Windows. * girepository/girnode.c: Don't print NULL strings. * tests/invoke/Makefile.am * tests/scanner/Makefile.am: Use -no-undefined on Windows to convince libtool to build shared libraries. * tests/invoke/invoke.c: Don't needlessly include <dlfcn.h>. Use g_assert() instead of printing out expected errors. svn path=/trunk/; revision=509
* Default to --raw. Update.Colin Walters2008-08-221-4/+3
| | | | | | | | | | 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
* Rename metadata to typelib in variable names, comments and apis.Johan Dahlin2008-08-091-26/+26
| | | | | | | | | | | 2008-08-09 Johan Dahlin <johan@gnome.org> * *.[ch]: Rename metadata to typelib in variable names, comments and apis. svn path=/trunk/; revision=339
* Merge in the gir-compiler branch. Thanks to Philip and Colin for theirJohan Dahlin2008-08-081-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* tools/gidlnode.cPhilip Van Hoof2008-06-081-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert revisions 157,149-148,136-129 and 120. Move back to usingJohan Dahlin2008-04-221-94/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove most global variablesJohan Dahlin2008-03-111-22/+27
| | | | | | | | | | | 2008-03-11 Johan Dahlin <johan@gnome.org> * tools/compiler.c: * tools/generate.c: Remove most global variables svn path=/trunk/; revision=153
* Remove unused importsJohan Dahlin2008-03-111-2/+0
| | | | svn path=/trunk/; revision=152
* Coding style fixesJohan Dahlin2008-03-111-7/+7
| | | | | | | | | 2008-03-11 Johan Dahlin <johan@gnome.org> * tools/compiler.c (main): Coding style fixes svn path=/trunk/; revision=144
* tools/quote-file.sh tools/compiler.c tools/generate.cMark Doffman2008-03-101-115/+65
| | | | | | | | | | | | | | 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
* Added: Added: Renamed to tools/Makefile.am: Renamed to tools/compiler.c:Rob Taylor2008-02-081-0/+257
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