Back to index

dbus-test-runner  12.10.0
Functions
test-own-name.c File Reference
#include <glib.h>
#include <gio/gio.h>

Go to the source code of this file.

Functions

void name_aquired (GDBusConnection *connection, const gchar *name, gpointer user_data)
gboolean end_of_line (gpointer user_data)
int main (int argc, char *argv[])

Function Documentation

gboolean end_of_line ( gpointer  user_data)

Definition at line 12 of file test-own-name.c.

{
       g_main_loop_quit((GMainLoop *)user_data);
       return FALSE;
}

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 19 of file test-own-name.c.

{
       g_type_init();

       if (argc != 2) {
              g_error("ARG, need a single argument");
              return 1;
       }

       g_debug("Trying for name: %s", argv[1]);

       g_bus_own_name(G_BUS_TYPE_SESSION,
                      argv[1],
                      G_BUS_NAME_OWNER_FLAGS_NONE,
                      NULL, /* bus aquired */
                      name_aquired,
                      NULL, /* lost */
                      NULL, /* data */
                      NULL); /* destroy */

       GMainLoop * mainloop = g_main_loop_new(NULL, FALSE);

       g_timeout_add_seconds(2, end_of_line, mainloop);

       g_main_loop_run(mainloop);
       g_main_loop_unref(mainloop);

       g_debug("Quitting");

       return 0;
}

Here is the call graph for this function:

void name_aquired ( GDBusConnection *  connection,
const gchar *  name,
gpointer  user_data 
)

Definition at line 5 of file test-own-name.c.

{
       g_debug("Got name: %s", name);
       return;
}

Here is the caller graph for this function: