1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*******************************************************/
/* "C" Language Integrated Production System */
/* */
/* CLIPS Version 6.40 08/25/16 */
/* */
/* */
/*******************************************************/
/*************************************************************/
/* Purpose: Message-passing support functions */
/* */
/* Principal Programmer(s): */
/* Brian L. Dantes */
/* */
/* Contributing Programmer(s): */
/* */
/* Revision History: */
/* */
/* 6.23: Correction for FalseSymbol/TrueSymbol. DR0859 */
/* */
/* 6.24: Removed IMPERATIVE_MESSAGE_HANDLERS and */
/* AUXILIARY_MESSAGE_HANDLERS compilation flags. */
/* */
/* Renamed BOOLEAN macro type to intBool. */
/* */
/* 6.30: The return value of DirectMessage indicates */
/* whether an execution error has occurred. */
/* */
/* Removed conditional code for unsupported */
/* compilers/operating systems (IBM_MCW, */
/* MAC_MCW, and IBM_TBC). */
/* */
/* Changed garbage collection algorithm. */
/* */
/* Added const qualifiers to remove C++ */
/* deprecation warnings. */
/* */
/* Converted API macros to function calls. */
/* */
/* 6.40: Removed LOCALE definition. */
/* */
/* Pragma once and other inclusion changes. */
/* */
/* Added support for booleans with <stdbool.h>. */
/* */
/* Removed use of void pointers for specific */
/* data structures. */
/* */
/* ALLOW_ENVIRONMENT_GLOBALS no longer supported. */
/* */
/* UDF redesign. */
/* */
/*************************************************************/
#ifndef _H_msgpass
#pragma once
#define _H_msgpass
#define GetActiveInstance(theEnv) (GetNthMessageArgument(theEnv,0)->instanceValue)
#include "object.h"
typedef struct messageHandlerLink
{
DefmessageHandler *hnd;
struct messageHandlerLink *nxt;
struct messageHandlerLink *nxtInStack;
} HANDLER_LINK;
bool DirectMessage(Environment *,CLIPSLexeme *,Instance *,
UDFValue *,Expression *);
void Send(Environment *,CLIPSValue *,const char *,const char *,CLIPSValue *);
void DestroyHandlerLinks(Environment *,HANDLER_LINK *);
void SendCommand(Environment *,UDFContext *,UDFValue *);
UDFValue *GetNthMessageArgument(Environment *,int);
bool NextHandlerAvailable(Environment *);
void NextHandlerAvailableFunction(Environment *,UDFContext *,UDFValue *);
void CallNextHandler(Environment *,UDFContext *,UDFValue *);
void FindApplicableOfName(Environment *,Defclass *,HANDLER_LINK *[],
HANDLER_LINK *[],CLIPSLexeme *);
HANDLER_LINK *JoinHandlerLinks(Environment *,HANDLER_LINK *[],HANDLER_LINK *[],CLIPSLexeme *);
void PrintHandlerSlotGetFunction(Environment *,const char *,void *);
bool HandlerSlotGetFunction(Environment *,void *,UDFValue *);
void PrintHandlerSlotPutFunction(Environment *,const char *,void *);
bool HandlerSlotPutFunction(Environment *,void *,UDFValue *);
void DynamicHandlerGetSlot(Environment *,UDFContext *,UDFValue *);
void DynamicHandlerPutSlot(Environment *,UDFContext *,UDFValue *);
#endif /* _H_object */