OS Manuals

/usr/bin/gdbus-codegen

glib dev

From glib-dev 2.90.1-r2 (os), captured 2026-11-05 by running gdbus-codegen --help (exit 0). permalink

usage: gdbus-codegen [-h] [--interface-prefix PREFIX] [--c-namespace NAMESPACE]
                     [--c-generate-object-manager] [--c-generate-autocleanup {none,objects,all}]
                     [--generate-docbook OUTFILES] [--generate-md OUTFILES]
                     [--generate-rst OUTFILES] [--pragma-once]
                     [--annotate WHAT KEY VALUE WHAT KEY VALUE WHAT KEY VALUE]
                     [--glib-min-required VERSION] [--glib-max-allowed VERSION]
                     [--symbol-decorator SYMBOL_DECORATOR]
                     [--symbol-decorator-header SYMBOL_DECORATOR_HEADER]
                     [--symbol-decorator-define SYMBOL_DECORATOR_DEFINE]
                     [--extension-path EXTENSION_PATH] [--generate-c-code OUTFILES | --header |
                     --body | --interface-info-header | --interface-info-body] [--output FILE |
                     --output-directory OUTDIR]
                     FILE [FILE ...]

D-Bus code and documentation generator

positional arguments:
  FILE                  D-Bus introspection XML file

options:
  -h, --help            show this help message and exit
  --interface-prefix PREFIX
                        String to strip from D-Bus interface names for code and docs
  --c-namespace NAMESPACE
                        The namespace to use for generated C code
  --c-generate-object-manager
                        Generate a GDBusObjectManagerClient subclass when generating C code
  --c-generate-autocleanup {none,objects,all}
                        Generate autocleanup support
  --generate-docbook OUTFILES
                        Generate Docbook in OUTFILES-org.Project.IFace.xml
  --generate-md OUTFILES
                        Generate Markdown in OUTFILES-org.Project.IFace.md
  --generate-rst OUTFILES
                        Generate reStructuredText in OUTFILES-org.Project.IFace.rst
  --pragma-once         Use "pragma once" as the inclusion guard
  --annotate WHAT KEY VALUE WHAT KEY VALUE WHAT KEY VALUE
                        Add annotation (may be used several times)
  --glib-min-required VERSION
                        Minimum version of GLib to be supported by the outputted code (default:
                        2.30)
  --glib-max-allowed VERSION
                        Maximum version of GLib to be used by the outputted code (default: current
                        GLib version)
  --symbol-decorator SYMBOL_DECORATOR
                        Macro used to decorate a symbol in the outputted header, possibly to
                        export symbols
  --symbol-decorator-header SYMBOL_DECORATOR_HEADER
                        Additional header required for decorator specified by --symbol-decorator
  --symbol-decorator-define SYMBOL_DECORATOR_DEFINE
                        Additional define required for decorator specified by --symbol-decorator
  --extension-path EXTENSION_PATH
                        Path to a gdbus-codegen Python extension file (unstable API)
  --generate-c-code OUTFILES
                        Generate C code in OUTFILES.[ch]
  --header              Generate C headers
  --body                Generate C code
  --interface-info-header
                        Generate GDBusInterfaceInfo C header
  --interface-info-body
                        Generate GDBusInterfaceInfo C code
  --output FILE         Write output into the specified file
  --output-directory OUTDIR
                        Location to output generated files
Options (24)
OptionDescriptionSource
-h, --helpshow this help message and exithelp + man
--interface-prefix PREFIXA prefix to strip from all D-Bus interface names when calculating the type name for the C binding and the DocBook sortas attribute <https://tdg.docbook.org/tdg/4.5/primary.html>.help + man
--c-namespace NAMESPACEThe namespace to use for generated C code.help + man
--c-generate-object-managerIf this option is passed, suitable GDBusObject, GDBusObjectProxy, GDBusObjectSkeleton and GDBusObjectManagerClient subclasses are generated.help + man
--c-generate-autocleanup noneThis option influences what types autocleanup functions are generated for.help + man
--generate-docbook OUTFILESGenerate DocBook Documentation for each D-Bus interface and put it in OUTFILES-NAME.xml where NAME is a placeholder for the interface name, e.g. net.Corp.FooBar and so on.help + man
--generate-md OUTFILESGenerate Markdown Documentation for each D-Bus interface and put it in OUTFILES-NAME.md where NAME is a placeholder for the interface name, e.g. net.Corp.FooBar and so on.help + man
--generate-rst OUTFILESGenerate reStructuredText Documentation for each D-Bus interface and put it in OUTFILES-NAME.rst where NAME is a placeholder for the interface name, e.g. net.Corp.FooBar and so on.help + man
--pragma-onceIf this option is passed, the #pragma once <https://en.wikipedia.org/wiki/Pragma_once> preprocessor directive is used instead of include guards.help + man
--glib-min-required VERSIONSpecifies the minimum version of GLib which the code generated by gdbus-codegen can depend on.help + man
--glib-max-allowed VERSIONSpecifies the maximum version of GLib which the code generated by gdbus-codegen can depend on.help + man
--symbol-decorator SYMBOL_DECORATORIf a DECORATOR is passed in with this option, all the generated function prototypes in the generated header will be marked with DECORATOR.help + man
--symbol-decorator-header SYMBOL_DECORATOR_HEADERIf a HEADER is passed in with this option, the generated header will put a #include HEADER before the rest of the items, except for the inclusion guards or #pragma once (if --pragma-once is used).help + man
--symbol-decorator-define SYMBOL_DECORATOR_DEFINEIf a DEFINE is passed in with this option, the generated source will add a #define DEFINE before the rest of the items.help + man
--extension-path EXTENSION_PATHPath to a gdbus-codegen Python extension file (unstable API)help + man
--generate-c-code OUTFILESGenerate C code for all D-Bus interfaces and put it in OUTFILES.c and OUTFILES.h including any sub-directories.help + man
--headerIf this option is passed, it will generate the header code and write it to the disk by using the path and file name provided by --output.help + man
--bodyIf this option is passed, it will generate the source code and write it to the disk by using the path and file name provided by --output.help + man
--interface-info-headerIf this option is passed, it will generate the header code for the GDBusInterfaceInfo structures only and will write it to the disk by using the path and file name provided by --output.help + man
--interface-info-bodyIf this option is passed, it will generate the source code for the GDBusInterfaceInfo structures only and will write it to the disk by using the path and file name provided by --output.help + man
--output FILEThe full path where the header (--header, --interface-info-header) or the source code (--body, --interface-info-body) will be written, using the path and filename provided by --output.help + man
--output-directory OUTDIRDirectory to output generated source to.help + man
--xml-files FILEThis option is deprecated; (in the manual page but not in --help)man
--annotate ELEMENTUsed to inject D-Bus annotations into the given XML files. (in the manual page but not in --help)man
Examples (5) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.