Added -pedantic and -ansi to CFLAGS and cleaned warnings
[rice.git] / include / rice.h
blob4815f5bcfa21bc976cb949624e0eb95a70bbbf7f
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * RICE 4.0x Copyright (C) 1993 Rene' Jager *
3 * *
4 * *
5 * This toolbox is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License as *
7 * published by the Free Software Foundation; either version 2 of *
8 * the License, or (at your option) any later version. *
9 * *
10 * This toolbox is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this toolbox; if not, write to the: *
17 * *
18 * Free Software Foundation, Inc. *
19 * 675 Mass Ave, Cambridge *
20 * MA 02139, USA. *
21 * *
22 * See the RICE documentation for more information on the toolbox. *
23 * The file COPYING for the complete GNU General Public License. *
24 * *
25 * You can reach me by (preferably e-mail): *
26 * *
27 * Rene' Jager *
28 * *
29 * Delft University of Technology *
30 * Department of Electrical Engineering *
31 * Control Laboratory *
32 * *
33 * Room ET 12.06 *
34 * *
35 * Mekelweg 4 *
36 * P.O.Box 5031 *
37 * 2600 GA Delft *
38 * The Netherlands *
39 * *
40 * e-mail: R.Jager@ET.TUDelft.NL *
41 * phone: +31-15-78 51 14 *
42 * fax: +31-15-62 67 38 *
43 * telex: 38151 butud nl *
44 * *
45 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
48 File: rice.h
49 Author: Rene' Jager
50 Update: January 4, 1993
51 Info: main include file for RICE, see file rice.doc
55 /* prevent extra compilation */
57 #ifndef _RICE_H_
58 #define _RICE_H_
61 /* include header files */
63 #include <stdlib.h>
64 #include <string.h>
67 /* compiler characteristics */
69 #include <ricecomp.h>
72 /* define version and author */
74 #define RICE_NAME "RICE-NG"
75 #define RICE_VERSION 0.1
78 /* type definitions */
80 typedef RICE_PROTOTYPE(float (*RICE_NORM), (float, float));
81 typedef RICE_PROTOTYPE(void (*RICE_LINKER), (int, int, int, const char *[], float *, int *));
84 /* linker macro's */
86 #define RICE_Linker(func) RICE_FUNCTION(void func, \
87 (int rice_id, int rice_func, int rice_argc, const char *rice_argv[], \
88 float *rice_grade, int *rice_num), (rice_id, rice_func, rice_argc, \
89 rice_argv, rice_grade, rice_num), int rice_id; int rice_func; \
90 int rice_argc; const char *rice_argv[]; float *rice_grade; int *rice_num;)
92 #define RICE_Link(str, code) \
93 if(rice_func == ++(*rice_num)) \
94 { \
95 rice_argv[0] = str; \
96 if(rice_argc) \
97 { \
98 code; \
99 } \
100 return; \
104 /* truth values */
106 #define RICE_FALSE 0.0
107 #define RICE_TRUE 1.0
108 #define RICE_UNKNOWN (-1.0)
111 /* message types */
113 #define RICE_ERROR 1
114 #define RICE_WARNING 2
115 #define RICE_MESSAGE 3
118 /* argument macro's */
120 #define RICE_grade (*rice_grade)
121 #define RICE_argc rice_argc
122 #define RICE_argv rice_argv
123 #define RICE_id rice_id
126 /* adjustment macro's */
128 #define RICE_Explain(kb, typ, fct, dpt) RICE_MERGE(rice_Explain, typ(kb, fct, dpt))
129 #define RICE_Redirect(kb, nam, fnc) RICE_MERGE(rice_Redirect, nam(kb, fnc))
130 #define RICE_Set(kb, nam) RICE_MERGE(rice_Set, nam(kb, 1))
131 #define RICE_Reset(kb, nam) RICE_MERGE(rice_Set, nam(kb, 0))
132 #define RICE_Switch(kb, nam) RICE_MERGE(rice_Set, nam(kb, -1))
133 #define RICE_Use(kb, nam, num, ptr) RICE_MERGE(rice_Use, nam(kb, num, ptr))
136 /* for C++ applications */
138 #ifdef __cplusplus
139 extern "C" {
140 #endif
143 /* redirection functions */
145 RICE_PROTOTYPE(int rice_RedirectAsk, (int, RICE_PROTOTYPE(void (*), (int, int, char *[], float *))));
146 RICE_PROTOTYPE(int rice_RedirectInform, (int, RICE_PROTOTYPE(void (*), (int, int, char *[], float *))));
147 RICE_PROTOTYPE(int rice_RedirectReport, (int, RICE_PROTOTYPE(void (*), (int, int, char *))));
148 RICE_PROTOTYPE(int rice_RedirectExplain, (int, RICE_PROTOTYPE(void (*), (int, char *))));
149 RICE_PROTOTYPE(int rice_RedirectProtect, (int, RICE_PROTOTYPE(void (*), (int))));
150 RICE_PROTOTYPE(int rice_RedirectAbandon, (int, RICE_PROTOTYPE(void (*), (void))));
153 /* set functions */
155 RICE_PROTOTYPE(int rice_SetAdaptive, (int, int));
156 RICE_PROTOTYPE(int rice_SetInteractive, (int, int));
157 RICE_PROTOTYPE(int rice_SetRecursive, (int, int));
158 RICE_PROTOTYPE(int rice_SetRepetitive, (int, int));
159 RICE_PROTOTYPE(int rice_SetSelective, (int, int));
162 /* use functions */
164 RICE_PROTOTYPE(int rice_UseLinker, (int, int, RICE_LINKER *));
165 RICE_PROTOTYPE(int rice_UseIntersection, (int, int, RICE_NORM *));
166 RICE_PROTOTYPE(int rice_UseUnion, (int, int, RICE_NORM *));
169 /* explaination functions */
171 RICE_PROTOTYPE(int rice_ExplainWhy, (int, char *, int));
172 RICE_PROTOTYPE(int rice_ExplainHow, (int, char *, int));
175 /* interfacing KB functions */
177 RICE_PROTOTYPE(int rice_AppendKB, (int, char *));
178 RICE_PROTOTYPE(int rice_ClearKB, (int));
179 RICE_PROTOTYPE(int rice_CompileKB, (int, char *));
180 RICE_PROTOTYPE(int rice_CopyKB, (int, int));
181 RICE_PROTOTYPE(int rice_DestroyKB, (int));
182 RICE_PROTOTYPE(int rice_InferKB, (int));
183 RICE_PROTOTYPE(int rice_LoadKB, (int, char *));
184 RICE_PROTOTYPE(int rice_MoveKB, (int, int));
185 RICE_PROTOTYPE(int rice_ProcessKB, (int, char *, char *));
186 RICE_PROTOTYPE(int rice_RebuildKB, (int, char *));
187 RICE_PROTOTYPE(int rice_SaveKB, (int, char *));
188 RICE_PROTOTYPE(int rice_SwapKB, (int, RICE_PROTOTYPE(void (*), (void))));
191 /* interfacing ES functions */
193 RICE_PROTOTYPE(int rice_CheckES, (int));
194 RICE_PROTOTYPE(int rice_CopyES, (int, int));
195 RICE_PROTOTYPE(int rice_CreateES, (void));
196 RICE_PROTOTYPE(int rice_DeleteES, (int));
197 RICE_PROTOTYPE(int rice_MoveES, (int, int));
198 RICE_PROTOTYPE(int rice_SwitchES, (int));
201 /* for C++ applications */
203 #ifdef __cplusplus
205 #endif
208 /* in case of upgrading include RICE 3.x compatible header file rice3x.h */
210 #ifdef RICE_UPGRADE
211 # include <rice3x.h>
212 #endif
215 /* in case of C++ compiler also include RICE class if necessary */
217 #ifdef __cplusplus
218 # ifndef _RICE_HPP_
219 # include <rice.hpp>
220 # endif
221 #endif
224 #endif /* _RICE_H_ */