00001
00009 #ifndef _SOARAPI_DATATYPES_H_
00010 #define _SOARAPI_DATATYPES_H_
00011
00012 #include "soarkernel.h"
00013 #include "sysdep.h"
00014 #include <stdarg.h>
00015
00016 #define SOARRESULT_RESULT_LENGTH 256
00017
00022 typedef struct soarResult_struct {
00023
00024 char result[SOARRESULT_RESULT_LENGTH];
00025 int resultLength;
00026
00027 } soarResult;
00028
00029 #define init_soarResult(r) { \
00030 (r).resultLength = SOARRESULT_RESULT_LENGTH; \
00031 (*((r).result)) = '\0'; \
00032 }
00033
00034 #define clearSoarResultResult(r) (*((r)->result)) = '\0';
00035
00036 #define setSoarResultResultStdError(r) {strncpy( ((r)->result), "Error", SOARRESULT_RESULT_LENGTH); (r)->result[SOARRESULT_RESULT_LENGTH-1]=0;}
00037
00038 #ifdef USE_STDARGS
00039 extern void setSoarResultResult(soarResult * res, const char *format, ...);
00040 #else
00041 extern void setSoarResultResult();
00042 #endif
00043
00044 #ifdef USE_STDARGS
00045 extern void appendSoarResultResult(soarResult * res, const char *format, ...);
00046 #else
00047 extern void appendSoarResultResult();
00048 #endif
00049
00050 #ifdef USE_STDARGS
00051 extern void appendSymbolsToSoarResultResult(soarResult * res, const char *format, ...);
00052 #else
00053 extern void appendSymbolsToSoarResultResult();
00054 #endif
00055
00064 typedef void *psoar_agent;
00065
00074 typedef void *psoar_wme;
00075
00076
00077
00078
00079
00080
00089 typedef struct soar_apiAgentIter_struct {
00090
00091 cons *_begin;
00092 cons *_current;
00093 bool more;
00095 } soar_apiAgentIterator;
00096
00101 enum soar_apiResult {
00102 SOAR_OK,
00103 SOAR_ERROR
00104 };
00105
00106
00107
00108
00109
00110 enum soar_apiProductionType {
00111 CHUNKS,
00112 DEFAULT,
00113 TASK,
00114 USER,
00115 ALL
00116 };
00117
00118
00119
00120
00121
00122 enum soar_apiLearningSetting {
00123 ON,
00124 OFF,
00125 EXCEPT,
00126 ONLY,
00127 ALL_LEVELS,
00128 BOTTOM_UP
00129 };
00130
00131
00132
00133
00134
00135 enum soar_apiSlotType {
00136 NO_SLOT,
00137 STATE_SLOT,
00138 OPERATOR_SLOT,
00139 SUPERSTATE_SLOT,
00140 SUPEROPERATOR_SLOT,
00141 SUPERSUPERSTATE_SLOT,
00142 SUPERSUPEROPERATOR_SLOT
00143 };
00144
00149 typedef struct ask_cb_data_st {
00150
00151 preference **selection;
00152 preference *candidates;
00153
00154 } soar_apiAskCallbackData;
00155
00156 typedef struct sapiwme_st {
00157 const char *id;
00158 const char *attr;
00159 const char *value;
00160 long timetag;
00161 } soarapi_wme;
00162
00163
00164
00165
00166
00167 enum soar_apiInterruptSetting {
00168 INTERRUPT_OFF,
00169 INTERRUPT_ON,
00170 INTERRUPT_PRINT
00171 };
00172
00173 #endif