/home/doxygen/libascend/compiler/extcall.h

Go to the documentation of this file.
00001 /*  ASCEND modelling environment
00002     Copyright (C) 2006 Carnegie Mellon University
00003     Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly, Kirk Andre Abbott
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2, or (at your option)
00008     any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 *//*
00040     by Kirk Andre Abbott
00041     Created: Jun 1, 1995.
00042     Last in CVS: $Revision: 1.6 $ $Date: 1997/07/18 12:29:27 $ $Author: mthomas $
00043 */
00044 
00045 #ifndef ASC_EXTCALL_H
00046 #define ASC_EXTCALL_H
00047 
00052 #include <utilities/ascConfig.h>
00053 #include <utilities/ascMalloc.h>
00054 #include <general/list.h>
00055 #include <compiler/extfunc.h>
00056 #include "compiler.h"
00057 #include "instance_enum.h"
00058 
00064 struct ExtCallNode{
00065   struct ExternalFunc *efunc; 
00066   struct gl_list_t *arglist;  
00067   struct Instance **data;     
00068   unsigned long subject;      
00069   int nodestamp;              
00070 };
00071 
00072 extern struct ExtCallNode *CreateExtCall(struct ExternalFunc *efunc,
00073         struct gl_list_t *args,
00074         struct Instance *subject,
00075         struct Instance *data);
00080 extern void DestroyExtCall(struct ExtCallNode *ext,
00081         struct Instance *relinst);
00086 extern struct Instance *GetSubjectInstance(struct gl_list_t *arglist,
00087         unsigned long varndx);
00088 
00089 extern unsigned long GetSubjectIndex(struct gl_list_t *arglist,
00090         struct Instance *subject);
00095 ASC_DLLSPEC unsigned long CountNumberOfArgs(struct gl_list_t *arglist,
00096         unsigned long start, unsigned long end);
00106 extern struct gl_list_t *LinearizeArgList(struct gl_list_t *arglist,
00107         unsigned long start, unsigned long end);
00117 extern struct gl_list_t *CopySpecialList(struct gl_list_t *list);
00122 extern struct gl_list_t *DeepCopySpecialList(struct gl_list_t *list, CopyFunc copy);
00127 extern void DestroySpecialList(struct gl_list_t *list);
00135 extern void DeepDestroySpecialList(struct gl_list_t *list, DestroyFunc dtor);
00144 #ifdef NDEBUG
00145 #define ExternalCallExtFunc(ext) ((ext)->efunc)
00146 #else
00147 #define ExternalCallExtFunc(ext) ExternalCallExtFuncF(ext)
00148 #endif
00149 
00155 extern struct ExternalFunc *ExternalCallExtFuncF(struct ExtCallNode *ext);
00163 #ifdef NDEBUG
00164 #define ExternalCallArgList(ext) ((ext)->arglist)
00165 #else
00166 #define ExternalCallArgList(ext) ExternalCallArgListF(ext)
00167 #endif
00168 
00175 extern struct gl_list_t *ExternalCallArgListF(struct ExtCallNode *ext);
00183 extern struct Instance *ExternalCallDataInstance(struct ExtCallNode *ext);
00196 #ifdef NDEBUG
00197 #define ExternalCallVarIndex(ext) ((ext)->subject)
00198 #else
00199 #define ExternalCallVarIndex(ext) ExternalCallVarIndexF(ext)
00200 #endif
00201 
00207 extern unsigned long ExternalCallVarIndexF(struct ExtCallNode *ext);
00217 extern struct Instance *ExternalCallVarInstance(struct ExtCallNode *ext);
00226 #ifdef NDEBUG
00227 #define ExternalCallNodeStamp(ext) ((ext)->nodestamp)
00228 #else
00229 #define ExternalCallNodeStamp(ext) ExternalCallNodeStampF(ext)
00230 #endif
00231 
00246 extern int ExternalCallNodeStampF(struct ExtCallNode *ext);
00254 extern void SetExternalCallNodeStamp(struct ExtCallNode *ext, int nodestamp);
00259 /* @} */
00260 
00261 #endif /* ASC_EXTCALL_H */

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