File: factqury.c-01.v6.23-bgfx.diff

package info (click to toggle)
python-clips 1.0.7.348%2Bclips-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,376 kB
  • ctags: 2,544
  • sloc: ansic: 17,065; python: 5,668; sh: 20; makefile: 12
file content (154 lines) | stat: -rw-r--r-- 5,641 bytes parent folder | download | duplicates (3)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
--- ../clipssrc_orig/factqury.c	Thu Jan 20 09:16:20 2005
+++ ../clipssrc/factqury.c	Sun Jan 22 15:48:04 2006
@@ -18,6 +18,8 @@
 /* Revision History:                                         */
 /*      6.23: Added fact-set queries.                        */
 /*                                                           */
+/*      6.24: Corrected errors when compiling as a C++ file. */
+/*                                                           */
 /*************************************************************/
 
 /* =========================================
@@ -181,7 +183,8 @@
       position = 1;
      }
 
-   else if (FindSlot(theFact->whichDeftemplate,temp.value,&position) == NULL)
+   else if (FindSlot((struct deftemplate *) theFact->whichDeftemplate,
+                     (struct symbolHashNode *) temp.value,&position) == NULL)
      {
       SlotExistError(theEnv,ValueToString(temp.value),"fact-set query");
       return;
@@ -710,7 +713,7 @@
   char *func,
   DATA_OBJECT *val)
   {
-   struct deftemplate *template;
+   struct deftemplate *templatePtr;
    QUERY_TEMPLATE *head,*bot,*tmp;
    register long i,end; /* 6.04 Bug Fix */
    char *templateName;
@@ -720,7 +723,7 @@
      {
       IncrementDeftemplateBusyCount(theEnv,(void *) val->value);
       head = get_struct(theEnv,query_template);
-      head->template = (struct deftemplate *) val->value;
+      head->templatePtr = (struct deftemplate *) val->value;
 
       head->chain = NULL;
       head->nxt = NULL;
@@ -735,17 +738,17 @@
          module specifier is not given
          =============================================== */
          
-      template = (struct deftemplate *)
+      templatePtr = (struct deftemplate *)
                        FindImportedConstruct(theEnv,"deftemplate",NULL,DOPToString(val),
                                              &count,TRUE,NULL);
-      if (template == NULL)
+      if (templatePtr == NULL)
         {
          CantFindItemInFunctionErrorMessage(theEnv,"deftemplate",DOPToString(val),func);
          return(NULL);
         }
-      IncrementDeftemplateBusyCount(theEnv,(void *) template);
+      IncrementDeftemplateBusyCount(theEnv,(void *) templatePtr);
       head = get_struct(theEnv,query_template);
-      head->template = template;
+      head->templatePtr = templatePtr;
 
       head->chain = NULL;
       head->nxt = NULL;
@@ -761,11 +764,11 @@
            {
             templateName = ValueToString(GetMFValue(val->value,i));
             
-            template = (struct deftemplate *)
+            templatePtr = (struct deftemplate *)
                        FindImportedConstruct(theEnv,"deftemplate",NULL,templateName,
                                              &count,TRUE,NULL);
 
-            if (template == NULL)
+            if (templatePtr == NULL)
               {
                CantFindItemInFunctionErrorMessage(theEnv,"deftemplate",templateName,func);
                DeleteQueryTemplates(theEnv,head);
@@ -777,9 +780,9 @@
             DeleteQueryTemplates(theEnv,head);
             return(NULL);
            }
-         IncrementDeftemplateBusyCount(theEnv,(void *) template);
+         IncrementDeftemplateBusyCount(theEnv,(void *) templatePtr);
          tmp = get_struct(theEnv,query_template);
-         tmp->template = template;
+         tmp->templatePtr = templatePtr;
 
          tmp->chain = NULL;
          tmp->nxt = NULL;
@@ -815,12 +818,12 @@
         {
          tmp = qlist->chain;
          qlist->chain = qlist->chain->chain;
-         DecrementDeftemplateBusyCount(theEnv,(void *) tmp->template);
+         DecrementDeftemplateBusyCount(theEnv,(void *) tmp->templatePtr);
          rtn_struct(theEnv,query_template,tmp);
         }
       tmp = qlist;
       qlist = qlist->nxt;
-      DecrementDeftemplateBusyCount(theEnv,(void *) tmp->template);
+      DecrementDeftemplateBusyCount(theEnv,(void *) tmp->templatePtr);
       rtn_struct(theEnv,query_template,tmp);
      }
   }
@@ -849,7 +852,7 @@
      {
       FactQueryData(theEnv)->AbortQuery = FALSE;
 
-      if (TestForFirstFactInTemplate(theEnv,qptr->template,qchain,indx))
+      if (TestForFirstFactInTemplate(theEnv,qptr->templatePtr,qchain,indx))
         { return(TRUE); }
         
       if ((EvaluationData(theEnv)->HaltExecution == TRUE) || (FactQueryData(theEnv)->AbortQuery == TRUE))
@@ -871,14 +874,14 @@
  *****************************************************************/
 static int TestForFirstFactInTemplate(
   void *theEnv,
-  struct deftemplate *template,
+  struct deftemplate *templatePtr,
   QUERY_TEMPLATE *qchain,
   int indx)
   {
    struct fact *theFact;
    DATA_OBJECT temp;
 
-   theFact = template->factList;
+   theFact = templatePtr->factList;
    while (theFact != NULL)
      {
       FactQueryData(theEnv)->QueryCore->solns[indx] = theFact;
@@ -945,7 +948,7 @@
      {
       FactQueryData(theEnv)->AbortQuery = FALSE;
 
-      TestEntireTemplate(theEnv,qptr->template,qchain,indx);
+      TestEntireTemplate(theEnv,qptr->templatePtr,qchain,indx);
 
       if ((EvaluationData(theEnv)->HaltExecution == TRUE) || (FactQueryData(theEnv)->AbortQuery == TRUE))
         return;
@@ -967,14 +970,14 @@
  *****************************************************************/
 static void TestEntireTemplate(
   void *theEnv,
-  struct deftemplate *template,
+  struct deftemplate *templatePtr,
   QUERY_TEMPLATE *qchain,
   int indx)
   {
    struct fact *theFact;
    DATA_OBJECT temp;
 
-   theFact = template->factList;
+   theFact = templatePtr->factList;
    while (theFact != NULL)
      {
       FactQueryData(theEnv)->QueryCore->solns[indx] = theFact;