clipsruby 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/ext/clipsruby/agenda.c +1373 -0
- data/ext/clipsruby/agenda.h +169 -0
- data/ext/clipsruby/analysis.c +1142 -0
- data/ext/clipsruby/analysis.h +61 -0
- data/ext/clipsruby/argacces.c +526 -0
- data/ext/clipsruby/argacces.h +77 -0
- data/ext/clipsruby/bload.c +884 -0
- data/ext/clipsruby/bload.h +94 -0
- data/ext/clipsruby/bmathfun.c +557 -0
- data/ext/clipsruby/bmathfun.h +66 -0
- data/ext/clipsruby/bsave.c +634 -0
- data/ext/clipsruby/bsave.h +130 -0
- data/ext/clipsruby/classcom.c +976 -0
- data/ext/clipsruby/classcom.h +115 -0
- data/ext/clipsruby/classexm.c +1376 -0
- data/ext/clipsruby/classexm.h +97 -0
- data/ext/clipsruby/classfun.c +1392 -0
- data/ext/clipsruby/classfun.h +164 -0
- data/ext/clipsruby/classinf.c +1245 -0
- data/ext/clipsruby/classinf.h +94 -0
- data/ext/clipsruby/classini.c +843 -0
- data/ext/clipsruby/classini.h +75 -0
- data/ext/clipsruby/classpsr.c +957 -0
- data/ext/clipsruby/classpsr.h +73 -0
- data/ext/clipsruby/clips.h +133 -0
- data/ext/clipsruby/clipsruby.c +619 -0
- data/ext/clipsruby/clsltpsr.c +931 -0
- data/ext/clipsruby/clsltpsr.h +72 -0
- data/ext/clipsruby/commline.c +1217 -0
- data/ext/clipsruby/commline.h +131 -0
- data/ext/clipsruby/conscomp.c +1593 -0
- data/ext/clipsruby/conscomp.h +150 -0
- data/ext/clipsruby/constant.h +264 -0
- data/ext/clipsruby/constrct.c +1090 -0
- data/ext/clipsruby/constrct.h +216 -0
- data/ext/clipsruby/constrnt.c +554 -0
- data/ext/clipsruby/constrnt.h +132 -0
- data/ext/clipsruby/crstrtgy.c +1088 -0
- data/ext/clipsruby/crstrtgy.h +85 -0
- data/ext/clipsruby/cstrcbin.c +185 -0
- data/ext/clipsruby/cstrcbin.h +61 -0
- data/ext/clipsruby/cstrccmp.h +43 -0
- data/ext/clipsruby/cstrccom.c +1791 -0
- data/ext/clipsruby/cstrccom.h +115 -0
- data/ext/clipsruby/cstrcpsr.c +835 -0
- data/ext/clipsruby/cstrcpsr.h +97 -0
- data/ext/clipsruby/cstrnbin.c +282 -0
- data/ext/clipsruby/cstrnbin.h +55 -0
- data/ext/clipsruby/cstrnchk.c +826 -0
- data/ext/clipsruby/cstrnchk.h +91 -0
- data/ext/clipsruby/cstrncmp.c +238 -0
- data/ext/clipsruby/cstrncmp.h +57 -0
- data/ext/clipsruby/cstrnops.c +1176 -0
- data/ext/clipsruby/cstrnops.h +47 -0
- data/ext/clipsruby/cstrnpsr.c +1394 -0
- data/ext/clipsruby/cstrnpsr.h +88 -0
- data/ext/clipsruby/cstrnutl.c +564 -0
- data/ext/clipsruby/cstrnutl.h +54 -0
- data/ext/clipsruby/default.c +454 -0
- data/ext/clipsruby/default.h +57 -0
- data/ext/clipsruby/defins.c +971 -0
- data/ext/clipsruby/defins.h +127 -0
- data/ext/clipsruby/developr.c +677 -0
- data/ext/clipsruby/developr.h +69 -0
- data/ext/clipsruby/dffctbin.c +477 -0
- data/ext/clipsruby/dffctbin.h +76 -0
- data/ext/clipsruby/dffctbsc.c +308 -0
- data/ext/clipsruby/dffctbsc.h +72 -0
- data/ext/clipsruby/dffctcmp.c +297 -0
- data/ext/clipsruby/dffctcmp.h +44 -0
- data/ext/clipsruby/dffctdef.c +364 -0
- data/ext/clipsruby/dffctdef.h +104 -0
- data/ext/clipsruby/dffctpsr.c +179 -0
- data/ext/clipsruby/dffctpsr.h +49 -0
- data/ext/clipsruby/dffnxbin.c +520 -0
- data/ext/clipsruby/dffnxbin.h +67 -0
- data/ext/clipsruby/dffnxcmp.c +378 -0
- data/ext/clipsruby/dffnxcmp.h +54 -0
- data/ext/clipsruby/dffnxexe.c +241 -0
- data/ext/clipsruby/dffnxexe.h +58 -0
- data/ext/clipsruby/dffnxfun.c +1192 -0
- data/ext/clipsruby/dffnxfun.h +155 -0
- data/ext/clipsruby/dffnxpsr.c +514 -0
- data/ext/clipsruby/dffnxpsr.h +57 -0
- data/ext/clipsruby/dfinsbin.c +509 -0
- data/ext/clipsruby/dfinsbin.h +66 -0
- data/ext/clipsruby/dfinscmp.c +345 -0
- data/ext/clipsruby/dfinscmp.h +48 -0
- data/ext/clipsruby/drive.c +1191 -0
- data/ext/clipsruby/drive.h +65 -0
- data/ext/clipsruby/emathfun.c +1213 -0
- data/ext/clipsruby/emathfun.h +99 -0
- data/ext/clipsruby/engine.c +1568 -0
- data/ext/clipsruby/engine.h +203 -0
- data/ext/clipsruby/entities.h +276 -0
- data/ext/clipsruby/envrnbld.c +514 -0
- data/ext/clipsruby/envrnbld.h +40 -0
- data/ext/clipsruby/envrnmnt.c +257 -0
- data/ext/clipsruby/envrnmnt.h +112 -0
- data/ext/clipsruby/evaluatn.c +1736 -0
- data/ext/clipsruby/evaluatn.h +211 -0
- data/ext/clipsruby/expressn.c +494 -0
- data/ext/clipsruby/expressn.h +154 -0
- data/ext/clipsruby/exprnbin.c +538 -0
- data/ext/clipsruby/exprnbin.h +60 -0
- data/ext/clipsruby/exprnops.c +564 -0
- data/ext/clipsruby/exprnops.h +67 -0
- data/ext/clipsruby/exprnpsr.c +1112 -0
- data/ext/clipsruby/exprnpsr.h +98 -0
- data/ext/clipsruby/extconf.rb +2 -0
- data/ext/clipsruby/extnfunc.c +1015 -0
- data/ext/clipsruby/extnfunc.h +157 -0
- data/ext/clipsruby/factbin.c +447 -0
- data/ext/clipsruby/factbin.h +56 -0
- data/ext/clipsruby/factbld.c +1035 -0
- data/ext/clipsruby/factbld.h +63 -0
- data/ext/clipsruby/factcmp.c +386 -0
- data/ext/clipsruby/factcmp.h +46 -0
- data/ext/clipsruby/factcom.c +759 -0
- data/ext/clipsruby/factcom.h +80 -0
- data/ext/clipsruby/factfile.c +1761 -0
- data/ext/clipsruby/factfile.h +54 -0
- data/ext/clipsruby/factfun.c +682 -0
- data/ext/clipsruby/factfun.h +77 -0
- data/ext/clipsruby/factgen.c +1305 -0
- data/ext/clipsruby/factgen.h +229 -0
- data/ext/clipsruby/facthsh.c +438 -0
- data/ext/clipsruby/facthsh.h +81 -0
- data/ext/clipsruby/factlhs.c +250 -0
- data/ext/clipsruby/factlhs.h +54 -0
- data/ext/clipsruby/factmch.c +905 -0
- data/ext/clipsruby/factmch.h +68 -0
- data/ext/clipsruby/factmngr.c +3373 -0
- data/ext/clipsruby/factmngr.h +325 -0
- data/ext/clipsruby/factprt.c +498 -0
- data/ext/clipsruby/factprt.h +60 -0
- data/ext/clipsruby/factqpsr.c +796 -0
- data/ext/clipsruby/factqpsr.h +61 -0
- data/ext/clipsruby/factqury.c +1267 -0
- data/ext/clipsruby/factqury.h +112 -0
- data/ext/clipsruby/factrete.c +978 -0
- data/ext/clipsruby/factrete.h +70 -0
- data/ext/clipsruby/factrhs.c +667 -0
- data/ext/clipsruby/factrhs.h +55 -0
- data/ext/clipsruby/filecom.c +353 -0
- data/ext/clipsruby/filecom.h +137 -0
- data/ext/clipsruby/filertr.c +481 -0
- data/ext/clipsruby/filertr.h +94 -0
- data/ext/clipsruby/fileutil.c +1020 -0
- data/ext/clipsruby/fileutil.h +50 -0
- data/ext/clipsruby/generate.c +1079 -0
- data/ext/clipsruby/generate.h +57 -0
- data/ext/clipsruby/genrcbin.c +902 -0
- data/ext/clipsruby/genrcbin.h +69 -0
- data/ext/clipsruby/genrccmp.c +640 -0
- data/ext/clipsruby/genrccmp.h +59 -0
- data/ext/clipsruby/genrccom.c +2017 -0
- data/ext/clipsruby/genrccom.h +119 -0
- data/ext/clipsruby/genrcexe.c +737 -0
- data/ext/clipsruby/genrcexe.h +73 -0
- data/ext/clipsruby/genrcfun.c +890 -0
- data/ext/clipsruby/genrcfun.h +185 -0
- data/ext/clipsruby/genrcpsr.c +1618 -0
- data/ext/clipsruby/genrcpsr.h +80 -0
- data/ext/clipsruby/globlbin.c +458 -0
- data/ext/clipsruby/globlbin.h +71 -0
- data/ext/clipsruby/globlbsc.c +361 -0
- data/ext/clipsruby/globlbsc.h +83 -0
- data/ext/clipsruby/globlcmp.c +330 -0
- data/ext/clipsruby/globlcmp.h +52 -0
- data/ext/clipsruby/globlcom.c +289 -0
- data/ext/clipsruby/globlcom.h +63 -0
- data/ext/clipsruby/globldef.c +1087 -0
- data/ext/clipsruby/globldef.h +151 -0
- data/ext/clipsruby/globlpsr.c +530 -0
- data/ext/clipsruby/globlpsr.h +59 -0
- data/ext/clipsruby/immthpsr.c +431 -0
- data/ext/clipsruby/immthpsr.h +55 -0
- data/ext/clipsruby/incrrset.c +530 -0
- data/ext/clipsruby/incrrset.h +73 -0
- data/ext/clipsruby/inherpsr.c +850 -0
- data/ext/clipsruby/inherpsr.h +52 -0
- data/ext/clipsruby/inscom.c +2076 -0
- data/ext/clipsruby/inscom.h +182 -0
- data/ext/clipsruby/insfile.c +1764 -0
- data/ext/clipsruby/insfile.h +96 -0
- data/ext/clipsruby/insfun.c +1451 -0
- data/ext/clipsruby/insfun.h +134 -0
- data/ext/clipsruby/insmngr.c +2550 -0
- data/ext/clipsruby/insmngr.h +125 -0
- data/ext/clipsruby/insmoddp.c +1041 -0
- data/ext/clipsruby/insmoddp.h +91 -0
- data/ext/clipsruby/insmult.c +804 -0
- data/ext/clipsruby/insmult.h +62 -0
- data/ext/clipsruby/inspsr.c +602 -0
- data/ext/clipsruby/inspsr.h +60 -0
- data/ext/clipsruby/insquery.c +1278 -0
- data/ext/clipsruby/insquery.h +115 -0
- data/ext/clipsruby/insqypsr.c +729 -0
- data/ext/clipsruby/insqypsr.h +63 -0
- data/ext/clipsruby/iofun.c +2045 -0
- data/ext/clipsruby/iofun.h +116 -0
- data/ext/clipsruby/lgcldpnd.c +644 -0
- data/ext/clipsruby/lgcldpnd.h +75 -0
- data/ext/clipsruby/main.c +112 -0
- data/ext/clipsruby/match.h +142 -0
- data/ext/clipsruby/memalloc.c +481 -0
- data/ext/clipsruby/memalloc.h +197 -0
- data/ext/clipsruby/miscfun.c +1801 -0
- data/ext/clipsruby/miscfun.h +132 -0
- data/ext/clipsruby/modulbin.c +607 -0
- data/ext/clipsruby/modulbin.h +84 -0
- data/ext/clipsruby/modulbsc.c +347 -0
- data/ext/clipsruby/modulbsc.h +67 -0
- data/ext/clipsruby/modulcmp.c +499 -0
- data/ext/clipsruby/modulcmp.h +54 -0
- data/ext/clipsruby/moduldef.c +817 -0
- data/ext/clipsruby/moduldef.h +271 -0
- data/ext/clipsruby/modulpsr.c +1150 -0
- data/ext/clipsruby/modulpsr.h +69 -0
- data/ext/clipsruby/modulutl.c +1036 -0
- data/ext/clipsruby/modulutl.h +84 -0
- data/ext/clipsruby/msgcom.c +1221 -0
- data/ext/clipsruby/msgcom.h +125 -0
- data/ext/clipsruby/msgfun.c +1076 -0
- data/ext/clipsruby/msgfun.h +118 -0
- data/ext/clipsruby/msgpass.c +1441 -0
- data/ext/clipsruby/msgpass.h +103 -0
- data/ext/clipsruby/msgpsr.c +698 -0
- data/ext/clipsruby/msgpsr.h +73 -0
- data/ext/clipsruby/multifld.c +1404 -0
- data/ext/clipsruby/multifld.h +130 -0
- data/ext/clipsruby/multifun.c +2182 -0
- data/ext/clipsruby/multifun.h +102 -0
- data/ext/clipsruby/network.h +142 -0
- data/ext/clipsruby/objbin.c +1522 -0
- data/ext/clipsruby/objbin.h +79 -0
- data/ext/clipsruby/objcmp.c +1507 -0
- data/ext/clipsruby/objcmp.h +71 -0
- data/ext/clipsruby/object.h +260 -0
- data/ext/clipsruby/objrtbin.c +701 -0
- data/ext/clipsruby/objrtbin.h +79 -0
- data/ext/clipsruby/objrtbld.c +2393 -0
- data/ext/clipsruby/objrtbld.h +66 -0
- data/ext/clipsruby/objrtcmp.c +734 -0
- data/ext/clipsruby/objrtcmp.h +66 -0
- data/ext/clipsruby/objrtfnx.c +1330 -0
- data/ext/clipsruby/objrtfnx.h +222 -0
- data/ext/clipsruby/objrtgen.c +736 -0
- data/ext/clipsruby/objrtgen.h +63 -0
- data/ext/clipsruby/objrtmch.c +1524 -0
- data/ext/clipsruby/objrtmch.h +160 -0
- data/ext/clipsruby/parsefun.c +415 -0
- data/ext/clipsruby/parsefun.h +67 -0
- data/ext/clipsruby/pattern.c +1265 -0
- data/ext/clipsruby/pattern.h +163 -0
- data/ext/clipsruby/pprint.c +328 -0
- data/ext/clipsruby/pprint.h +79 -0
- data/ext/clipsruby/prccode.c +1478 -0
- data/ext/clipsruby/prccode.h +145 -0
- data/ext/clipsruby/prcdrfun.c +640 -0
- data/ext/clipsruby/prcdrfun.h +95 -0
- data/ext/clipsruby/prcdrpsr.c +1068 -0
- data/ext/clipsruby/prcdrpsr.h +79 -0
- data/ext/clipsruby/prdctfun.c +869 -0
- data/ext/clipsruby/prdctfun.h +77 -0
- data/ext/clipsruby/prntutil.c +878 -0
- data/ext/clipsruby/prntutil.h +125 -0
- data/ext/clipsruby/proflfun.c +827 -0
- data/ext/clipsruby/proflfun.h +118 -0
- data/ext/clipsruby/reorder.c +2082 -0
- data/ext/clipsruby/reorder.h +172 -0
- data/ext/clipsruby/reteutil.c +1732 -0
- data/ext/clipsruby/reteutil.h +111 -0
- data/ext/clipsruby/retract.c +710 -0
- data/ext/clipsruby/retract.h +74 -0
- data/ext/clipsruby/router.c +737 -0
- data/ext/clipsruby/router.h +147 -0
- data/ext/clipsruby/rulebin.c +1136 -0
- data/ext/clipsruby/rulebin.h +153 -0
- data/ext/clipsruby/rulebld.c +1328 -0
- data/ext/clipsruby/rulebld.h +62 -0
- data/ext/clipsruby/rulebsc.c +517 -0
- data/ext/clipsruby/rulebsc.h +91 -0
- data/ext/clipsruby/rulecmp.c +733 -0
- data/ext/clipsruby/rulecmp.h +63 -0
- data/ext/clipsruby/rulecom.c +1583 -0
- data/ext/clipsruby/rulecom.h +116 -0
- data/ext/clipsruby/rulecstr.c +892 -0
- data/ext/clipsruby/rulecstr.h +53 -0
- data/ext/clipsruby/ruledef.c +559 -0
- data/ext/clipsruby/ruledef.h +179 -0
- data/ext/clipsruby/ruledlt.c +599 -0
- data/ext/clipsruby/ruledlt.h +58 -0
- data/ext/clipsruby/rulelhs.c +1216 -0
- data/ext/clipsruby/rulelhs.h +52 -0
- data/ext/clipsruby/rulepsr.c +1073 -0
- data/ext/clipsruby/rulepsr.h +61 -0
- data/ext/clipsruby/scanner.c +856 -0
- data/ext/clipsruby/scanner.h +112 -0
- data/ext/clipsruby/setup.h +488 -0
- data/ext/clipsruby/sortfun.c +433 -0
- data/ext/clipsruby/sortfun.h +55 -0
- data/ext/clipsruby/strngfun.c +1173 -0
- data/ext/clipsruby/strngfun.h +96 -0
- data/ext/clipsruby/strngrtr.c +523 -0
- data/ext/clipsruby/strngrtr.h +97 -0
- data/ext/clipsruby/symblbin.c +648 -0
- data/ext/clipsruby/symblbin.h +64 -0
- data/ext/clipsruby/symblcmp.c +893 -0
- data/ext/clipsruby/symblcmp.h +61 -0
- data/ext/clipsruby/symbol.c +1961 -0
- data/ext/clipsruby/symbol.h +243 -0
- data/ext/clipsruby/sysdep.c +894 -0
- data/ext/clipsruby/sysdep.h +164 -0
- data/ext/clipsruby/textpro.c +1388 -0
- data/ext/clipsruby/textpro.h +77 -0
- data/ext/clipsruby/tmpltbin.c +609 -0
- data/ext/clipsruby/tmpltbin.h +108 -0
- data/ext/clipsruby/tmpltbsc.c +327 -0
- data/ext/clipsruby/tmpltbsc.h +87 -0
- data/ext/clipsruby/tmpltcmp.c +450 -0
- data/ext/clipsruby/tmpltcmp.h +57 -0
- data/ext/clipsruby/tmpltdef.c +584 -0
- data/ext/clipsruby/tmpltdef.h +155 -0
- data/ext/clipsruby/tmpltfun.c +2477 -0
- data/ext/clipsruby/tmpltfun.h +122 -0
- data/ext/clipsruby/tmpltlhs.c +379 -0
- data/ext/clipsruby/tmpltlhs.h +50 -0
- data/ext/clipsruby/tmpltpsr.c +819 -0
- data/ext/clipsruby/tmpltpsr.h +59 -0
- data/ext/clipsruby/tmpltrhs.c +595 -0
- data/ext/clipsruby/tmpltrhs.h +55 -0
- data/ext/clipsruby/tmpltutl.c +637 -0
- data/ext/clipsruby/tmpltutl.h +82 -0
- data/ext/clipsruby/userdata.c +156 -0
- data/ext/clipsruby/userdata.h +72 -0
- data/ext/clipsruby/userfunctions.c +70 -0
- data/ext/clipsruby/usrsetup.h +7 -0
- data/ext/clipsruby/utility.c +1594 -0
- data/ext/clipsruby/utility.h +250 -0
- data/ext/clipsruby/watch.c +865 -0
- data/ext/clipsruby/watch.h +124 -0
- data/lib/clipsruby.rb +1 -0
- metadata +388 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
/*******************************************************/
|
2
|
+
/* "C" Language Integrated Production System */
|
3
|
+
/* */
|
4
|
+
/* CLIPS Version 6.40 07/30/16 */
|
5
|
+
/* */
|
6
|
+
/* */
|
7
|
+
/*******************************************************/
|
8
|
+
|
9
|
+
/*************************************************************/
|
10
|
+
/* Purpose: */
|
11
|
+
/* */
|
12
|
+
/* Principal Programmer(s): */
|
13
|
+
/* Brian L. Dantes */
|
14
|
+
/* */
|
15
|
+
/* Contributing Programmer(s): */
|
16
|
+
/* */
|
17
|
+
/* Revision History: */
|
18
|
+
/* */
|
19
|
+
/* 6.24: Renamed BOOLEAN macro type to intBool. */
|
20
|
+
/* */
|
21
|
+
/* If the last construct in a loaded file is a */
|
22
|
+
/* deffunction or defmethod with no closing right */
|
23
|
+
/* parenthesis, an error should be issued, but is */
|
24
|
+
/* not. DR0872 */
|
25
|
+
/* */
|
26
|
+
/* 6.30: Changed integer type/precision. */
|
27
|
+
/* */
|
28
|
+
/* GetConstructNameAndComment API change. */
|
29
|
+
/* */
|
30
|
+
/* Support for long long integers. */
|
31
|
+
/* */
|
32
|
+
/* Used gensprintf instead of sprintf. */
|
33
|
+
/* */
|
34
|
+
/* Added const qualifiers to remove C++ */
|
35
|
+
/* deprecation warnings. */
|
36
|
+
/* */
|
37
|
+
/* Converted API macros to function calls. */
|
38
|
+
/* */
|
39
|
+
/* Fixed linkage issue when BLOAD_AND_SAVE */
|
40
|
+
/* compiler flag is set to 0. */
|
41
|
+
/* */
|
42
|
+
/* Fixed typing issue when OBJECT_SYSTEM */
|
43
|
+
/* compiler flag is set to 0. */
|
44
|
+
/* */
|
45
|
+
/* 6.40: Removed LOCALE definition. */
|
46
|
+
/* */
|
47
|
+
/* Pragma once and other inclusion changes. */
|
48
|
+
/* */
|
49
|
+
/* Added support for booleans with <stdbool.h>. */
|
50
|
+
/* */
|
51
|
+
/* Removed use of void pointers for specific */
|
52
|
+
/* data structures. */
|
53
|
+
/* */
|
54
|
+
/*************************************************************/
|
55
|
+
|
56
|
+
#ifndef _H_genrcpsr
|
57
|
+
|
58
|
+
#pragma once
|
59
|
+
|
60
|
+
#define _H_genrcpsr
|
61
|
+
|
62
|
+
#if DEFGENERIC_CONSTRUCT && (! BLOAD_ONLY) && (! RUN_TIME)
|
63
|
+
|
64
|
+
#include "genrcfun.h"
|
65
|
+
|
66
|
+
bool ParseDefgeneric(Environment *,const char *);
|
67
|
+
bool ParseDefmethod(Environment *,const char *);
|
68
|
+
Defmethod *AddMethod(Environment *,Defgeneric *,Defmethod *,int,unsigned short,Expression *,
|
69
|
+
unsigned short,unsigned short,CLIPSLexeme *,Expression *,char *,bool);
|
70
|
+
void PackRestrictionTypes(Environment *,RESTRICTION *,Expression *);
|
71
|
+
void DeleteTempRestricts(Environment *,Expression *);
|
72
|
+
Defmethod *FindMethodByRestrictions(Defgeneric *,Expression *,int,
|
73
|
+
CLIPSLexeme *,int *);
|
74
|
+
|
75
|
+
#endif /* DEFGENERIC_CONSTRUCT && (! BLOAD_ONLY) && (! RUN_TIME) */
|
76
|
+
|
77
|
+
#endif /* _H_genrcpsr */
|
78
|
+
|
79
|
+
|
80
|
+
|
@@ -0,0 +1,458 @@
|
|
1
|
+
/*******************************************************/
|
2
|
+
/* "C" Language Integrated Production System */
|
3
|
+
/* */
|
4
|
+
/* CLIPS Version 6.40 07/30/16 */
|
5
|
+
/* */
|
6
|
+
/* DEFGLOBAL BSAVE/BLOAD MODULE */
|
7
|
+
/*******************************************************/
|
8
|
+
|
9
|
+
/*************************************************************/
|
10
|
+
/* Purpose: Implements the binary save/load feature for the */
|
11
|
+
/* defglobal construct. */
|
12
|
+
/* */
|
13
|
+
/* Principal Programmer(s): */
|
14
|
+
/* Gary D. Riley */
|
15
|
+
/* */
|
16
|
+
/* Contributing Programmer(s): */
|
17
|
+
/* Brian L. Dantes */
|
18
|
+
/* */
|
19
|
+
/* Revision History: */
|
20
|
+
/* */
|
21
|
+
/* 6.30: Changed integer type/precision. */
|
22
|
+
/* */
|
23
|
+
/* Moved WatchGlobals global to defglobalData. */
|
24
|
+
/* */
|
25
|
+
/* 6.40: Pragma once and other inclusion changes. */
|
26
|
+
/* */
|
27
|
+
/* Removed use of void pointers for specific */
|
28
|
+
/* data structures. */
|
29
|
+
/* */
|
30
|
+
/*************************************************************/
|
31
|
+
|
32
|
+
#include "setup.h"
|
33
|
+
|
34
|
+
#if DEFGLOBAL_CONSTRUCT && (BLOAD || BLOAD_AND_BSAVE || BLOAD_ONLY) && (! RUN_TIME)
|
35
|
+
|
36
|
+
#include <stdio.h>
|
37
|
+
|
38
|
+
#include "bload.h"
|
39
|
+
#include "bsave.h"
|
40
|
+
#include "envrnmnt.h"
|
41
|
+
#include "globlbsc.h"
|
42
|
+
#include "globldef.h"
|
43
|
+
#include "memalloc.h"
|
44
|
+
#include "moduldef.h"
|
45
|
+
#include "multifld.h"
|
46
|
+
|
47
|
+
#include "globlbin.h"
|
48
|
+
|
49
|
+
/***************************************/
|
50
|
+
/* LOCAL INTERNAL FUNCTION DEFINITIONS */
|
51
|
+
/***************************************/
|
52
|
+
|
53
|
+
#if BLOAD_AND_BSAVE
|
54
|
+
static void BsaveFind(Environment *);
|
55
|
+
static void BsaveStorage(Environment *,FILE *);
|
56
|
+
static void BsaveBinaryItem(Environment *,FILE *);
|
57
|
+
#endif
|
58
|
+
static void BloadStorageDefglobals(Environment *);
|
59
|
+
static void BloadBinaryItem(Environment *);
|
60
|
+
static void UpdateDefglobalModule(Environment *,void *,unsigned long);
|
61
|
+
static void UpdateDefglobal(Environment *,void *,unsigned long);
|
62
|
+
static void ClearBload(Environment *);
|
63
|
+
static void DeallocateDefglobalBloadData(Environment *);
|
64
|
+
|
65
|
+
/*********************************************/
|
66
|
+
/* DefglobalBinarySetup: Installs the binary */
|
67
|
+
/* save/load feature for the defglobals. */
|
68
|
+
/*********************************************/
|
69
|
+
void DefglobalBinarySetup(
|
70
|
+
Environment *theEnv)
|
71
|
+
{
|
72
|
+
AllocateEnvironmentData(theEnv,GLOBLBIN_DATA,sizeof(struct defglobalBinaryData),DeallocateDefglobalBloadData);
|
73
|
+
#if (BLOAD_AND_BSAVE || BLOAD)
|
74
|
+
AddAfterBloadFunction(theEnv,"defglobal",ResetDefglobals,50,NULL);
|
75
|
+
#endif
|
76
|
+
|
77
|
+
#if BLOAD_AND_BSAVE
|
78
|
+
AddBinaryItem(theEnv,"defglobal",0,BsaveFind,NULL,
|
79
|
+
BsaveStorage,BsaveBinaryItem,
|
80
|
+
BloadStorageDefglobals,BloadBinaryItem,
|
81
|
+
ClearBload);
|
82
|
+
#endif
|
83
|
+
|
84
|
+
#if (BLOAD || BLOAD_ONLY)
|
85
|
+
AddBinaryItem(theEnv,"defglobal",0,NULL,NULL,NULL,NULL,
|
86
|
+
BloadStorageDefglobals,BloadBinaryItem,
|
87
|
+
ClearBload);
|
88
|
+
#endif
|
89
|
+
}
|
90
|
+
|
91
|
+
/*********************************************************/
|
92
|
+
/* DeallocateDefglobalBloadData: Deallocates environment */
|
93
|
+
/* data for the defglobal bsave functionality. */
|
94
|
+
/*********************************************************/
|
95
|
+
static void DeallocateDefglobalBloadData(
|
96
|
+
Environment *theEnv)
|
97
|
+
{
|
98
|
+
#if (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE) && (! RUN_TIME)
|
99
|
+
size_t space;
|
100
|
+
unsigned long i;
|
101
|
+
|
102
|
+
for (i = 0; i < DefglobalBinaryData(theEnv)->NumberOfDefglobals; i++)
|
103
|
+
{
|
104
|
+
if (DefglobalBinaryData(theEnv)->DefglobalArray[i].current.header->type == MULTIFIELD_TYPE)
|
105
|
+
{ ReturnMultifield(theEnv,DefglobalBinaryData(theEnv)->DefglobalArray[i].current.multifieldValue); }
|
106
|
+
}
|
107
|
+
|
108
|
+
space = DefglobalBinaryData(theEnv)->NumberOfDefglobals * sizeof(Defglobal);
|
109
|
+
if (space != 0)
|
110
|
+
{ genfree(theEnv,DefglobalBinaryData(theEnv)->DefglobalArray,space); }
|
111
|
+
|
112
|
+
space = DefglobalBinaryData(theEnv)->NumberOfDefglobalModules * sizeof(struct defglobalModule);
|
113
|
+
if (space != 0)
|
114
|
+
{ genfree(theEnv,DefglobalBinaryData(theEnv)->ModuleArray,space); }
|
115
|
+
#endif
|
116
|
+
}
|
117
|
+
|
118
|
+
#if BLOAD_AND_BSAVE
|
119
|
+
|
120
|
+
/****************************************************/
|
121
|
+
/* BsaveFind: Counts the number of data structures */
|
122
|
+
/* which must be saved in the binary image for */
|
123
|
+
/* the defglobals in the current environment. */
|
124
|
+
/****************************************************/
|
125
|
+
static void BsaveFind(
|
126
|
+
Environment *theEnv)
|
127
|
+
{
|
128
|
+
Defglobal *defglobalPtr;
|
129
|
+
Defmodule *theModule;
|
130
|
+
|
131
|
+
/*=======================================================*/
|
132
|
+
/* If a binary image is already loaded, then temporarily */
|
133
|
+
/* save the count values since these will be overwritten */
|
134
|
+
/* in the process of saving the binary image. */
|
135
|
+
/*=======================================================*/
|
136
|
+
|
137
|
+
SaveBloadCount(theEnv,DefglobalBinaryData(theEnv)->NumberOfDefglobalModules);
|
138
|
+
SaveBloadCount(theEnv,DefglobalBinaryData(theEnv)->NumberOfDefglobals);
|
139
|
+
|
140
|
+
/*============================================*/
|
141
|
+
/* Set the count of defglobals and defglobals */
|
142
|
+
/* module data structures to zero. */
|
143
|
+
/*============================================*/
|
144
|
+
|
145
|
+
DefglobalBinaryData(theEnv)->NumberOfDefglobals = 0;
|
146
|
+
DefglobalBinaryData(theEnv)->NumberOfDefglobalModules = 0;
|
147
|
+
|
148
|
+
for (theModule = GetNextDefmodule(theEnv,NULL);
|
149
|
+
theModule != NULL;
|
150
|
+
theModule = GetNextDefmodule(theEnv,theModule))
|
151
|
+
{
|
152
|
+
/*================================================*/
|
153
|
+
/* Set the current module to the module being */
|
154
|
+
/* examined and increment the number of defglobal */
|
155
|
+
/* modules encountered. */
|
156
|
+
/*================================================*/
|
157
|
+
|
158
|
+
SetCurrentModule(theEnv,theModule);
|
159
|
+
DefglobalBinaryData(theEnv)->NumberOfDefglobalModules++;
|
160
|
+
|
161
|
+
/*====================================================*/
|
162
|
+
/* Loop through each defglobal in the current module. */
|
163
|
+
/*====================================================*/
|
164
|
+
|
165
|
+
for (defglobalPtr = GetNextDefglobal(theEnv,NULL);
|
166
|
+
defglobalPtr != NULL;
|
167
|
+
defglobalPtr = GetNextDefglobal(theEnv,defglobalPtr))
|
168
|
+
{
|
169
|
+
/*======================================================*/
|
170
|
+
/* Initialize the construct header for the binary save. */
|
171
|
+
/*======================================================*/
|
172
|
+
|
173
|
+
MarkConstructHeaderNeededItems(&defglobalPtr->header,DefglobalBinaryData(theEnv)->NumberOfDefglobals++);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
/*****************************************************/
|
179
|
+
/* BsaveStorage: Writes out storage requirements for */
|
180
|
+
/* all defglobal structures to the binary file */
|
181
|
+
/*****************************************************/
|
182
|
+
static void BsaveStorage(
|
183
|
+
Environment *theEnv,
|
184
|
+
FILE *fp)
|
185
|
+
{
|
186
|
+
size_t space;
|
187
|
+
|
188
|
+
/*===========================================================*/
|
189
|
+
/* Only two data structures are saved as part of a defglobal */
|
190
|
+
/* binary image: the defglobal data structure and the */
|
191
|
+
/* defglobalModule data structure. */
|
192
|
+
/*===========================================================*/
|
193
|
+
|
194
|
+
space = sizeof(long) * 2;
|
195
|
+
GenWrite(&space,sizeof(size_t),fp);
|
196
|
+
GenWrite(&DefglobalBinaryData(theEnv)->NumberOfDefglobals,sizeof(long),fp);
|
197
|
+
GenWrite(&DefglobalBinaryData(theEnv)->NumberOfDefglobalModules,sizeof(long),fp);
|
198
|
+
}
|
199
|
+
|
200
|
+
/*********************************************/
|
201
|
+
/* BsaveBinaryItem: Writes out all defglobal */
|
202
|
+
/* structures to the binary file */
|
203
|
+
/*********************************************/
|
204
|
+
static void BsaveBinaryItem(
|
205
|
+
Environment *theEnv,
|
206
|
+
FILE *fp)
|
207
|
+
{
|
208
|
+
size_t space;
|
209
|
+
Defglobal *theDefglobal;
|
210
|
+
struct bsaveDefglobal newDefglobal;
|
211
|
+
Defmodule *theModule;
|
212
|
+
struct bsaveDefglobalModule tempDefglobalModule;
|
213
|
+
struct defglobalModule *theModuleItem;
|
214
|
+
|
215
|
+
/*==========================================================*/
|
216
|
+
/* Write out the amount of space taken up by the defglobal */
|
217
|
+
/* and defglobalModule data structures in the binary image. */
|
218
|
+
/*==========================================================*/
|
219
|
+
|
220
|
+
space = DefglobalBinaryData(theEnv)->NumberOfDefglobals * sizeof(struct bsaveDefglobal) +
|
221
|
+
(DefglobalBinaryData(theEnv)->NumberOfDefglobalModules * sizeof(struct bsaveDefglobalModule));
|
222
|
+
GenWrite(&space,sizeof(size_t),fp);
|
223
|
+
|
224
|
+
/*=================================================*/
|
225
|
+
/* Write out each defglobal module data structure. */
|
226
|
+
/*=================================================*/
|
227
|
+
|
228
|
+
DefglobalBinaryData(theEnv)->NumberOfDefglobals = 0;
|
229
|
+
for (theModule = GetNextDefmodule(theEnv,NULL);
|
230
|
+
theModule != NULL;
|
231
|
+
theModule = GetNextDefmodule(theEnv,theModule))
|
232
|
+
{
|
233
|
+
SetCurrentModule(theEnv,theModule);
|
234
|
+
|
235
|
+
theModuleItem = (struct defglobalModule *)
|
236
|
+
GetModuleItem(theEnv,NULL,FindModuleItem(theEnv,"defglobal")->moduleIndex);
|
237
|
+
AssignBsaveDefmdlItemHdrVals(&tempDefglobalModule.header,
|
238
|
+
&theModuleItem->header);
|
239
|
+
GenWrite(&tempDefglobalModule,sizeof(struct bsaveDefglobalModule),fp);
|
240
|
+
}
|
241
|
+
|
242
|
+
/*===========================*/
|
243
|
+
/* Write out each defglobal. */
|
244
|
+
/*===========================*/
|
245
|
+
|
246
|
+
DefglobalBinaryData(theEnv)->NumberOfDefglobals = 0;
|
247
|
+
for (theModule = GetNextDefmodule(theEnv,NULL);
|
248
|
+
theModule != NULL;
|
249
|
+
theModule = GetNextDefmodule(theEnv,theModule))
|
250
|
+
{
|
251
|
+
SetCurrentModule(theEnv,theModule);
|
252
|
+
|
253
|
+
for (theDefglobal = GetNextDefglobal(theEnv,NULL);
|
254
|
+
theDefglobal != NULL;
|
255
|
+
theDefglobal = GetNextDefglobal(theEnv,theDefglobal))
|
256
|
+
{
|
257
|
+
AssignBsaveConstructHeaderVals(&newDefglobal.header,
|
258
|
+
&theDefglobal->header);
|
259
|
+
newDefglobal.initial = HashedExpressionIndex(theEnv,theDefglobal->initial);
|
260
|
+
|
261
|
+
GenWrite(&newDefglobal,sizeof(struct bsaveDefglobal),fp);
|
262
|
+
}
|
263
|
+
}
|
264
|
+
|
265
|
+
/*=============================================================*/
|
266
|
+
/* If a binary image was already loaded when the bsave command */
|
267
|
+
/* was issued, then restore the counts indicating the number */
|
268
|
+
/* of defglobals and defglobal modules in the binary image */
|
269
|
+
/* (these were overwritten by the binary save). */
|
270
|
+
/*=============================================================*/
|
271
|
+
|
272
|
+
RestoreBloadCount(theEnv,&DefglobalBinaryData(theEnv)->NumberOfDefglobalModules);
|
273
|
+
RestoreBloadCount(theEnv,&DefglobalBinaryData(theEnv)->NumberOfDefglobals);
|
274
|
+
}
|
275
|
+
|
276
|
+
#endif /* BLOAD_AND_BSAVE */
|
277
|
+
|
278
|
+
/***********************************************/
|
279
|
+
/* BloadStorageDefglobals: Allocates space for */
|
280
|
+
/* the defglobals used by this binary image. */
|
281
|
+
/***********************************************/
|
282
|
+
static void BloadStorageDefglobals(
|
283
|
+
Environment *theEnv)
|
284
|
+
{
|
285
|
+
size_t space;
|
286
|
+
|
287
|
+
/*=======================================================*/
|
288
|
+
/* Determine the number of defglobal and defglobalModule */
|
289
|
+
/* data structures to be read. */
|
290
|
+
/*=======================================================*/
|
291
|
+
|
292
|
+
GenReadBinary(theEnv,&space,sizeof(size_t));
|
293
|
+
GenReadBinary(theEnv,&DefglobalBinaryData(theEnv)->NumberOfDefglobals,sizeof(long));
|
294
|
+
GenReadBinary(theEnv,&DefglobalBinaryData(theEnv)->NumberOfDefglobalModules,sizeof(long));
|
295
|
+
|
296
|
+
/*===================================*/
|
297
|
+
/* Allocate the space needed for the */
|
298
|
+
/* defglobalModule data structures. */
|
299
|
+
/*===================================*/
|
300
|
+
|
301
|
+
if (DefglobalBinaryData(theEnv)->NumberOfDefglobalModules == 0)
|
302
|
+
{
|
303
|
+
DefglobalBinaryData(theEnv)->DefglobalArray = NULL;
|
304
|
+
DefglobalBinaryData(theEnv)->ModuleArray = NULL;
|
305
|
+
}
|
306
|
+
|
307
|
+
space = DefglobalBinaryData(theEnv)->NumberOfDefglobalModules * sizeof(struct defglobalModule);
|
308
|
+
DefglobalBinaryData(theEnv)->ModuleArray = (struct defglobalModule *) genalloc(theEnv,space);
|
309
|
+
|
310
|
+
/*===================================*/
|
311
|
+
/* Allocate the space needed for the */
|
312
|
+
/* defglobal data structures. */
|
313
|
+
/*===================================*/
|
314
|
+
|
315
|
+
if (DefglobalBinaryData(theEnv)->NumberOfDefglobals == 0)
|
316
|
+
{
|
317
|
+
DefglobalBinaryData(theEnv)->DefglobalArray = NULL;
|
318
|
+
return;
|
319
|
+
}
|
320
|
+
|
321
|
+
space = (DefglobalBinaryData(theEnv)->NumberOfDefglobals * sizeof(Defglobal));
|
322
|
+
DefglobalBinaryData(theEnv)->DefglobalArray = (Defglobal *) genalloc(theEnv,space);
|
323
|
+
}
|
324
|
+
|
325
|
+
/******************************************************/
|
326
|
+
/* BloadBinaryItem: Loads and refreshes the defglobal */
|
327
|
+
/* constructs used by this binary image. */
|
328
|
+
/******************************************************/
|
329
|
+
static void BloadBinaryItem(
|
330
|
+
Environment *theEnv)
|
331
|
+
{
|
332
|
+
size_t space;
|
333
|
+
|
334
|
+
/*======================================================*/
|
335
|
+
/* Read in the amount of space used by the binary image */
|
336
|
+
/* (this is used to skip the construct in the event it */
|
337
|
+
/* is not available in the version being run). */
|
338
|
+
/*======================================================*/
|
339
|
+
|
340
|
+
GenReadBinary(theEnv,&space,sizeof(size_t));
|
341
|
+
|
342
|
+
/*=============================================*/
|
343
|
+
/* Read in the defglobalModule data structures */
|
344
|
+
/* and refresh the pointers. */
|
345
|
+
/*=============================================*/
|
346
|
+
|
347
|
+
BloadandRefresh(theEnv,DefglobalBinaryData(theEnv)->NumberOfDefglobalModules,
|
348
|
+
sizeof(struct bsaveDefglobalModule),
|
349
|
+
UpdateDefglobalModule);
|
350
|
+
|
351
|
+
/*=======================================*/
|
352
|
+
/* Read in the defglobal data structures */
|
353
|
+
/* and refresh the pointers. */
|
354
|
+
/*=======================================*/
|
355
|
+
|
356
|
+
BloadandRefresh(theEnv,DefglobalBinaryData(theEnv)->NumberOfDefglobals,
|
357
|
+
sizeof(struct bsaveDefglobal),
|
358
|
+
UpdateDefglobal);
|
359
|
+
}
|
360
|
+
|
361
|
+
/************************************************/
|
362
|
+
/* UpdateDefglobalModule: Bload refresh routine */
|
363
|
+
/* for defglobal module data structures. */
|
364
|
+
/************************************************/
|
365
|
+
static void UpdateDefglobalModule(
|
366
|
+
Environment *theEnv,
|
367
|
+
void *buf,
|
368
|
+
unsigned long obji)
|
369
|
+
{
|
370
|
+
struct bsaveDefglobalModule *bdmPtr;
|
371
|
+
|
372
|
+
bdmPtr = (struct bsaveDefglobalModule *) buf;
|
373
|
+
|
374
|
+
UpdateDefmoduleItemHeader(theEnv,&bdmPtr->header,&DefglobalBinaryData(theEnv)->ModuleArray[obji].header,
|
375
|
+
sizeof(Defglobal),
|
376
|
+
DefglobalBinaryData(theEnv)->DefglobalArray);
|
377
|
+
}
|
378
|
+
|
379
|
+
/******************************************/
|
380
|
+
/* UpdateDefglobal: Bload refresh routine */
|
381
|
+
/* for defglobal data structures. */
|
382
|
+
/******************************************/
|
383
|
+
static void UpdateDefglobal(
|
384
|
+
Environment *theEnv,
|
385
|
+
void *buf,
|
386
|
+
unsigned long obji)
|
387
|
+
{
|
388
|
+
struct bsaveDefglobal *bdp;
|
389
|
+
|
390
|
+
bdp = (struct bsaveDefglobal *) buf;
|
391
|
+
UpdateConstructHeader(theEnv,&bdp->header,&DefglobalBinaryData(theEnv)->DefglobalArray[obji].header,DEFGLOBAL,
|
392
|
+
sizeof(struct defglobalModule),DefglobalBinaryData(theEnv)->ModuleArray,
|
393
|
+
sizeof(Defglobal),DefglobalBinaryData(theEnv)->DefglobalArray);
|
394
|
+
|
395
|
+
#if DEBUGGING_FUNCTIONS
|
396
|
+
DefglobalBinaryData(theEnv)->DefglobalArray[obji].watch = DefglobalData(theEnv)->WatchGlobals;
|
397
|
+
#endif
|
398
|
+
DefglobalBinaryData(theEnv)->DefglobalArray[obji].initial = HashedExpressionPointer(bdp->initial);
|
399
|
+
DefglobalBinaryData(theEnv)->DefglobalArray[obji].current.voidValue = VoidConstant(theEnv);
|
400
|
+
}
|
401
|
+
|
402
|
+
/***************************************/
|
403
|
+
/* ClearBload: Defglobal clear routine */
|
404
|
+
/* when a binary load is in effect. */
|
405
|
+
/***************************************/
|
406
|
+
static void ClearBload(
|
407
|
+
Environment *theEnv)
|
408
|
+
{
|
409
|
+
unsigned long i;
|
410
|
+
size_t space;
|
411
|
+
|
412
|
+
/*=======================================================*/
|
413
|
+
/* Decrement in use counters for atomic values contained */
|
414
|
+
/* in the construct headers. Also decrement data */
|
415
|
+
/* structures used to store the defglobal's value. */
|
416
|
+
/*=======================================================*/
|
417
|
+
|
418
|
+
for (i = 0; i < DefglobalBinaryData(theEnv)->NumberOfDefglobals; i++)
|
419
|
+
{
|
420
|
+
UnmarkConstructHeader(theEnv,&DefglobalBinaryData(theEnv)->DefglobalArray[i].header);
|
421
|
+
|
422
|
+
Release(theEnv,DefglobalBinaryData(theEnv)->DefglobalArray[i].current.header);
|
423
|
+
if (DefglobalBinaryData(theEnv)->DefglobalArray[i].current.header->type == MULTIFIELD_TYPE)
|
424
|
+
{ ReturnMultifield(theEnv,DefglobalBinaryData(theEnv)->DefglobalArray[i].current.multifieldValue); }
|
425
|
+
}
|
426
|
+
|
427
|
+
/*==============================================================*/
|
428
|
+
/* Deallocate the space used for the defglobal data structures. */
|
429
|
+
/*==============================================================*/
|
430
|
+
|
431
|
+
space = DefglobalBinaryData(theEnv)->NumberOfDefglobals * sizeof(Defglobal);
|
432
|
+
if (space != 0) genfree(theEnv,DefglobalBinaryData(theEnv)->DefglobalArray,space);
|
433
|
+
DefglobalBinaryData(theEnv)->NumberOfDefglobals = 0;
|
434
|
+
|
435
|
+
/*=====================================================================*/
|
436
|
+
/* Deallocate the space used for the defglobal module data structures. */
|
437
|
+
/*=====================================================================*/
|
438
|
+
|
439
|
+
space = DefglobalBinaryData(theEnv)->NumberOfDefglobalModules * sizeof(struct defglobalModule);
|
440
|
+
if (space != 0) genfree(theEnv,DefglobalBinaryData(theEnv)->ModuleArray,space);
|
441
|
+
DefglobalBinaryData(theEnv)->NumberOfDefglobalModules = 0;
|
442
|
+
}
|
443
|
+
|
444
|
+
/********************************************************/
|
445
|
+
/* BloadDefglobalModuleReference: Returns the defglobal */
|
446
|
+
/* module pointer for using with the bload function. */
|
447
|
+
/********************************************************/
|
448
|
+
void *BloadDefglobalModuleReference(
|
449
|
+
Environment *theEnv,
|
450
|
+
unsigned long theIndex)
|
451
|
+
{
|
452
|
+
return (void *) &DefglobalBinaryData(theEnv)->ModuleArray[theIndex];
|
453
|
+
}
|
454
|
+
|
455
|
+
#endif /* DEFGLOBAL_CONSTRUCT && (BLOAD || BLOAD_AND_BSAVE || BLOAD_ONLY) && (! RUN_TIME) */
|
456
|
+
|
457
|
+
|
458
|
+
|
@@ -0,0 +1,71 @@
|
|
1
|
+
/*******************************************************/
|
2
|
+
/* "C" Language Integrated Production System */
|
3
|
+
/* */
|
4
|
+
/* CLIPS Version 6.40 07/30/16 */
|
5
|
+
/* */
|
6
|
+
/* DEFGLOBAL BINARY HEADER FILE */
|
7
|
+
/*******************************************************/
|
8
|
+
|
9
|
+
/*************************************************************/
|
10
|
+
/* Purpose: */
|
11
|
+
/* */
|
12
|
+
/* Principal Programmer(s): */
|
13
|
+
/* Gary D. Riley */
|
14
|
+
/* */
|
15
|
+
/* Contributing Programmer(s): */
|
16
|
+
/* Brian L. Dantes */
|
17
|
+
/* */
|
18
|
+
/* Revision History: */
|
19
|
+
/* */
|
20
|
+
/* 6.30: Changed integer type/precision. */
|
21
|
+
/* */
|
22
|
+
/* Moved WatchGlobals global to defglobalData. */
|
23
|
+
/* */
|
24
|
+
/* 6.40: Removed LOCALE definition. */
|
25
|
+
/* */
|
26
|
+
/* Pragma once and other inclusion changes. */
|
27
|
+
/* */
|
28
|
+
/*************************************************************/
|
29
|
+
|
30
|
+
#ifndef _H_globlbin
|
31
|
+
|
32
|
+
#pragma once
|
33
|
+
|
34
|
+
#define _H_globlbin
|
35
|
+
|
36
|
+
#include "modulbin.h"
|
37
|
+
#include "cstrcbin.h"
|
38
|
+
#include "globldef.h"
|
39
|
+
|
40
|
+
struct bsaveDefglobal
|
41
|
+
{
|
42
|
+
struct bsaveConstructHeader header;
|
43
|
+
unsigned long initial;
|
44
|
+
};
|
45
|
+
|
46
|
+
struct bsaveDefglobalModule
|
47
|
+
{
|
48
|
+
struct bsaveDefmoduleItemHeader header;
|
49
|
+
};
|
50
|
+
|
51
|
+
#define GLOBLBIN_DATA 60
|
52
|
+
|
53
|
+
struct defglobalBinaryData
|
54
|
+
{
|
55
|
+
Defglobal *DefglobalArray;
|
56
|
+
unsigned long NumberOfDefglobals;
|
57
|
+
struct defglobalModule *ModuleArray;
|
58
|
+
unsigned long NumberOfDefglobalModules;
|
59
|
+
};
|
60
|
+
|
61
|
+
#define DefglobalBinaryData(theEnv) ((struct defglobalBinaryData *) GetEnvironmentData(theEnv,GLOBLBIN_DATA))
|
62
|
+
|
63
|
+
#define DefglobalPointer(i) (&DefglobalBinaryData(theEnv)->DefglobalArray[i])
|
64
|
+
|
65
|
+
void DefglobalBinarySetup(Environment *);
|
66
|
+
void *BloadDefglobalModuleReference(Environment *,unsigned long);
|
67
|
+
|
68
|
+
#endif /* _H_globlbin */
|
69
|
+
|
70
|
+
|
71
|
+
|