int main() { network_init(); float_run_tests(); network_shutdown(); }
int main(int argc, char* argv[]) { configfile_init(); if( configfile_parsecmdoverride(argc, argv) < 0 ) return -1; log_open(); // read config file if( configfile_load_config("ascent-voicechat.conf") < 0 ) { // this needs to be cmd-line overrideable log_write(ERROR, "FATAL: Could not open a valid config file. Exiting."); return -1; } printf("Ascent Voicechat Server\n"); printf("Starting...\n"); if( network_init() < 0 ) { log_write(ERROR, "FATAL: Network failed initialization."); return -1; } printf("Binding sockets...\n"); if( voicechat_init_clientsocket() < 0 || voicechat_init_serversocket() < 0 ) { log_write(ERROR, "FATAL: Could not bind sockets."); return -1; } signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); #ifdef WIN32 signal(SIGBREAK, signal_handler); #endif printf("I/O Loop running...\n"); start_thread(status_updater_thread, NULL); while(running) { network_io_poll(); } printf("Shutting down...\n"); network_shutdown(); log_close(); return 0; }
void machine_shutdown(void) { file_system_detach_disk_shutdown(); machine_specific_shutdown(); autostart_shutdown(); #ifdef HAS_JOYSTICK joystick_close(); #endif sound_close(); printer_shutdown(); gfxoutput_shutdown(); fliplist_shutdown(); file_system_shutdown(); fsdevice_shutdown(); tape_shutdown(); traps_shutdown(); kbdbuf_shutdown(); keyboard_shutdown(); monitor_shutdown(); console_close_all(); cmdline_shutdown(); resources_shutdown(); drive_shutdown(); machine_maincpu_shutdown(); video_shutdown(); ui_shutdown(); sysfile_shutdown(); log_close_all(); event_shutdown(); network_shutdown(); autostart_resources_shutdown(); fsdevice_resources_shutdown(); disk_image_resources_shutdown(); machine_resources_shutdown(); sysfile_resources_shutdown(); zfile_shutdown(); ui_resources_shutdown(); log_resources_shutdown(); fliplist_resources_shutdown(); romset_resources_shutdown(); #ifdef HAVE_NETWORK monitor_network_resources_shutdown(); #endif archdep_shutdown(); lib_debug_check(); }
int main (int argc,char *argv[]) { int opt; int ijob = -1; int action = ACTION_NONE; struct job job; int nRet = 0; if(network_initialize() != 0) { fprintf (stderr,"Could not initialize the network: %s\n", drerrno_str()); nRet = 1; goto cleanup; } while ((opt = getopt (argc,argv,"sdcktj:vh")) != -1) { switch (opt) { case 's': action = ACTION_STOP; break; case 'd': action = ACTION_DEL; break; case 'c': action = ACTION_CONT; break; case 'k': action = ACTION_HSTOP; break; case 't': action = ACTION_STATUS; break; case 'j': ijob = atoi (optarg); break; case 'v': show_version (argv); goto cleanup; case '?': case 'h': usage(); nRet = 1; goto cleanup; } } if ((ijob == -1) || (action == ACTION_NONE)) { usage (); nRet = 1; goto cleanup; } set_default_env(); if (!common_environment_check()) { fprintf (stderr,"Error checking the environment: %s\n",drerrno_str()); nRet = 1; goto cleanup; } switch (action) { case ACTION_STOP: printf ("Stopping job: %i\n",ijob); request_job_stop((uint32_t)ijob,CLIENT); break; case ACTION_HSTOP: printf ("Hard stopping job: %i\n",ijob); request_job_hstop((uint32_t)ijob,CLIENT); break; case ACTION_DEL: printf ("Deleting job: %i\n",ijob); request_job_delete((uint32_t)ijob,CLIENT); break; case ACTION_CONT: printf ("Continue job: %i\n",ijob); request_job_continue((uint32_t)ijob,CLIENT); break; case ACTION_STATUS: request_job_xfer((uint32_t)ijob,&job,CLIENT); printf ("%s\n",job_status_string(job.status)); break; } cleanup: network_shutdown(); return nRet; }