VMS/VMS_Implementations/VMS_impls/VMS__MC_shared_impl

view PR__int.h @ 286:b02b34681414

VReo V2 -- saves checker and doer fn with the port, where triggered
author Sean Halle <seanhalle@yahoo.com>
date Wed, 10 Jul 2013 14:49:04 -0700
parents 40e7625e57bd
children 744b5ff9851e
line source
1 /*
2 * Copyright 2009 OpenSourceResearchInstitute.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 */
9 #ifndef _PR_INT_H
10 #define _PR_INT_H
11 #define _GNU_SOURCE
14 /* MEANING OF WL PI SS int
15 * These indicate which places the function is safe to use. They stand for:
16 * WL: Wrapper Library
17 * PI: Plugin
18 * SS: Startup and Shutdown
19 * int: internal to the PR implementation
20 */
22 inline
23 void
24 PR_int__reset_slaveVP_to_BirthFn( SlaveVP *slaveVP, BirthFnPtr fnPtr,
25 void *dataParam);
27 inline
28 void
29 PR_int__point_slaveVP_to_OneParamFn( SlaveVP *slaveVP, void *fnPtr,
30 void *param);
32 inline
33 void
34 PR_int__point_slaveVP_to_TwoParamFn( SlaveVP *slaveVP, void *fnPtr,
35 void *param1, void *param2);
37 //===========================================================================
38 //
39 //===========================================================================
40 inline
41 SlaveVP *
42 PR_int__create_slaveVP_helper( BirthFnPtr fnPtr, void *dataParam );
44 inline
45 SlaveVP *
46 PR_int__create_slaveVP( BirthFnPtr fnPtr, void *dataParam, PRProcess *process );
48 SlaveVP *
49 PR_int__get_recycled_slot_slave( );
51 SlaveVP *
52 PR_int__create_slot_slave( );
54 inline
55 void
56 PR_int__replace_with_new_slot_slv( SlaveVP *slave );
58 void
59 idle_fn(void* data, SlaveVP *animatingSlv);
61 inline
62 void
63 PR_int__put_task_into_slot( void *task, AnimSlot *slot );
65 inline
66 void
67 PR_int__put_slave_into_slot( SlaveVP *slave, AnimSlot *slot );
69 void inline
70 PRHandle__ServiceReq( SlaveVP *requestingSlv );
72 void
73 PR_int__free_slaveVP( SlaveVP *slave );
75 void
76 PR_int__recycle_slaveVP( SlaveVP *slave );
78 void
79 freeLangDataAsElem( void *elem );
81 void
82 freeMetaTaskAsElem( void *elem );
85 //=============================
86 //=== Lange Env
87 //=
88 inline
89 void *
90 PR_int__give_lang_env( PRLangEnv *protoLangEnv );
92 inline
93 PRLangEnv *
94 PR_int__give_proto_lang_env( void *langEnv );
96 //inline
97 void *
98 PR_int__create_lang_env_in_process( int32 size, PRProcess *process, int32 magicNum );
100 inline
101 void *
102 PR_int__remove_lang_env_from_process_and_free( void *langEnv );
104 inline
105 void *
106 PR_int__give_lang_env_of_req( PRReqst *req, SlaveVP *requestingSlv );
108 inline
109 void *
110 PR_int__give_lang_env_for_slave( SlaveVP *slave, int32 magicNum );
111 //No WL version -- not safe! if use env in WL, be sure data rd & wr is stable
113 inline
114 PRLangEnv *
115 PR_int__give_proto_lang_env_for_slave( SlaveVP *slave, int32 magicNumber );
116 //No WL version -- not safe! if use env in WL, be sure data rd & wr is stable
118 inline
119 void *
120 PR_int__give_lang_env_from_process( PRProcess *process, int32 magicNum );
121 //No WL version -- not safe! if use env in WL, be sure data rd & wr is stable
123 inline
124 PRLangEnv *
125 PR_int__give_proto_lang_env_from_process( PRProcess *process, int32 magicNum );
127 //=======================
128 //=== Meta Task
129 //=
130 inline
131 PRMetaTask *
132 PR_int__give_prolog_of_lang_meta_task( void *task );
134 inline
135 void *
136 PR_int__give_lang_meta_task_of_prolog( PRMetaTask *metaTask);
138 inline
139 void *
140 PR_int__create_lang_meta_task( int32 size, LangMetaTaskFreer freer, int32 magicNum );
142 inline
143 void *
144 PR_int__create_lang_meta_task_in_slave( int32 size, LangMetaTaskFreer freer,
145 SlaveVP *slave, int32 magicNum );
147 inline
148 PRMetaTask *
149 PR_int__create_generic_slave_meta_task( void *initData );
151 void
152 PR_int__free_lang_meta_task_and_remove_from_coll( void *langMetaTask );
154 inline
155 void
156 PR_int__insert_meta_task_into_slave( PRMetaTask *task, SlaveVP *slave );
158 inline
159 void
160 PR_int__insert_lang_meta_task_into_slave__ML( void *langMetaTask, SlaveVP *slave );
162 inline
163 void *
164 PR_int__give_lang_meta_task_from_slave( SlaveVP *slave, int32 magicNumer );
166 inline
167 SlaveVP *
168 PR_PI__give_slave_lang_meta_task_is_assigned_to( void *langMetaTask );
170 //==============
171 //=== Lang Data
172 //=
173 inline
174 void *
175 PR_PI__create_lang_data_in_slave( int32 size, LangDataFreer freer,
176 SlaveVP *slave, int32 magicNum );
178 inline
179 void *
180 PR_int__give_lang_data_from_slave( SlaveVP *slave, int32 magicNumer );
181 #define PR_WL__give_lang_data PR_int__give_lang_data_from_slave
183 inline
184 void *
185 PR_int__give_lang_data_of_prolog( PRLangData *langData);
187 //==================================================
188 //=== Collection
189 //=
190 PRCollElem ** //return an array of pointers
191 PR_int__make_collection_of_size( int32 numInColl );
193 inline
194 void
195 PR_int__insert_elem_into_collection( PRCollElem *elem, PRCollElem **coll, int32 hash );
197 inline
198 void *
199 PR_int__lookup_elem_in_collection( int32 hash, PRCollElem **coll );
201 inline
202 void
203 PR_int__remove_elem_from_collection( int32 hash, PRCollElem **coll );
205 inline
206 void
207 PR_int__set_collection_to_empty( PRCollElem **coll );
209 inline
210 void
211 PR_int__apply_Fn_to_all_in_collection( void (*Fn)(void *), PRCollElem **coll );
213 //===========
214 //===
215 //=
216 void
217 PR_int__error( char *msgStr );
219 void
220 PR_int__throw_exception( char *msgStr, SlaveVP *reqstSlv, PRExcp *excpData );
222 char *
223 PR_int__strDup( char *str );
225 inline void
226 PR_int__get_wrapper_lock();
228 inline void
229 PR_int__get_malloc_lock();
231 #define PR_int__release_master_lock() _PRTopEnv->masterLock = UNLOCKED
233 #define PR_int__release_wrapper_lock() _PRTopEnv->wrapperLock = UNLOCKED
235 #define PR_int__release_malloc_lock() _PRTopEnv->mallocLock = UNLOCKED
237 inline uint32_t
238 PR_int__randomNumber();
240 inline void
241 PR_int__backoff_for_TooLongToGetLock( int32 numTriesToGetLock );
243 #endif /* _PR_INT_H */