int trivia(void) { printf("creating web-server\n"); o=onion_new(O_ONE_LOOP); printf("obtaining root url\n"); onion_url *urls=onion_root_url(o); printf("adding css skeleton\n"); if(add_css_page(urls)) { printf("error: add_questions(): %s\n", strerror(errno)); exit(1); } printf("adding questions\n"); if(add_questions(urls)) { printf("error: add_questions(): %s\n", strerror(errno)); exit(1); } printf("adding landing page\n"); if(add_start_page(urls)) { printf("error: add_landing_page(): %s\n", strerror(errno)); exit(1); } printf("adding done page\n"); if(add_done_page(urls)) { printf("error: add_done_page(): %s\n", strerror(errno)); exit(1); } printf("adding reset page\n"); if(add_reset_page(urls)) { printf("error: add_landing_page(): %s\n", strerror(errno)); exit(1); } printf("adding signal handlers\n"); signal(SIGTERM, onexit); signal(SIGINT, onexit); printf("adding listening point\n"); onion_add_listen_point(o, NULL, "80", onion_http_new()); printf("listening\n"); onion_listen(o); printf("freeing\n"); onion_free(o); return 0; }
/*--------------------------------------------------------------------------*/ void gb_update_druid (void) { GdkPixbuf *logo; gb_debug (DEBUG_UPDATE, "START"); if ( update_window == NULL ) { remote_dir_handle = NULL; remote_file_handle = NULL; update_cancel_flag = FALSE; logo = gdk_pixbuf_new_from_file (ICON_PIXMAP, NULL); update_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW(update_window), DRUID_WIDTH, DRUID_HEIGHT); update_druid = gnome_druid_new(); gtk_container_add( GTK_CONTAINER(update_window), update_druid ); add_start_page( GNOME_DRUID(update_druid), logo ); add_select_download_page( GNOME_DRUID(update_druid), logo ); add_downloading_page( GNOME_DRUID(update_druid), logo ); add_finish_page( GNOME_DRUID(update_druid), logo ); g_signal_connect( G_OBJECT(update_druid), "cancel", G_CALLBACK(cancel_cb), NULL ); g_signal_connect( G_OBJECT(update_window), "destroy", G_CALLBACK(destroy_cb), NULL ); gtk_widget_show_all( update_window ); } gb_debug (DEBUG_UPDATE, "END"); }