storage_xsb.h

00001 /* File:      storage_xsb.h  -- support for the storage.P module
00002 ** Author(s): Michael Kifer
00003 ** Contact:   xsb-contact@cs.sunysb.edu
00004 ** 
00005 ** Copyright (C) The Research Foundation of SUNY, 2001
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: storage_xsb.h,v 1.6 2005/09/16 00:56:41 tswift Exp $
00022 ** 
00023 */
00024 
00025 
00026 #include "storage_xsb_defs.h"
00027 
00028 /* data structure for the storage handle
00029    NAME is the name of the storage
00030    HANDLE is the pointer to the root of the trie or the index of the trie root
00031    SNAPSHOT_NUMBER is the snapshot number of the storage
00032    CHANGED is a flag that tell if the trie has been changed by a backtrackable
00033            update since the last commit.
00034 */
00035 
00036 
00037 typedef struct storage_handle STORAGE_HANDLE;
00038 struct storage_handle {
00039   Cell             name;
00040   STORAGE_HANDLE  *next;
00041   Integer          handle;
00042   Integer          snapshot_number;
00043   xsbBool          changed;
00044 };
00045 
00046 
00047 extern STORAGE_HANDLE *storage_builtin(CTXTdeclc int builtin_number, Cell storage_name);
00048 
00049 /* 127 is a prime that is close to 2^7 */
00050 #define STORAGE_TBL_SIZE  127
00051 
00052 #ifndef MULTI_THREAD
00053 extern xsbHashTable bt_storage_hash_table;
00054 #endif

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