Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
recmem.h
Go to the documentation of this file.
1 /*************************************************************************
2  * PLEASE SEE THE FILE "license.txt" (INCLUDED WITH THIS SOFTWARE PACKAGE)
3  * FOR LICENSE AND COPYRIGHT INFORMATION.
4  *************************************************************************/
5 
6 /* =======================================================================
7  recmem.h
8 
9  Init_firer() and init_chunker() should be called at startup time, to
10  do initialization.
11 
12  Do_preference_phase() runs the entire preference phase. This is called
13  from the top-level control in main.c.
14 
15  Possibly_deallocate_instantiation() checks whether an instantiation
16  can be deallocated yet, and does so if possible. This is used whenever
17  the (implicit) reference count on the instantiation decreases.
18 ======================================================================= */
19 
20 #ifndef RECMEM_H
21 #define RECMEM_H
22 
23 
24 #include "instantiations.h"
25 
26 /* TEMPORARY HACK (Ideally this should be doable through
27  the external kernel interface but for now using a
28  couple of global STL lists to get this information
29  from the rhs function to this prefference adding code)*/
30 extern wme* glbDeepCopyWMEs;
31 
32 #ifdef __cplusplus
33 //extern "C"
34 //{
35 #endif
36 
37 typedef char Bool;
38 typedef signed short goal_stack_level;
39 typedef struct agent_struct agent;
42 typedef struct wme_struct wme;
43 
44 
45 extern void init_firer (agent* thisAgent);
46 extern void do_preference_phase (agent* thisAgent);
47 
48 /* RBD Definitely need more comments here */
50 extern void fill_in_new_instantiation_stuff (agent* thisAgent, instantiation *inst,
51  Bool need_to_do_support_calculations);
52 
53 /* mvp 5-17-94 */
54 extern void build_prohibits_list (agent* thisAgent, instantiation *inst);
55 
56 extern void deallocate_instantiation (agent* thisAgent, instantiation *inst);
57 
58 #ifdef USE_MACROS
59 #define possibly_deallocate_instantiation(thisAgent, inst) { \
60  if ((! (inst)->preferences_generated) && \
61  (! (inst)->in_ms)) \
62  deallocate_instantiation (thisAgent, inst); }
63 
64 #else
65 inline void possibly_deallocate_instantiation(agent* thisAgent, instantiation * inst)
66 {
67  if ((! (inst)->preferences_generated) &&
68  (! (inst)->in_ms))
69  deallocate_instantiation (thisAgent, inst);
70 }
71 #endif /* USE_MACROS */
72 
73 extern Symbol *instantiate_rhs_value (agent* thisAgent, rhs_value rv, goal_stack_level new_id_level, char new_id_letter, struct token_struct *tok, wme *w);
74 
75 #ifdef __cplusplus
76 //}
77 #endif
78 
79 #endif