![]() |
GNU PROLOG with UTF8 support
|
#include <stdio.h>

Go to the source code of this file.
Data Structures | |
| struct | StmProp |
| struct | PbStk |
| struct | stm_lst |
| struct | stm_inf |
| struct | AliasInf |
| struct | StrSInf |
Macros | |
| #define | STREAM_PB_SIZE 8 /* push back buffer size */ |
| #define | STREAM_MODE_READ 0 |
| #define | STREAM_MODE_WRITE 1 |
| #define | STREAM_MODE_APPEND 2 |
| #define | STREAM_EOF_ACTION_ERROR 0 |
| #define | STREAM_EOF_ACTION_EOF_CODE 1 |
| #define | STREAM_EOF_ACTION_RESET 2 |
| #define | STREAM_BUFFERING_NONE 0 |
| #define | STREAM_BUFFERING_LINE 1 |
| #define | STREAM_BUFFERING_BLOCK 2 |
| #define | STREAM_EOF_NOT 0 |
| #define | STREAM_EOF_AT 1 |
| #define | STREAM_EOF_PAST 2 |
| #define | STREAM_CHECK_VALID 0 /* simply a valid stream */ |
| #define | STREAM_CHECK_EXIST 1 /* valid and exist */ |
| #define | STREAM_CHECK_INPUT 2 /* valid, exist and mode=input */ |
| #define | STREAM_CHECK_OUTPUT 3 /* valid, exist and mode=output */ |
| #define | STREAM_FCT_UNDEFINED ((StmFct) (-1)) /* for optional fct */ |
| #define | TERM_STREAM_ATOM 1 /* values also used in stream.pl */ |
| #define | TERM_STREAM_CHARS 2 |
| #define | TERM_STREAM_CODES 3 |
| #define | PB_Init(pb) pb.ptr = pb.buff, pb.nb_elems = 0; |
| #define | PB_Is_Empty(pb) (pb.nb_elems == 0) |
| #define | PB_Push(pb, elem) |
| #define | PB_Pop(pb, elem) |
| #define | PB_Top(pb, elem) |
Typedefs | |
| typedef int(* | StmFct) () |
| typedef struct stm_lst * | PStmLst |
| typedef struct stm_lst | StmLst |
| typedef struct stm_inf | StmInf |
Functions | |
| int | Pl_Add_Stream (int atom_file_name, PlLong file, StmProp prop, StmFct fct_getc, StmFct fct_putc, StmFct fct_flush, StmFct fct_close, StmFct fct_tell, StmFct fct_seek, StmFct fct_clearerr) |
| int | Pl_Add_Stream_For_Stdio_Desc (FILE *f, int atom_path, int mode, int text) |
| int | Pl_Add_Stream_For_Stdio_File (char *path, int mode, Bool text) |
| void | Pl_Delete_Stream (int stm) |
| int | Pl_Find_Stream_By_Alias (int atom_alias) |
| Bool | Pl_Add_Alias_To_Stream (int atom_alias, int stm) |
| void | Pl_Reassign_Alias (int atom_alias, int stm) |
| void | Pl_Add_Mirror_To_Stream (int stm, int m_stm) |
| Bool | Pl_Del_Mirror_From_Stream (int stm, int m_stm) |
| int | Pl_Find_Stream_From_PStm (StmInf *pstm) |
| void | Pl_Flush_All_Streams (void) |
| void | Pl_Set_Stream_Buffering (int stm) |
| int | Pl_Get_Stream_Or_Alias (WamWord sora_word, int test_mask) |
| void | Pl_Check_Stream_Type (int stm, Bool check_text, Bool for_input) |
| WamWord | Pl_Make_Stream_Tagged_Word (int stm) |
| Bool | Pl_Stdio_Is_Repositionable (FILE *f) |
| void | Pl_Stdio_Set_Buffering (FILE *f, int buffering) |
| FILE * | Pl_Stdio_Desc_Of_Stream (int stm) |
| int | Pl_Io_Fileno_Of_Stream (int stm) |
| void | Pl_PB_Empty_Buffer (StmInf *pstm) |
| CHAR32_T | Pl_Stream_Get_Key (StmInf *pstm, Bool echo, Bool catch_ctrl_c) |
| CHAR32_T | Pl_Stream_Getc (StmInf *pstm) |
| void | Pl_Stream_Ungetc (CHAR32_T c, StmInf *pstm) |
| CHAR32_T | Pl_Stream_Peekc (StmInf *pstm) |
| char * | Pl_Stream_Gets (char *str, int size, StmInf *pstm) |
| char * | Pl_Stream_Gets_Prompt (char *prompt, StmInf *pstm_o, char *str, int size, StmInf *pstm_i) |
| void | Pl_Stream_Putc (CHAR32_T c, StmInf *pstm) |
| int | Pl_Stream_Puts (char *str, StmInf *pstm) |
| int | Pl_Stream_Printf (StmInf *pstm, char *format,...) |
| void | Pl_Stream_Flush (StmInf *pstm) |
| int | Pl_Stream_Close (StmInf *pstm) |
| int | Pl_Stream_End_Of_Stream (StmInf *pstm) |
| void | Pl_Stream_Get_Position (StmInf *pstm, PlLong *offset, PlLong *char_count, PlLong *line_count, PlLong *line_pos) |
| int | Pl_Stream_Set_Position (StmInf *pstm, int whence, PlLong offset, PlLong char_count, PlLong line_count, PlLong line_pos) |
| int | Pl_Stream_Set_Position_LC (StmInf *pstm, PlLong line_count, PlLong line_pos) |
| int | Pl_Add_Str_Stream (char *buff, int prop_other) |
| void | Pl_Delete_Str_Stream (int stm) |
| char * | Pl_Term_Write_Str_Stream (int stm) |
| void | Pl_Close_Stm (int stm, Bool force) |
Variables | |
| StmInf ** | pl_stm_tbl |
| int | pl_stm_tbl_size |
| int | pl_stm_last_used |
| char * | pl_alias_tbl |
| WamWord | pl_last_input_sora |
| WamWord | pl_last_output_sora |
| int | pl_stm_stdin |
| int | pl_stm_stdout |
| int | pl_stm_stderr |
| int | pl_stm_input |
| int | pl_stm_output |
| int | pl_stm_error |
| int | pl_stm_top_level_input |
| int | pl_stm_top_level_output |
| int | pl_stm_debugger_input |
| int | pl_stm_debugger_output |
| Bool | pl_stream_use_linedit |
| char * | pl_le_prompt |
| int | pl_use_le_prompt |
| int | pl_atom_stream |
| int | pl_atom_user_input |
| int | pl_atom_user_output |
| int | pl_atom_top_level_input |
| int | pl_atom_top_level_output |
| int | pl_atom_debugger_input |
| int | pl_atom_debugger_output |
| int | pl_atom_read |
| int | pl_atom_write |
| int | pl_atom_append |
| int | pl_atom_reposition |
| int | pl_atom_stream_position |
| int | pl_atom_text |
| int | pl_atom_binary |
| int | pl_atom_error |
| int | pl_atom_eof_code |
| int | pl_atom_reset |
| int | pl_atom_none |
| int | pl_atom_line |
| int | pl_atom_block |
| int | pl_atom_not |
| int | pl_atom_at |
| int | pl_atom_past |
| int | pl_atom_bof |
| int | pl_atom_current |
| int | pl_atom_eof |
| #define PB_Init | ( | pb | ) | pb.ptr = pb.buff, pb.nb_elems = 0; |
| #define PB_Is_Empty | ( | pb | ) | (pb.nb_elems == 0) |
| #define PB_Pop | ( | pb, | |
| elem | |||
| ) |
| #define PB_Push | ( | pb, | |
| elem | |||
| ) |
| #define PB_Top | ( | pb, | |
| elem | |||
| ) |
| #define STREAM_BUFFERING_BLOCK 2 |
| #define STREAM_BUFFERING_LINE 1 |
| #define STREAM_BUFFERING_NONE 0 |
| #define STREAM_CHECK_EXIST 1 /* valid and exist */ |
| #define STREAM_CHECK_INPUT 2 /* valid, exist and mode=input */ |
| #define STREAM_CHECK_OUTPUT 3 /* valid, exist and mode=output */ |
| #define STREAM_CHECK_VALID 0 /* simply a valid stream */ |
| #define STREAM_EOF_ACTION_EOF_CODE 1 |
| #define STREAM_EOF_ACTION_ERROR 0 |
| #define STREAM_EOF_ACTION_RESET 2 |
| #define STREAM_EOF_AT 1 |
| #define STREAM_EOF_NOT 0 |
| #define STREAM_EOF_PAST 2 |
| #define STREAM_MODE_APPEND 2 |
| #define STREAM_MODE_READ 0 |
| #define STREAM_MODE_WRITE 1 |
| #define STREAM_PB_SIZE 8 /* push back buffer size */ |
| #define TERM_STREAM_ATOM 1 /* values also used in stream.pl */ |
| #define TERM_STREAM_CHARS 2 |
| #define TERM_STREAM_CODES 3 |
| typedef int(* StmFct) () |
| Bool Pl_Add_Alias_To_Stream | ( | int | atom_alias, |
| int | stm | ||
| ) |


