Пример #1
0
int main(int argc, char **argv) {
    pvr_init_defaults();

    printf("kosh starting\n");

    /* initialize the conio service */
    conio_init(CONIO_TTY_PVR, CONIO_INPUT_LINE);
    // conio_init(CONIO_TTY_SERIAL, CONIO_INPUT_LINE);

    /* initialize kosh */
    kosh_init();

    /* Add a test builtin */
    kosh_builtin_add("test", "This is a test command.", test_builtin);

    /* wait for the user to exit */
    kosh_join();

    /* shutdown kosh */
    kosh_shutdown();

    /* shutdown console i/o */
    conio_shutdown();

    printf("kosh is done\n");
    return 0;
}
Пример #2
0
void kosh_shutdown() {
	if (kosh_exit != KE_JOINED) {
		kosh_exit = KE_YES;
		kosh_join();
	}
	kosh_builtins_shutdown();
}