token_xsb.h

00001 /* File:      token_xsb.h
00002 ** Author(s): Kostis F. Sagonas, Jiyang Xu
00003 ** Contact:   xsb-contact@cs.sunysb.edu
00004 ** 
00005 ** Copyright (C) The Research Foundation of SUNY, 1986, 1993-1999
00006 ** Copyright (C) ECRC, Germany, 1990
00007 ** 
00008 ** XSB is free software; you can redistribute it and/or modify it under the
00009 ** terms of the GNU Library General Public License as published by the Free
00010 ** Software Foundation; either version 2 of the License, or (at your option)
00011 ** any later version.
00012 ** 
00013 ** XSB is distributed in the hope that it will be useful, but WITHOUT ANY
00014 ** WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00015 ** FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for
00016 ** more details.
00017 ** 
00018 ** You should have received a copy of the GNU Library General Public License
00019 ** along with XSB; if not, write to the Free Software Foundation,
00020 ** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00021 **
00022 ** $Id: token_xsb.h,v 1.6 2006/05/22 15:40:04 dwarren Exp $
00023 ** 
00024 */
00025 
00026 #ifndef _TOKEN_XSB_H_
00027 #define _TOKEN_XSB_H_
00028 
00029 #include "token_defs_xsb.h"
00030 
00031  
00032 #define strgetc(p) (--(p)->strcnt>=0? ((int)*(p)->strptr++): -1)
00033 #define strpeekc(p) ((p)->strcnt>=0? ((int)*(p)->strptr): -1)
00034 
00035 #define GetC(card,instr) (instr ? strgetc(instr) : getc(card))
00036 
00037 struct strbuf {
00038   int strcnt;
00039   char *strptr;
00040   char *strbase;
00041 };
00042 
00043 #define STRFILE struct strbuf
00044 #define MAXIOSTRS 5
00045 extern STRFILE *iostrs[MAXIOSTRS];
00046 #define iostrdecode(j) (-1-j)
00047 #define strfileptr(desc) iostrs[iostrdecode(desc)]
00048 #define InitStrLen      1000
00049 
00050 #ifndef MULTI_THREAD
00051 extern struct token_t *token;
00052 #endif
00053 #include "context.h"
00054 extern struct token_t *GetToken(CTXTdeclc FILE *, STRFILE *, int);
00055 
00056 extern int intype(int);
00057 
00058 #endif /* _TOKEN_XSB_H_ */
00059 
00060 /*======================================================================*/
00061 /*======================================================================*/
00062 

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