Exemplo n.º 1
0
Arquivo: main.c Projeto: flrl/froth
int main (int argc, char **argv) {

    mem_init(0);

    // do_abort jumps to here
    if (setjmp(abort_jmp) != 0) {
        dropline();  /* discard rest of input line if we longjmp'd here */
    }

    stack_init(&data_stack, EXC_DS_UNDER, EXC_DS_OVER);

    // do_quit() jumps to here
    if (setjmp(quit_jmp) != 0) {
        dropline();  /* discard rest of input line if we longjmp'd here */
    }

    stack_init(&return_stack, EXC_RS_UNDER, EXC_RS_OVER);
    stack_init(&control_stack, EXC_CS_UNDER, EXC_CS_OVER); 
    exception_init();
    interpreter_state = S_INTERPRET;
    docolon_mode = DM_NORMAL;

    // Run the interpreter
    while (1) {
        do_interpret(NULL);
    }

    exit(0);
}
Exemplo n.º 2
0
int
ipforward ()
{
    FILE *fp;
    int ipforwarding = 0;
    char *pnt;
    char buf[10];

    fp = fopen (proc_net_snmp, "r");

    if (fp == NULL)
        return -1;

    /* We don't care about the first line. */
    dropline (fp);

    /* Get ip_statistics.IpForwarding :
       1 => ip forwarding enabled
       2 => ip forwarding off. */
    pnt = fgets (buf, 6, fp);
    sscanf (buf, "Ip: %d", &ipforwarding);

    if (ipforwarding == 1)
        return 1;

    return 0;
}
Exemplo n.º 3
0
void View::linecheck()
{
	for (int i = 0; i < viewlaenge; i++)
	{
		for (int j = 0; j < viewbreite; j++)
		{
			if (sfeld[j][i][0] != 0)
				sfeld[j][i][1] = 8;
			if (sfeld[j][i][0] == 0)
				break;
			else if (j >= viewlaenge-1)
				dropline(i);
		}
	}
}