|
NAMEdbus-binding-tool - C language dbus-glib bindings generation utility.SYNOPSISdbus-binding-tool [--force] [--help] [--ignore-unsupported] [--mode=pretty|glib-client|glib-server] [--output=file] [--prefix=symbol-prefix] [--version] [file...]DESCRIPTIONdbus-binding-tool is used to expose a GObject via D-Bus, using the deprecated dbus-glib binding for GLib. As input, dbus-binding-tool uses a D-Bus Introspection XML file. As output, the client-side or server-side bindings is generated. This output is a header file which eases the use of a remote D-Bus object. Output is sent to standard out or to the filename specified with the --output argument.EXTENDED DESCRIPTIONThe following is a sample D-Bus Introspection XML file which describes an object that exposes one method, named ManyArgs:<?xml version="1.0" encoding="UTF-8" ?> <node name="/com/example/MyObject"> <interface name="com.example.MyObject"> <method name="ManyArgs"> <arg type="u" name="x" direction="in" /> <arg type="s" name="str" direction="in" /> <arg type="d" name="trouble" direction="in" /> <arg type="d" name="d_ret" direction="out" /> <arg type="s" name="str_ret" direction="out" /> </method> </interface> </node> dbus-binding-tool supports annotations in the XML format to further control how the bindings are generated. client-side bindingsWhen building client-side bindings, the --mode=glib-client argument is used. The client-side bindings support the "org.freedesktop.DBus.Glib.NoReply" annotation. This is specified within the <method> tag to indicate that the client is not expecting a reply to the method call, so a reply should not be sent. This is often used to speed up rapid method calls where there are no "out" arguments, and not knowing if the method succeeded is an acceptable compromise to halve the traffic on the bus. For example:<method name "FooMethod"> [...] <annotation name="org.freedesktop.DBus.GLib.NoReply" value="yes"/> [...] </method> server-side bindingsWhen building server-side bindings, the --mode=glib-server argument is used. Also the --prefix argument must be used when building server-side bindings so that functions in the generated output are prefexed with the specified value. The server-side bindings support the following annotations:"org.freedesktop.DBus.GLib.CSymbol" This annotation is used to specify the C symbol names for the various types (interface, method, etc.), if it differs from the name D-Bus generates. <interface name="com.example.MyObject"> <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="my_object"/> [...] <method name "ManyArgs"> <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="my_object_many_args"/> [...] </method> </interface> "org.freedesktop.DBus.GLib.Async" This annotation marks the method implementation as an asynchronous function, which does not return a response straight away but will send the response at some later point to complete the call. This is used to implement non-blocking services where method calls can take time. When a method is asynchronous, the function prototype is different. It is required that the function conform to the following rules:
For example: <method name "FooMethod"> [...] <annotation name="org.freedesktop.DBus.GLib.Async" value="yes"/> [...] </method> "org.freedesktop.DBus.GLib.Const" This attribute can only be applied to "out" <arg> nodes, and specifies that the parameter is not being copied when returned. For example, this turns a 's' argument from a (char **) to a (const char **), and results in the argument not being freed by D-Bus after the message is sent. For example: <arg type="u" name="x" direction="out"> <annotation name="org.freedesktop.DBus.GLib.Const" value=""/> </arg> "org.freedesktop.DBus.GLib.ReturnVal" This attribute can only be applied to "out" <arg> nodes, and alters the expected function signature. It currently can be set to two values: "" or "error". The argument marked with this attribute is not returned via a pointer argument, but by the function's return value. If the attribute's value is the empty string, the (GError *) argument is also omitted so there is no standard way to return an error value. This is very useful for interfacing with existing code, as it is possible to match existing APIs. If the attribute's value is "error", then the final argument is a (GError *) as usual. For example: <arg type="u" name="x" direction="out"> <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/> </arg> OPTIONSThe following options are supported:--force
--help
--ignore-unsupported
--mode=pretty|glib-client|glib-server
--output=file
--prefix=symbol-prefix
--version
OPERANDSThe following operands are supported:file
FILESThe following files are used by this application:${exec_prefix}/bin/dbus-binding-tool
SEE ALSOgdbus-codegen(1), dbus-cleanup-sockets(1), dbus-daemon(1), dbus-monitor(1), dbus-send(1), dbus-uuidgen(1)NOTESdbus-binding-tool is part of dbus-glib, which is a deprecated D-Bus binding for GLib.dbus-glib receives minimal maintenance and security fixes for the benefit of projects like Telepathy and NetworkManager that still rely on it, but should not be used in new projects (and existing projects should try to move away from it, too). Please use GDBus, part of GLib since 2.26. gdbus-codegen(1) is the GDBus replacement for dbus-binding-tool. AUTHORSMan page written by Brian Cameron, Sun Microsystems Inc., 2009.
Visit the GSP FreeBSD Man Page Interface. |