/[ascend]/trunk/base/generic/compiler/initialize.h
ViewVC logotype

Contents of /trunk/base/generic/compiler/initialize.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1372 - (show annotations) (download) (as text)
Fri Mar 30 11:01:20 2007 UTC (17 years, 3 months ago) by jpye
File MIME type: text/x-chdr
File size: 4718 byte(s)
Added some tests that pick up two bugs in the current implementation of default_self
1 /* ASCEND modelling environment
2 Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
3 Copyright (C) 2006 Carnegie Mellon University
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 *//**
20 @file
21 Initialization Routines.
22
23 Requires:
24 #include "utilities/ascConfig.h"
25 #include "instance_enum.h"
26 #include "fractions.h"
27 #include "compiler.h"
28 #include "dimen.h"
29 #include "expr_types.h"
30 *//*
31 by Tom Epperly
32 Created: 3/24/1990
33 Last in CVS: $Revision: 1.11 $ $Date: 1998/03/17 22:08:40 $ $Author: ballan $
34 */
35
36 #ifndef ASC_INITIALIZE_H
37 #define ASC_INITIALIZE_H
38
39 /** @addtogroup compiler Compiler
40 @{
41 */
42
43 #include <utilities/ascConfig.h>
44
45 /** Set the procedure stack limit */
46 extern void SetProcStackLimit(unsigned long l);
47 /**<
48 @param l the stack limit value to be set.
49
50 The stack limit starts out at INITSTACKLIMIT. The limit exists to prevent infinite loops from running the machine out of C automatic variable space.
51 */
52
53 /** Initial stack limit. */
54 #define INITSTACKLIMIT 40
55
56 /** Get the procedure stack limit currently set. */
57 extern unsigned long GetProcStackLimit(void);
58
59 /** Run a METHOD on a model. */
60 ASC_DLLSPEC enum Proc_enum Initialize(struct Instance *context
61 ,struct Name *name
62 ,char *cname
63 ,FILE *err
64 ,wpflags options
65 ,struct gl_list_t *watchpoints
66 ,FILE *dplog
67 );
68 /**<
69 @param context instance in which to run the METHOD.
70 @param name initialisation METHOD being called
71 @param cname string form of the METHOD name (used in error messages)
72 @param err file to which error messages are issued
73 @param dplog file to which debugging messages are issued. If NULL, no logging is done (faster).
74 @param wpflags watchpoint settings
75 @param watchpoints list of watchpoints
76
77 @return Proc_all_ok is all went well, else an error code (@see enum Proc_enum)
78
79 This procedure will execute the initialization code indicated by name with respect to the context instance.
80 If watchlist is NULL or flog is NULL, the debug output options corresponding to watchlist and flog will be ignored.
81 File pointers 'log' and 'err' should not be the same pointer in a good ui design.
82
83 Maximum speed comes from @code Initialize(context,procname,cname,ferr,0,NULL,NULL); @endcode
84 */
85
86 /** Run a class-access METHOD, eg "RUN MyType::values" */
87 extern enum Proc_enum ClassAccessInitialize(struct Instance *context
88 ,struct Name *class_name
89 ,struct Name *name
90 ,char *cname
91 ,FILE *err
92 ,wpflags options
93 ,struct gl_list_t *watchpoints
94 ,FILE *dplog
95 );
96 /**<
97 @param class_name the class being called (eg MyType)
98 @param name the METHOD being called (eg values)
99 @param cname string version of method name, for use in error messages
100 @param err file to which error messages will be output
101 @param dplog file to which debugging messages will be output. NULL if no debug output is deired.
102 @param wpflags watchpoint flags
103 @param watchpoints list of watchpoints. NULL if no watchpoints are required.
104
105 @return Proc_all_ok if success, else an error code.
106
107 Will attempt to run the initialization procedure given by using so-called class access, i.e., deals with syntax such as "RUN Mytype::values."
108
109 If watchlist is NULL or flog is NULL, the debug output options corresponding to watchlist and flog will be ignored. error (and possibly debugging) messages are issued on the files given. Maximum speed comes from @code ClassAccessInitialize(context,class,procname,cname,ferr,0,NULL,NULL); @endcode
110 */
111
112 /** Search for a named procedure on an instance */
113 ASC_DLLSPEC struct InitProcedure *FindProcedure(CONST struct Instance *i,
114 symchar *procname);
115 /**<
116 @param procname the name of the procedure searched for
117 @return pointer to found procedure, or NULL if none found.
118 */
119
120 /** Search a list for a named procedure. */
121 ASC_DLLSPEC struct InitProcedure *SearchProcList(CONST struct gl_list_t *list,
122 symchar *name);
123 /**<
124 @param list (generally you will use the output from @code GetInitializationList() @endcode)
125 @return pointer to found procedure, or NULL if none found.
126 */
127
128 /* @} */
129
130 #endif /* ASC_INITIALIZE_H */

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22