/home/doxygen/libascend/compiler/child.h

Go to the documentation of this file.
00001 /*  ASCEND modelling environment
00002     Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
00003     Copyright (C) 1996 Benjamin Allan
00004     Copyright (C) 2006 Carnegie Mellon University
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2, or (at your option)
00009     any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 *//*
00031     by Tom Epperly
00032     Version: $Revision: 1.21 $
00033     Version control file: $RCSfile: child.h,v $
00034     Date last modified: $Date: 1998/03/17 22:08:26 $
00035     Last modified by: $Author: ballan $
00036 */
00037 
00038 #ifndef ASC_CHILD_H
00039 #define ASC_CHILD_H
00040 
00041 #include <utilities/ascConfig.h>
00042 #include <general/list.h>
00043 #include "compiler.h"
00044 
00049 #include <utilities/ascConfig.h>
00050 
00055 typedef CONST struct ChildListStructure *ChildListPtr;
00056 
00065 struct ChildListEntry {
00066   symchar *strptr;
00068   CONST struct TypeDescription *typeptr;
00074   CONST struct Statement *statement;
00076   unsigned bflags;
00078   short isarray;
00083   short origin;
00094 #define origin_ERR  0     
00095 /* set 1 */
00096 #define origin_ALI  1     
00097 #define origin_ARR  2     
00098 #define origin_ISA  3     
00099 #define origin_WB   4     
00100 /* set 2 should match set 1, except having P and being > by offset */
00101 #define origin_PALI 5     
00102 #define origin_PARR 6     
00103 #define origin_PISA 7     
00104 #define origin_PWB  8     
00105 #define origin_EXT  9     
00106 #define origin_PARAMETER_OFFSET (origin_PALI - origin_ALI)
00107 
00113 /* child boolean flag bit definitions */
00114 #define CBF_VISIBLE   0x1 
00115 #define CBF_SUPPORTED   0x2 
00116 #define CBF_PASSED    0x4 
00120 /* other CBF as required */
00121 };  /* struct ChildListEntry */
00122 
00123 #define AliasingOrigin(ori) \
00124   ((ori) == origin_PALI || (ori) == origin_ALI || \
00125    (ori) == origin_PARR || (ori) == origin_ARR)
00126 
00128 #define ParametricOrigin(ori) ((ori) >= origin_PALI && (ori) <= origin_PWB)
00129 
00131 extern int CmpChildListEntries(CONST struct ChildListEntry *e1,
00132                                CONST struct ChildListEntry *e2);
00139 extern ChildListPtr CreateChildList(struct gl_list_t *l);
00158 extern void DestroyChildList(ChildListPtr cl);
00167 extern ChildListPtr AppendChildList(ChildListPtr cl, struct gl_list_t *l);
00176 ASC_DLLSPEC unsigned long ChildListLen(ChildListPtr cl);
00181 ASC_DLLSPEC symchar *ChildStrPtr(ChildListPtr cl, unsigned long n);
00187 extern unsigned int ChildIsArray(ChildListPtr cl, unsigned long n);
00195 extern unsigned int ChildOrigin(ChildListPtr cl, unsigned long n);
00200 extern unsigned int ChildAliasing(ChildListPtr cl, unsigned long n);
00206 extern unsigned int ChildParametric(ChildListPtr cl, unsigned long n);
00213 extern CONST struct Statement *ChildStatement(ChildListPtr cl, unsigned long n);
00219 ASC_DLLSPEC unsigned ChildGetBooleans(ChildListPtr cl, unsigned long n);
00226 #define ChildVisible(cl,n) ((ChildGetBooleans((cl),(n)) & CBF_VISIBLE)!=0)
00227 
00231 #define ChildSupported(cl,n) ((ChildGetBooleans((cl),(n)) & CBF_SUPPORTED)!=0)
00232 
00236 #define ChildPassed(cl,n) ((ChildGetBooleans((cl),(n)) & CBF_PASSED) !=0)
00237 
00241 ASC_DLLSPEC void ChildSetBoolean(ChildListPtr cl, unsigned long n,
00242                             unsigned cbfname, unsigned val);
00250 #define ChildHide(cl,n) ChildSetBoolean((cl),(n),CBF_VISIBLE,0)
00251 
00257 #define ChildShow(cl,n) ChildSetBoolean((cl),(n),CBF_VISIBLE,1)
00258 
00264 extern CONST struct TypeDescription *ChildBaseTypePtr(ChildListPtr cl,
00265                                                       unsigned long n);
00283 ASC_DLLSPEC unsigned long ChildPos(ChildListPtr cl, symchar *s);
00298 extern int CompareChildLists(ChildListPtr cl, ChildListPtr c2, unsigned long *diff);
00305 extern void WriteChildList(FILE *fp, ChildListPtr cl);
00312 /* @} */
00313 
00314 #endif  /* ASC_CHILD_H */

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