ntpd/ntp_scanner.c
/* INPUT STACK
 * -----------
 *
 * Nested input sources are a bit tricky at first glance. We deal with
 * this problem using a stack of input sources, that is, a forward
 * linked list of FILE_INFO structs.
 *
 * This stack is never empty during parsing; while an encounter with EOF
 * can and will remove nested input sources, removing the last element
 * in the stack will not work during parsing, and the EOF condition of
 * the outermost input file remains until the parser folds up.
 */
INPUT STACK

Nested input sources are a bit tricky at first glance. We deal with
this problem using a stack of input sources, that is, a forward
linked list of FILE_INFO structs.

This stack is never empty during parsing; while an encounter with EOF
can and will remove nested input sources, removing the last element
in the stack will not work during parsing, and the EOF condition of
the outermost input file remains until the parser folds up.
INPUT STACK Nested input sources are a bit tricky at first glance . We deal with this problem using a stack of input sources that is a forward linked list of FILE_INFO structs . This stack is never empty during parsing ; while an encounter with EOF can and will remove nested input sources removing the last element in the stack will not work during parsing and the EOF condition of the outermost input file remains until the parser folds up .
static struct FILE_INFO *
_drop_stack_do(
	struct FILE_INFO * head
	)
{
	struct FILE_INFO * tail;
	while (NULL != head) {
		tail = head->st_next;
		lex_close(head);
		head = tail;
	}
	return head;
}
static struct FILE_INFO * _drop_stack_do ( struct FILE_INFO * head ) { struct FILE_INFO * tail ; while ( NULL != head ) { tail = head -> st_next ; lex_close ( head ) ; head = tail ; } return head ; }
INPUT STACK
INPUT STACK