/home/doxygen/libascend/compiler/childpriv.h

00001 #ifdef __CHILD_ILLEGAL_ACCESS__
00002 /*
00003  *  Child List Internal Implementation details
00004  *  by Benjamin Allan
00005  *  Version: $Revision: 1.1 $
00006  *  Version control file: $RCSfile: childpriv.h,v $
00007  *  Date last modified: $Date: 1998/03/27 10:43:58 $
00008  *  Last modified by: $Author: ballan $
00009  *
00010  *  This file is part of the Ascend Language Interpreter.
00011  *
00012  *  Copyright (C) 1998 Carnegie Mellon University
00013  *
00014  *  The Ascend Language Interpreter is free software; you can redistribute
00015  *  it and/or modify it under the terms of the GNU General Public License as
00016  *  published by the Free Software Foundation; either version 2 of the
00017  *  License, or (at your option) any later version.
00018  *
00019  *  The Ascend Language Interpreter is distributed in hope that it will be
00020  *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00022  *  General Public License for more details.
00023  *
00024  *  You should have received a copy of the GNU General Public License
00025  *  along with the program; if not, write to the Free Software Foundation,
00026  *  Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named
00027  *  COPYING.
00028  */
00029 
00039 #ifndef _CHILDPRIV_H_SEEN_
00040 #define _CHILDPRIV_H_SEEN_
00041 
00042 #ifndef lint
00043 static CONST char ChildPrivID[] = "$Id: childpriv.h,v 1.1 1998/03/27 10:43:58 ballan Exp $";
00044 #endif
00045 
00047 #define LegalOrigin(n) ( ((n)>0 && (n) <=8) ? (n) : 0 )
00048 
00049 struct ChildHash {
00050   struct ChildHash *next;
00051   symchar *sym;           
00052   unsigned long clindex;  
00053 };
00054 
00060 #define CHILDHASHINDEX(p) (((((long) (p))*1103515245) >> 22) & 255)
00061 
00066 #define CHILDHASHTABLESIZE 256
00067 
00072 struct ChildListStructure {
00073   struct gl_list_t *list;
00074   struct gl_list_t *symbols; 
00075   struct ChildHash *table[CHILDHASHTABLESIZE];
00076   struct ChildHash *data;    
00077 };
00078 
00080 #define CGET(l,n) ((struct ChildListEntry *)gl_fetch((l)->list,(n)))
00081 
00082 #define CNAME(l,n) ((l)->data[(n)-1].sym)
00083 
00084 #define GGET(l,n) ((struct ChildListEntry *)gl_fetch((l),(n)))
00085 
00088 #define CPUT(l,p) gl_insert_sorted((l)->list,(p),(CmpFunc)CmpChildListEntries)
00089 
00091 #define GL(a) (a)->list
00092 
00093 #define GN(a) (a)->symbols
00094 
00095 #endif  /* _CHILDPRIV_H_SEEN_ */
00096 #endif  /* __CHILD_ILLEGAL_ACCESS__ */
00097 

Generated on Thu Jul 17 04:00:10 2008 for libascend by  doxygen 1.5.1