/* Program main function. */ int main (int argc, char **argv) { /* Initialize GTK and other libraries. */ g_thread_init (NULL); gdk_threads_init (); gtk_init (&argc, &argv); /* Initialize the application. */ g_set_application_name ("GTK Feed Reader"); gtk_window_set_default_icon_name ("gtk-feed"); load_feeds (); get_status_icon (); /* Run the main loop. */ gtk_main (); save_feeds (); return 0; }
int main(int argc, char **argv) { jobs = new RSS_Job[0]; ijobs = 0; // Initialise the video system VIDEO_Init(); //Get Language lang = CONF_GetLanguage(); // This function initialises the attached controllers WPAD_Init(); // Obtain the preferred video mode from the system // This will correspond to the settings in the Wii menu rmode = VIDEO_GetPreferredMode(NULL); // Allocate memory for the display in the uncached region xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); // Initialise the console, required for printf console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); // Set up the video registers with the chosen mode VIDEO_Configure(rmode); // Tell the video hardware where our display memory is VIDEO_SetNextFramebuffer(xfb); // Make the display visible VIDEO_SetBlack(FALSE); // Flush the video register changes to the hardware VIDEO_Flush(); // Wait for Video setup to complete VIDEO_WaitVSync(); if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); printf("\x1b[2;0H"); if (LANG_GER) printf("Willkommen bei rssmii!\n\n"); else printf("Welcome to rssmii!\n\n"); int retval = load_feeds(); if (retval != 0) { fail(retval); } if(LANG_GER) printf("Die folgenden RSS-Feeds wurden von der SD-Karte gelesen und werden abonniert und alle vorherigen Abonnements werden geloescht:\n"); else printf("The following RSS-Feeds were read from the SD-Card and you will subscribe to them while all previous subscriptions will be deleted:\n"); for (int i = 0; i < ijobs; i++) { printf(" %s\n", jobs[i].name); } if (LANG_GER) printf("\n\nSind sie sicher? (A: Fortsetzen; HOME: Abbrechen)"); else printf("\n\nAre you sure? (A: Continue; HOME: Abort"); while (1) { WPAD_ScanPads(); if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) end(); if (WPAD_ButtonsDown(0) & WPAD_BUTTON_A) break; } AddJobs(); //printf("\n\nDone."); if (LANG_GER) printf("\nMit HOME zurueck zum Loader."); else printf("\nGet back to the Loader with the HOME-Button."); while (1) { WPAD_ScanPads(); if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) break; } end(); //return 0; }