00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "io_defs_xsb.h"
00026 #include "token_xsb.h"
00027
00028 #define ERROR_ON_EOF 0
00029 #define EOF_CODE_ON_EOF 1
00030 #define RESET_ON_EOF 2
00031
00032 typedef struct {
00033 FILE *file_ptr;
00034 char *file_name;
00035 char io_mode;
00036 int stream_type;
00037 int reposition;
00038 int eof_action;
00039 #ifdef MULTI_THREAD
00040 pthread_mutex_t stream_mutex;
00041 #endif
00042 } stream_record;
00043
00044 extern stream_record open_files[];
00045
00046 #define OPENFILES_MUTEX(i) &(open_files[i].stream_mutex)
00047
00048 extern int xsb_intern_fileptr(FILE *file,char *c,char *c2,char *c3);
00049 extern int xsb_intern_file(char *c1,char *c2,int *i,char *strmode,int opennew);
00050
00051 extern void write_quotedname(FILE *file, char *string);
00052 extern void double_quotes(char *string, char *new_string);
00053 extern xsbBool quotes_are_needed(char *string);
00054
00055 int read_canonical_term(CTXTdeclc FILE *, STRFILE *, int);
00056
00057 void print_term_canonical(CTXTdeclc FILE *, Cell, int);
00058
00059 extern int get_more_chunk(CTXTdecl);
00060 extern void findall_copy_to_heap(CTXTdeclc Cell, CPtr, CPtr *);
00061 extern int findall_init_c(CTXTdecl);
00062 extern void findall_free(CTXTdeclc int);