/* ss-core/main.c * * Entry point for the SmartShelf core program. * * Copyright (C) 2003, 2004 * Andy Goth * * This code is available under the GNU General Public License; see COPYING. */ #include #include #include #include #include #include #include #include "evlist/evlist.h" #include "ss-core/core.h" #include "ss-core/ssgui.h" #include "ss-core/sshw.h" static evlist_t el; static void sig_cleanup(int sig) { signal(sig, SIG_DFL); evlist_loop_exit(&el); } int main(int argc, char** argv) { extern char** environ; core_t core; device_t sshw, ssgui; evlist_init(&el); core_init(&core, &sshw, &ssgui, &el); device_init(&sshw, "hardware interface"); child_init(&sshw, "ss-hw/ss-hw", environ, O_RDWR); sshw_init(&sshw, &core); evlist_device_add(&el, &sshw); device_init(&ssgui, "user interface"); null_init(&ssgui); /* child_init(&ssgui, "ss-gui/ss-gui", environ, O_RDWR); */ ssgui_init(&ssgui, &core); evlist_device_add(&el, &ssgui); signal(SIGINT, sig_cleanup); signal(SIGTERM, sig_cleanup); core_start(&core); evlist_loop(&el); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); core_cleanup (&core ); evlist_cleanup(&el ); device_cleanup(&sshw ); device_cleanup(&ssgui); return EXIT_SUCCESS; } /* vim: set ts=4 sts=4 sw=4 tw=80 et: */