term_psc_xsb_i.h

00001 /* File:      term_psc_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: term_psc_xsb_i.h,v 1.3 2005/08/08 17:11:35 dwarren Exp $
00023 ** 
00024 */
00025 
00026 
00027 
00028 static inline Psc term_psc(Cell term)
00029 {
00030   int value;
00031   Psc psc;
00032   Pair sym;
00033 
00034   if (isconstr(term)) {
00035     psc = get_str_psc(term);
00036     return psc;
00037   }
00038   else {
00039     if (isstring(term)) {
00040       psc = (Psc)flags[CURRENT_MODULE];
00041       sym = insert(string_val(term), 0, psc, &value);
00042       return pair_psc(sym);
00043     }
00044     else return NULL;
00045   }
00046 }

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