/* read and parse the http request */ static int setup(struct cgi_state *cgi) { int ret; if (getenv("GATEWAY_INTERFACE")) { ret = setup_cgi(cgi); } else { ret = setup_standalone(cgi); } while (*cgi->pathinfo && *cgi->pathinfo == '/') cgi->pathinfo++; return ret; }
int main (int argc, char *argv[]) { GOptionContext *context; GError *error = NULL; setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); context = g_option_context_new ("- dawati status panel"); g_option_context_add_main_entries (context, status_options, GETTEXT_PACKAGE); g_option_context_add_group (context, clutter_get_option_group_without_init ()); g_option_context_add_group (context, cogl_get_option_group ()); g_option_context_add_group (context, gtk_get_option_group (FALSE)); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_critical (G_STRLOC ": Error parsing option: %s", error->message); g_clear_error (&error); } g_option_context_free (context); mpl_panel_clutter_init_with_gtk (&argc, &argv); mx_style_load_from_file (mx_style_get_default (), THEMEDIR "/panel.css", &error); if (error) { g_critical ("Unable to load style: %s", error->message); g_clear_error (&error); } panel = g_new0 (DawatiStatusPanel, 1); if (status_standalone) setup_standalone (panel); else setup_panel (panel); clutter_main (); return EXIT_SUCCESS; }