/*-----------------------------------------------------------------------------------*/ LOADER_INIT_FUNC(ssfire_init, arg) { arg_free(arg); if(id == EK_ID_NONE) { id = ek_start(&p); } }
/*-----------------------------------------------------------------------------------*/ LOADER_INIT_FUNC(webserver_init, arg) { arg_free(arg); if(id == EK_ID_NONE) { id = ek_start(&p); } }
/*-----------------------------------------------------------------------------------*/ LOADER_INIT_FUNC(configedit_init, arg) { arg_free(arg); if(id == EK_ID_NONE) { id = ek_start(&p); } }
/*-----------------------------------------------------------------------------------*/ LOADER_INIT_FUNC(webserver_init, arg) { arg_free(arg); if(id == EK_ID_NONE) { id = ek_start(&p); } else { ctk_window_open(&mainwindow); } }
/*-----------------------------------------------------------------------------------*/ void #ifdef __APPLE2__ main(void) #else /* __APPLE2__ */ main(int argc, char *argv[]) #endif /* __APPLE2__ */ { #if STACK_SIZE memset((void *)(0xBF00 - STACK_SIZE), 0xA2, STACK_SIZE - (0xBF00 - *(unsigned int *)0x80) - 10); atexit(stack_size); #endif /* STACK_SIZE */ ek_init(); ek_start(&init); tcpip_init(NULL); resolv_init(NULL); ctk_init(); program_handler_init(); program_handler_add(&www_dsc, "Web browser", 1); program_handler_add(&email_dsc, "E-mail", 1); program_handler_add(&ftp_dsc, "FTP client", 1); program_handler_add(&directory_dsc, "Directory", 1); while(1) { if(ek_run() == 0) { #ifdef __APPLE2__ program_handler_load("welcome.prg", NULL); #else /* __APPLE2__ */ static char *startup; static char *slash; if(argc == 1) { startup = "welcome.prg"; } else { startup = argv[1]; while(slash = strchr(startup, '/')) { startup = slash + 1; } } program_handler_load(startup, NULL); #endif /* __APPLE2__ */ break; } } while(1) { ek_run(); } }
/*-----------------------------------------------------------------------------------*/ LOADER_INIT_FUNC(ctk_termserial_init, arg) { arg_free(arg); SIO_INIT; termstate = ctk_term_alloc_state(); if (termstate == NULL) return; if(id == EK_ID_NONE) { id = ek_start(&p); } }
/*-----------------------------------------------------------------------------------*/ LOADER_INIT_FUNC(about_init, arg) { arg_free(arg); if(id == EK_ID_NONE) { /* id = dispatcher_start(&p); */ id = ek_start(&p); } /* ctk_desktop_redraw(aboutdialog.desktop);*/ }
/*-----------------------------------------------------------------------------------*/ LOADER_INIT_FUNC(directory_init, arg) { arg_free(arg); if(id == EK_ID_NONE) { id = ek_start(&p); width = ctk_draw_width() - 2; height = ctk_draw_height() - 3; } }
/*---------------------------------------------------------------------------*/ ek_id_t ek_service_start(const char *name, struct ek_proc *p) { ek_id_t service; service = ek_find(name); if(service == EK_ID_NONE) { log_message("ek-service: starting ", name); return ek_start(p); } else { log_message("ek-service: replacing ", name); ek_post_synch(service, EK_EVENT_REQUEST_REPLACE, p); return service; } }