Back to index

libindicator  12.10.0
Functions | Variables
service-version-multiwatch-service.c File Reference
#include <glib.h>
#include "libindicator/indicator-service.h"
#include "service-version-values.h"

Go to the source code of this file.

Functions

gboolean timeout (gpointer data)
void shutdown (void)
int main (int argc, char **argv)

Variables

static GMainLoop * mainloop = NULL
static gboolean passed = FALSE

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 50 of file service-version-multiwatch-service.c.

{
       g_type_init();
       g_debug("Service starting");

       IndicatorService * is = indicator_service_new_version("org.ayatana.version.good", SERVICE_VERSION_GOOD);
       g_signal_connect(G_OBJECT(is), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, shutdown, NULL);

       g_timeout_add_seconds(2, timeout, NULL);

       mainloop = g_main_loop_new(NULL, FALSE);
       g_main_loop_run(mainloop);

       g_debug("Quiting");
       if (passed) {
              g_debug("Passed");
              return 0;
       }
       g_debug("Failed");
       return 1;
}

Here is the call graph for this function:

void shutdown ( void  )

Definition at line 41 of file service-version-multiwatch-service.c.

{
       g_debug("Shutdown");
       passed = TRUE;
       g_main_loop_quit(mainloop);
       return;
}
gboolean timeout ( gpointer  data)

Definition at line 32 of file service-version-multiwatch-service.c.

{
       passed = FALSE;
       g_debug("Timeout with no shutdown.");
       g_main_loop_quit(mainloop);
       return FALSE;
}

Variable Documentation

GMainLoop* mainloop = NULL [static]

Definition at line 28 of file service-version-multiwatch-service.c.

gboolean passed = FALSE [static]

Definition at line 29 of file service-version-multiwatch-service.c.