| void Pl_Add_Mirror_To_Stream | ( | int | stm, |
| int | m_stm | ||
| ) |

| int Pl_Add_Str_Stream | ( | char * | buff, |
| int | prop_other | ||
| ) |


| int Pl_Add_Stream | ( | int | atom_file_name, |
| PlLong | file, | ||
| StmProp | prop, | ||
| StmFct | fct_getc, | ||
| StmFct | fct_putc, | ||
| StmFct | fct_flush, | ||
| StmFct | fct_close, | ||
| StmFct | fct_tell, | ||
| StmFct | fct_seek, | ||
| StmFct | fct_clearerr | ||
| ) |


| int Pl_Add_Stream_For_Stdio_Desc | ( | FILE * | f, |
| int | atom_path, | ||
| int | mode, | ||
| int | text | ||
| ) |


| int Pl_Add_Stream_For_Stdio_File | ( | char * | path, |
| int | mode, | ||
| Bool | text | ||
| ) |




| void Pl_Close_Stm | ( | int | stm, |
| Bool | force | ||
| ) |


| Bool Pl_Del_Mirror_From_Stream | ( | int | stm, |
| int | m_stm | ||
| ) |


| void Pl_Delete_Str_Stream | ( | int | stm | ) |


| void Pl_Delete_Stream | ( | int | stm | ) |


