io_builtins_xsb.h

00001 /* File:      io_builtins_xsb.h
00002 ** Author(s): kifer
00003 ** Contact:   xsb-contact@cs.sunysb.edu
00004 ** 
00005 ** Copyright (C) The Research Foundation of SUNY, 1999
00006 ** 
00007 ** XSB is free software; you can redistribute it and/or modify it under the
00008 ** terms of the GNU Library General Public License as published by the Free
00009 ** Software Foundation; either version 2 of the License, or (at your option)
00010 ** any later version.
00011 ** 
00012 ** XSB is distributed in the hope that it will be useful, but WITHOUT ANY
00013 ** WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014 ** FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for
00015 ** more details.
00016 ** 
00017 ** You should have received a copy of the GNU Library General Public License
00018 ** along with XSB; if not, write to the Free Software Foundation,
00019 ** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 **
00021 ** $Id: io_builtins_xsb.h,v 1.13 2005/12/31 01:43:34 tswift Exp $
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[];      /* Table of file pointers for 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);

Generated on Wed Jul 26 13:30:41 2006 for XSB by  doxygen 1.4.5