static bool listContactsHandler(LSHandle *sh, LSMessage *reply, void *ctx) { printf("Got reply: %s\n", LSMessageGetPayload(reply)); if (!LSMessageIsHubErrorMessage(reply)) hit_reply = TRUE; g_main_loop_quit((GMainLoop *) ctx); return TRUE; }
static void _PrintSubscriptionResultsList(GSList *sub_list) { for (; sub_list != NULL; sub_list = g_slist_next(sub_list)) { LSMessage *msg = sub_list->data; /* We may get error messages if the service goes down between the * time we find out about it and send the subscription info request */ if (!LSMessageIsHubErrorMessage(msg)) { const char *sub_text = LSMessageGetPayload(msg); const char *service = LSMessageGetSenderServiceName(msg); fprintf(stdout, "%s: %s\n", service, sub_text); } LSMessageUnref(msg); } fprintf(stdout, "\n"); }