コード例 #1
0
ファイル: t23run.cpp プロジェクト: BPaden/garglk
/*
 *   Invoke the tads 2 main entrypoint with the given command-line arguments 
 */
static int main_t2(int argc, char **argv)
{
    int stat;

#ifdef GARGLK
    garglk_set_program_name("TADS " TADS_RUNTIME_VERSION);
    char *s;
    s = strrchr(argv[1], '/');
    if (!s) s = strrchr(argv[1], '\\');
    garglk_set_story_name(s ? s + 1 : argv[1]);
#endif

    /* initialize the OS layer */
    os_init(&argc, argv, 0, 0, 0);

    /* install the break handler */
    os_instbrk(1);

    /* invoke the tads 2 main entrypoint */
    stat = os0main2(argc, argv, trdmain, "", 0, 0);

    /* done with the break handler */
    os_instbrk(0);

    /* uninitialize the OS layer */
    os_uninit();

    /* return the status */
    return stat;
}
コード例 #2
0
/*
 *   Invoke the tads 2 main entrypoint with the given command-line arguments 
 */
static int main_t2(int argc, char **argv)
{
    int stat;
    
    /* check for a "-plain" option */
    check_plain_option(argc, argv);

    /* initialize the OS layer */
    os_init(&argc, argv, 0, 0, 0);

    /* install the break handler */
    os_instbrk(1);

    /* invoke the tads 2 main entrypoint */
    stat = os0main2(argc, argv, trdmain, "", 0, 0);

    /* done with the break handler */
    os_instbrk(0);

    /* uninitialize the OS layer */
    os_uninit();

    /* return the status */
    return stat;
}