Man Linux: Main Page and Category List


       g-ir-scanner - extracting C metadata from sources and headers


       g-ir-scanner [OPTION...] FILES...


       g-ir-scanner is a tool which generates GIR XML files by parsing headers
       and introspecting GObject  based  libraries.   It  is  usually  invoked
       during the normal build step for a project and the information is saved
       to disk and later  installed,  so  that  language  bindings  and  other
       applications  can  use it.  Header files and source files are passed in
       as arguments on the command line.  The suffix determines whether a file
       be  treated as a source file (.c) or a header file (.h). Currently only
       C based libraries are supported by the scanner.


       --help Show help options

              If passed, do not print details of normal operation.

              Display warnings for public API which is not introspectable.

              Make warnings be fatal errors.

              This parameters decides which the resulting format will be used.
              The default value is gir.

              Parses  another  metadata  file.  The  format  is  determined by
              looking at the file suffix. If a library depends on another  the
              corresponding  metadata file should be included so references to
              external types are correctly specified.

              Add a directory to the path which the scanner uses to  find  GIR
              files.    Can   be  used  multiple  times  to  specify  multiple

       -i, --library=LIBRARY
              Specifies a library that will be introspected. This  means  that
              the *_get_type() functions in it will be called for GObject data
              types.  The name of the library should not contain  the  leading
              lib prefix nor the ending shared library suffix.

       -L, --library-path=PATH
              Include  this  directory  when  searching  for  a library.  This
              option can be specified multiple times to include more than  one
              directory to look for libraries in.

              Include this directory in the list of directories to be searched
              for header files.  You need to  pass  to  the  scanner  all  the
              directories  you'd  normally pass to the compiler when using the
              specified source files.

       -n, --namespace=NAME
              The namespace name. This name  should  be  capitalized,  eg  the
              first  letter  should  be  upper  case.  Examples: Gtk, Clutter,

              Disable  usage  of  libtool  for  compiling  stub  introspection
              binary.  Use this if your build system does not require libtool.

              Full path to libtool executable.  Typically  used  for  Automake

              The  namespace  version.  For  instance 1.0. This is usually the
              platform version, eg 2.0 for Gtk+, not 2.12.7.

       -p, --program=PROGRAM
              Specifies a binary that will be introspected.  This  means  that
              the *_get_type() functions in it will be called for GObject data
              types.  The binary must be  modified  to  take  a  --introspect=
              option,   and   to   pass  the  argument  to  this  function  to

              Additional argument to pass to program for introspection.

              If this option is specified a prefix will be stripped  from  all
              functions.   If  not  specified,  the  lower case version of the
              namespace will be  used.   Eg,  a  strip  prefix  of  g_  and  a
              namespace  set  to  GLib will export the function g_type_name as

              Name  of  the  file  to  output.  Normally  namespace  +  format
              extension.  Eg, GLib.gir.

              List  of  pkg-config  packages  to get compiler and linker flags
              from.  This option can be specified multiple  times  to  include
              flags from several pkg-config packages.

              Be verbose, include some debugging information.

              Do not delete unknown types from the resulting format.

              Convert  the  resulting xml to only output the types relevant to
              the typelib compiler. This is mainly useful  for  verifying  the
              correctness of the typelib itself.

              Injects  a  variant of a GIR file into the scanner. This is used
              to add custom functions to a  GIR  wrapping  a  library  without
              modifying  the upstream library itself. The Format of the inject
              file is similar to a GIR, but  the  root  node  is  <injections>
              rather than <repository> and <inject path="..."> where ... is an
              xpath expression.


                <inject path="namespace/class[@name='TestDrawable']">
                  <method                                     name="get_width"
                    <return-value transfer-ownership="none">
                      <type name="int" c:type="gint"/>

              The  example  above will add a new method called get_with to the
              TestDrawable class.

              Loads a list xpath assertions from FILENAME, this is useful  for
              verifying that the GIR itself is properly generated.

       BUGS   Report  bugs  at in the glib product
              and introspection component.



       Johan Dahlin