/[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 900 - (show annotations) (download) (as text)
Wed Oct 25 06:03:04 2006 UTC (13 years, 11 months ago) by johnpye
File MIME type: text/x-chdr
File size: 5102 byte(s)
The 'sim' object is correctly accessible from script methods now, even if run during on_load.
Added 'getSimulation' to registry.cpp, added 'runDefaultMethod' to Simulation, added 'getMethod' to Type.
Running of 'on_load' is instigated at the Python level now, so that relevent python variables are set at simulations are built, etc. This appears to have cause some changes to the way the solver behaves, possibly.
Added SearchProcList to exports in libascend.

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 Version: $Revision: 1.11 $
34 Version control file: $RCSfile: initialize.h,v $
35 Date last modified: $Date: 1998/03/17 22:08:40 $
36 Last modified by: $Author: ballan $
37 */
38
39 #ifndef ASC_INITIALIZE_H
40 #define ASC_INITIALIZE_H
41
42 #include <utilities/ascConfig.h>
43
44 /** Set the procedure stack limit */
45 extern void SetProcStackLimit(unsigned long l);
46 /**<
47 @param l the stack limit value to be set.
48
49 The stack limit starts out at INITSTACKLIMIT. The limit exists to prevent infinite loops from running the machine out of C automatic variable space.
50 */
51
52 /** Initial stack limit. */
53 #define INITSTACKLIMIT 20
54
55 /** Get the procedure stack limit currently set. */
56 extern unsigned long GetProcStackLimit(void);
57
58 /** Run a METHOD on a model. */
59 ASC_DLLSPEC(enum Proc_enum) Initialize(struct Instance *context,
60 struct Name *name,
61 char *cname,
62 FILE *err,
63 wpflags options,
64 struct gl_list_t *watchpoints,
65 FILE *log);
66 /**<
67 @param context instance in which to run the METHOD.
68 @param name initialisation METHOD being called
69 @param cname string form of the METHOD name (used in error messages)
70 @param err file to which error messages are issued
71 @param log file to debugging messages are issued. If NULL, no logging is done (faster).
72 @param wpflags watchpoint settings
73 @param watchpoints list of watchpoints
74
75 @return Proc_all_ok is all went well, else an error code (@see enum Proc_enum)
76
77 This procedure will execute the initialization code indicated by name with respect to the context instance.
78 If watchlist is NULL or flog is NULL, the debug output options corresponding to watchlist and flog will be ignored.
79 File pointers 'log' and 'err' should not be the same pointer in a good ui design.
80
81 Maximum speed comes from @code Initialize(context,procname,cname,ferr,0,NULL,NULL); @endcode
82 */
83
84 /** Run a class-access METHOD, eg "RUN MyType::values" */
85 extern enum Proc_enum ClassAccessInitialize(struct Instance *context,
86 struct Name *class_name,
87 struct Name *name,
88 char *cname,
89 FILE *err,
90 wpflags options,
91 struct gl_list_t *watchpoints,
92 FILE *log);
93 /**<
94 @param class_name the class being called (eg MyType)
95 @param name the METHOD being called (eg values)
96 @param cname string version of method name, for use in error messages
97 @param err file to which error messages will be output
98 @param log file to which debugging messages will be output. NULL if no debug output is deired.
99 @param wpflags watchpoint flags
100 @param watchpoints list of watchpoints. NULL if no watchpoints are required.
101
102 @return Proc_all_ok if success, else an error code.
103
104 Will attempt to run the initialization procedure given by using so-called class access, i.e., deals with syntax such as "RUN Mytype::values."
105
106 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
107 */
108
109 /** Search for a named procedure on an instance */
110 ASC_DLLSPEC(struct InitProcedure *) FindProcedure(CONST struct Instance *i,
111 symchar *procname);
112 /**<
113 @param procname the name of the procedure searched for
114 @return pointer to found procedure, or NULL if none found.
115 */
116
117 /** Search a list for a named procedure. */
118 ASC_DLLSPEC(struct InitProcedure *) SearchProcList(CONST struct gl_list_t *list,
119 symchar *name);
120 /**<
121 @param list (generally you will use the output from @code GetInitializationList() @endcode)
122 @return pointer to found procedure, or NULL if none found.
123 */
124
125 #endif /* ASC_INITIALIZE_H */

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