Esempio n. 1
0
File: gti.c Progetto: Joker-vD/gti
int main(int argc, char **argv)
{
    int i;
    char *git_path;
    (void) argc;

    open_term();
    TERM_WIDTH = term_width();
    SLEEP_DELAY = 1000000 / (TERM_WIDTH + GTI_SPEED);

    init_space();
    for (i = -20; i < TERM_WIDTH; i++) {
        draw_car(i);
        usleep(SLEEP_DELAY);
        clear_car(i);
    }
    move_to_top();
    fflush(TERM_FH);
    git_path = getenv("GIT");
    if (git_path) {
      execv(git_path, argv);
    } else {
      execvp(GIT_NAME, argv);
    }
    /* error in exec if we land here */
    perror(GIT_NAME);
    return 1;
}
Esempio n. 2
0
File: gti.c Progetto: rwos/gti
int main(int argc, char **argv)
{
    int i;
    char *git_path;
    char *tmp;
    unsigned int gti_speed;
    draw_fn_t draw_fn;

    tmp = getenv("GTI_SPEED");
    if (!tmp || sscanf(tmp, "%u", &gti_speed) != 1) {
        gti_speed = GTI_SPEED;
    }
    open_term();
    TERM_WIDTH = term_width();
    FRAME_TIME = 1000 * 1000 * 10 / (gti_speed + TERM_WIDTH + 1);

    draw_fn = select_command(argc, argv);
    init_space();
    for (i = -20; i < TERM_WIDTH; i++) {
        draw_fn(i);
        clear_car(i);
    }
    move_to_top();
    fflush(TERM_FH);

    git_path = getenv("GIT");
    if (git_path) {
        execv(git_path, argv);
    } else {
        execvp(GIT_NAME, argv);
    }
    /* error in exec if we land here */
    perror(GIT_NAME);
    return 1;
}
Esempio n. 3
0
int main(int argc, char **argv)
{
    (void) argc;
    int i;
    TERM_WIDTH = term_width();
    SLEEP_DELAY = 1000000 / GTI_SPEED;
    
    init_space();
    for (i = -20; i < TERM_WIDTH; i++) {
        draw_car(i);
        usleep(SLEEP_DELAY);
        clear_car(i);
    }
    return 1;
}
Esempio n. 4
0
File: gti.c Progetto: oelbrenner/gti
int main(int argc, char **argv)
{
    (void) argc;
    int i;
    TERM_WIDTH = term_width();
    init_space();
    for (i = -20; i < TERM_WIDTH; i++) {
        draw_car(i);
        usleep(20*1000);
        clear_car(i);
    }
    execvp(GIT_NAME, argv);
    /* error in exec if we land here */
    perror(GIT_NAME);
    return 1;
}
Esempio n. 5
0
File: gt.c Progetto: joeledwards/gt
int main(int argc, char **argv)
{
    (void) argc;
    int i;
    TERM_WIDTH = term_width();
    SLEEP_DELAY = 2000000 / (TERM_WIDTH + GT_SPEED);
    
    init_space();
    for (i = TERM_WIDTH; i > -81; i--) {
        draw_car(i);
        usleep(SLEEP_DELAY);
        clear_car(i);
    }
    char *git_path = getenv("GIT");
    if (git_path) {
      execv(git_path, argv);
    } else {
      execvp(GIT_NAME, argv);
    }
    /* error in exec if we land here */
    perror(GIT_NAME);
    return 1;
}