static int process_cmdline(int argc, char **argv) { int result = -1; GOptionContext *ctx; GError *err = NULL; int rc; ctx = g_option_context_new("- GMediaRender"); g_option_context_add_main_entries(ctx, option_entries, NULL); rc = output_add_options(ctx); if (rc != 0) { fprintf(stderr, "Failed to add output options\n"); goto out; } if (!g_option_context_parse (ctx, &argc, &argv, &err)) { g_print ("Failed to initialize: %s\n", err->message); g_error_free (err); goto out; } result = 0; out: return result; }
static gboolean process_cmdline(int argc, char **argv) { GOptionContext *ctx; GError *err = NULL; int rc; ctx = g_option_context_new("- GMediaRender"); g_option_context_add_main_entries(ctx, option_entries, NULL); rc = output_add_options(ctx); if (rc != 0) { fprintf(stderr, "Failed to add output options\n"); return FALSE; } if (!g_option_context_parse (ctx, &argc, &argv, &err)) { fprintf(stderr, "Failed to initialize: %s\n", err->message); g_error_free (err); return FALSE; } return TRUE; }