diff -r 000000000000 -r 39d46bc373eb gmyth-upnp/test/main.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-upnp/test/main.c Wed Feb 20 20:30:13 2008 +0000 @@ -0,0 +1,49 @@ +#include + +#include "gmyth_upnp.h" + +static void +_device_found_cb (GMythUPnP *upnp, + GMythBackendInfo *info, + gpointer data) +{ + g_debug ("BACKEND FOUND: %s", info->hostname); +} + +static void +_device_lost_cb (GMythUPnP *upnp, + GMythBackendInfo *info, + gpointer data) +{ + g_debug ("BACKEND LOST: %s", info->hostname); +} + + + +int main (int argc, char** argv) +{ + GMythUPnP *o; + GMainLoop *loop; + + g_type_init (); + g_thread_init (NULL); + + o = gmyth_upnp_get_instance (); + g_signal_connect (o, + "device-found", + G_CALLBACK (_device_found_cb), + NULL); + g_signal_connect (o, + "device-lost", + G_CALLBACK (_device_lost_cb), + NULL); + + + gmyth_upnp_search (o); + + loop = g_main_loop_new (NULL, FALSE); + g_main_loop_run (loop); + g_object_unref (o); + + return 0; +}