auxlry.h

00001 /* File:      auxlry.h
00002 ** Author(s): Warren, Xu, Swift, Sagonas, Johnson
00003 ** Contact:   xsb-contact@cs.sunysb.edu
00004 ** 
00005 ** Copyright (C) The Research Foundation of SUNY, 1986, 1993-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: auxlry.h,v 1.26 2006/02/27 22:03:46 tswift Exp $
00022 ** 
00023 */
00024 
00025 #ifndef __AUXLRY_H__
00026 #define __AUXLRY_H__
00027 
00028 #include "basicdefs.h"
00029 #include "basictypes.h"
00030 
00031 extern double cpu_time(void);
00032 extern double real_time(void);
00033 extern void get_date(int *year, int *month, int *day,
00034                     int *hour, int *minute, int *second);
00035 
00036 #define ihash(val, size) ((word)(val) % (size))
00037 
00038 #ifndef MULTI_THREAD
00039 extern int asynint_val;
00040 #endif
00041 
00042 extern char *xsb_segfault_message;
00043 extern char *xsb_default_segfault_msg;
00044 
00045 /*
00046  *  Mode in which XSB is run.
00047  */
00048 
00049 typedef enum XSB_Execution_Mode {
00050   DEFAULT,           /* mode has not been set by user */
00051   INTERPRETER,       /* currently the mode to be used in default condition */
00052   DISASSEMBLE,       /* dissassemble object file file */
00053   C_CALLING_XSB,
00054   CUSTOM_BOOT_MODULE,     /* user specifies boot module on the command line */
00055   CUSTOM_CMD_LOOP_DRIVER  /* user specifies command loop driver 
00056                              on the command line */ 
00057 } Exec_Mode;
00058 
00059 extern Exec_Mode xsb_mode;
00060 extern int max_threads_glc;
00061 
00062 #define fileptr(xsb_filedes)  open_files[xsb_filedes].file_ptr
00063 
00064 /* This would yield a meaningful message in case of segfault */
00065 #define SET_FILEPTR(stream, xsb_filedes) \
00066     if (xsb_filedes < 0 || xsb_filedes >= MAX_OPEN_FILES) \
00067         xsb_abort("Invalid file descriptor %d in I/O predicate",\
00068                         xsb_filedes);\
00069     stream = fileptr(xsb_filedes); \
00070     if ((stream==NULL) && (xsb_filedes != 0)) \
00071         xsb_abort("Invalid file descriptor %d in I/O predicate", xsb_filedes);
00072 
00073 extern void gdb_dummy(void);
00074 
00075 #endif /* __AUXLRY_H__ */
00076 

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