| int Pl_Find_Stream_By_Alias | ( | int | atom_alias | ) |


| int Pl_Find_Stream_From_PStm | ( | StmInf * | pstm | ) |

| void Pl_Flush_All_Streams | ( | void | ) |


| int Pl_Get_Stream_Or_Alias | ( | WamWord | sora_word, |
| int | test_mask | ||
| ) |


| int Pl_Io_Fileno_Of_Stream | ( | int | stm | ) |


| WamWord Pl_Make_Stream_Tagged_Word | ( | int | stm | ) |
| void Pl_PB_Empty_Buffer | ( | StmInf * | pstm | ) |

| void Pl_Reassign_Alias | ( | int | atom_alias, |
| int | stm | ||
| ) |


| void Pl_Set_Stream_Buffering | ( | int | stm | ) |


| FILE* Pl_Stdio_Desc_Of_Stream | ( | int | stm | ) |

| Bool Pl_Stdio_Is_Repositionable | ( | FILE * | f | ) |

| void Pl_Stdio_Set_Buffering | ( | FILE * | f, |
| int | buffering | ||
| ) |

| int Pl_Stream_Close | ( | StmInf * | pstm | ) |

| int Pl_Stream_End_Of_Stream | ( | StmInf * | pstm | ) |


| void Pl_Stream_Flush | ( | StmInf * | pstm | ) |



| void Pl_Stream_Get_Position | ( | StmInf * | pstm, |
| PlLong * | offset, | ||
| PlLong * | char_count, | ||
| PlLong * | line_count, | ||
| PlLong * | line_pos | ||
| ) |



| char* Pl_Stream_Gets | ( | char * | str, |
| int | size, | ||
| StmInf * | pstm | ||
| ) |


| char* Pl_Stream_Gets_Prompt | ( | char * | prompt, |
| StmInf * | pstm_o, | ||
| char * | str, | ||
| int | size, | ||
| StmInf * | pstm_i | ||
| ) |




| int Pl_Stream_Printf | ( | StmInf * | pstm, |
| char * | format, | ||
| ... | |||
| ) |




| int Pl_Stream_Puts | ( | char * | str, |
| StmInf * | pstm | ||
| ) |


| int Pl_Stream_Set_Position | ( | StmInf * | pstm, |
| int | whence, | ||
| PlLong | offset, | ||
| PlLong | char_count, | ||
| PlLong | line_count, | ||
| PlLong | line_pos | ||
| ) |





| char* Pl_Term_Write_Str_Stream | ( | int | stm | ) |

| char* pl_alias_tbl |
| int pl_atom_append |
| int pl_atom_at |
| int pl_atom_binary |
| int pl_atom_block |
| int pl_atom_bof |
| int pl_atom_current |
| int pl_atom_debugger_input |
| int pl_atom_debugger_output |
| int pl_atom_eof |
| int pl_atom_eof_code |
| int pl_atom_error |
| int pl_atom_line |
| int pl_atom_none |
| int pl_atom_not |
| int pl_atom_past |
| int pl_atom_read |
| int pl_atom_reposition |
| int pl_atom_reset |
| int pl_atom_stream |
| int pl_atom_stream_position |
| int pl_atom_text |
| int pl_atom_top_level_input |
| int pl_atom_top_level_output |
| int pl_atom_user_input |
| int pl_atom_user_output |
| int pl_atom_write |
| WamWord pl_last_input_sora |
| WamWord pl_last_output_sora |
| char* pl_le_prompt |
| int pl_stm_debugger_input |
| int pl_stm_debugger_output |
| int pl_stm_error |
| int pl_stm_input |
| int pl_stm_last_used |
| int pl_stm_output |
| int pl_stm_stderr |
| int pl_stm_stdin |
| int pl_stm_stdout |
| StmInf** pl_stm_tbl |
| int pl_stm_tbl_size |
| int pl_stm_top_level_input |
| int pl_stm_top_level_output |
| Bool pl_stream_use_linedit |
| int pl_use_le_prompt |
1.8.11