P_File_stream new_file_stream(file, name)

- create a new file-stream FILE *file; String name;

void delete_file_stream(ff)

- delete a file-stream P_Filestream ff;

This module implements input from a file. A new file-stream is created by new_file_stream(). The file must already be open.

void file_stream(ff)

- make ff the current file-stream P_Filestream ff;

int file_current_ch()

- return the current character

int file_next_ch()

- return the next character

void file_pushback_ch(l)

- push back l characters int l;

int file_line_nr()

- return the line number in the current file-stream

String file_name()

- return the file name of the current file-stream

String file_current_line(cur_char)

- return the current line int *cur_char;

The current file stream is set by file_stream(). All other functions act on the current file-stream. file_current_line() returns the current line. The value of *cur_char is set to the column number of the current character in the current line. This gives the exact location in the current file.

file_in.c file_in.h