00001 /* File: ptoc_tag_xsb_i.h 00002 ** Author(s): Xu, Warren, Sagonas, Swift 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: ptoc_tag_xsb_i.h,v 1.4 2005/01/14 18:31:27 ruim Exp $ 00023 ** 00024 */ 00025 00026 #ifndef __PTOC_TAG_XSB_I_H__ 00027 #define __PTOC_TAG_XSB_I_H__ 00028 00029 /* 00030 * Returns the still-tagged value (a Cell) at the end of the deref chain 00031 * leading from `regnum'. 00032 */ 00033 static inline Cell ptoc_tag(CTXTdeclc int regnum) 00034 { 00035 /* reg is global array in register.h */ 00036 register Cell addr = cell(reg+regnum); 00037 00038 XSB_Deref(addr); 00039 return addr; 00040 } 00041 00042 #endif