Back to index

glibc  2.9
Functions | Variables
setjmp.c File Reference
#include <setjmp.h>
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Functions

void abort_to_main_loop (int status)
int main (void)
void do_command (void)

Variables

jmp_buf main_loop

Function Documentation

void abort_to_main_loop ( int  status)

Definition at line 8 of file setjmp.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void do_command ( void  )

Definition at line 25 of file setjmp.c.

{
  char buffer[128];
  if (fgets (buffer, 128, stdin) == NULL)
    abort_to_main_loop (-1);
  else
    exit (EXIT_SUCCESS);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( void  )

Definition at line 14 of file setjmp.c.

{
  while (1)
    if (setjmp (main_loop))
      puts ("Back at main loop....");
    else
      do_command ();
}

Here is the call graph for this function:


Variable Documentation

jmp_buf main_loop

Definition at line 5 of file setjmp.c.