home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************
- kappa.h
- **************************************************************/
-
- /******************************************************/
- /* Copyright (c) IntelliCorp 1988,89,90 */
- /******************************************************/
-
- /**********************************************************************
- Define macros which eliminates loading unsued
- portions of the windows.h file
- ***********************************************************************/
- #define NOCOMM /* no communication */
- #define NOKANJI /* thanks, but no kanji for now */
- #define NOWH /* no window hooks */
- #define NOSOUND /* no sounds for now */
- #define NOMINMAX /* use our own */
-
- #include <windows.h>
- #include <stdio.h>
-
- /* KAPPA Configuration Paramters */
-
- #define INFERENCE
- #define EDITORS
- #define L123
- #define TEXTPRINT
- #define DBASE
- #define BITMAPWIDGET
- #define BROWSER
- #define INTERPRETER
- #define BINSAVE
- #define KALHELP
- #define METHODSLIB
- #define INPUTFORM
- #define SINGLEMENU
- #define WRITEKAL
- #define TOOLBOX
- #define GUIDELINES
- #define KALSAVE
- #define ABOUTBOX
-
- /* #define EMS */
-
- #define KERNEL 1
- #define DEVELOP 2
- /* #define RUNTIME 3 */
-
- /* general declarations */
- #define KAPERROR -1
-
- #define SHORT short
- typedef WORD FAR * LPWORD;
- #define LNULL (LPSTR)0
- #define LPNULL (LPSTR)0
- typedef LPSTR FAR *LPLPSTR;
-
- #define ITEMID WORD
- #define ATOMID ITEMID
- #define ANYID ITEMID
- #define NULLID (ITEMID)0
- #define LPITEM LPSTR
-
- /* some specific definitions */
- #define CSTR 7
-
- /***********************************/
- /* Window ID's of KAPPA's Children */
- /***********************************/
- #define ID_INTERPRET 1
- #define ID_TRACE 2
- #define ID_COMMENT 3 /* [mlm] 2/15/90 */
-
- /**************************/
- /* THE STRING TABLE SIZE */
- /**************************/
- #define CCHMAXSTRING 50 /* max chars in strings in the rc file */
-
- /******************************/
- /* Return Buffer Size */
- /******************************/
- #define RET_BUFFER_LEN 200
-
- /******************************/
- /* MAX size for Comment Window
- /******************************/
- #define MAX_COMMENT_SIZE 4000
-
- /* Length of name of object and slot */
- #define NAME_LEN 32
-
- /****************************/
- /* IDM... ID for Menus */
- /* IDT... ID for Timers */
- /* IDD... ID for Dialog Box */
- /****************************/
-
- /***********************/
- /* NEXT THE MENU ITEMS */
- /***********************/
-
- #define IDM_NEW 100 /* File Menu */
- #define IDM_OPEN 101
- #define IDM_SAVE 102
- #define IDM_SAVEAS 103
- #define IDM_SETUPPRINT 104
- #define IDM_EXIT 105
- #define IDM_HELP 106
- #define IDM_ABOUT 107
- #define IDM_PRINTSCREEN 108
- #define IDM_TRPFILE 109
- #define IDM_KAL 199
- #define IDM_RULEREL 901
- #define IDM_WRITEFILE 900
-
- #define IDM_UNDO 110 /* Interpreter Text Edit Menu */
- #define IDM_CUT 111
- #define IDM_COPY 112
- #define IDM_PASTE 113
- #define IDM_CLEAR 114
- #define IDM_RESET 115
- #define IDM_EXPLAIN 116
-
- #define IDM_START 120 /* Session Menu */
- #define IDM_INITWIDGETS 121
- #define IDM_MAKEWIDGET 122
- #define IDM_DELETEWIDGET 123
- #define IDM_CALLFUNC 124
-
- #define IDM_TITLEON 125
- #define IDM_TITLEOFF 126
- #define IDM_BORDERON 127
- #define IDM_BORDEROFF 128
- #define IDM_PRINT 129
-
- #define IDM_ECHO 130 /* Options Menu */
- #define IDM_SILENT 131
- #define IDM_DEBUG 132
-
- /* More Development menu for SESSION */
- #define IDM_IMAGE_EDIT 140
- #define IDM_IMAGE_RENAME 141
- #define IDM_IMAGE_DELETE 142
- #define IDM_IMAGE_HIDE 143
- #define IDM_IMAGE_SHOWHIDDEN 144
-
- #define IDM_BROWSER 150 /* KAPPA Windows menu */
- #define IDM_KTOOLS 151
- #define IDM_SESSION 152
- #define IDM_INFERENCE 153
- #define IDM_TRACE 154
- #define IDM_COMMENT 155
-
- /* Items in KTOOLS window menu */
- /* in addition to IDM_NEW and IDM_COPY defined above */
- #define IDM_DELETE 201
- #define IDM_EDIT 202
- #define IDM_RENAME 203
-
- /* Extra Items in Editors */
- #define IDM_CHECK 210
-
- /* Item in popup menu of browser */
- #define IDM_ADDINSTANCE 300
- #define IDM_ADDSUBCLASS 301
- #define IDM_SHOWINSTANCES 302
- #define IDM_SHOWSUBCLASSES 303
- #define IDM_FOCUS 304
- #define IDM_UNFOCUS 305
-
- /* Items in browser window menu */
- #define IDM_FIT 400
- #define IDM_SCALE 401
-
- /* Items in popup menu of Object/Class editor */
- #define IDM_NEWSLOT 501
- #define IDM_IMPORTSLOT 502
- #define IDM_EDITSLOT 503
- #define IDM_RENAMESLOT 504
- #define IDM_COPYSLOT 505
- #define IDM_DELETESLOT 506
- #define IDM_MAKELOCALSLOT 507
-
- #define IDM_NEWMETHOD 510
- #define IDM_IMPORTMETHOD 511
- #define IDM_EDITMETHOD 512
- #define IDM_RENAMEMETHOD 513
- #define IDM_COPYMETHOD 514
- #define IDM_DELETEMETHOD 515
- #define IDM_MAKELOCALMETHOD 516
- #define IDM_MAKELOCAL 517 /* generic command */
-
- /* Rule Trace Window Menus */
- #define IDM_RULETRACE 520
- #define IDM_SLOTTRACE 521
- #define IDM_RULEBREAK 522
- #define IDM_SLOTBREAK 523
-
- #define IDM_BASE 1000 /* Menu IDs */
- #define IDM_FILEEXIT (IDM_BASE + 100)
-
- #define IDM_EDITCUT (IDM_BASE + 200)
- #define IDM_EDITCOPY (IDM_BASE + 201)
- #define IDM_EDITPASTE (IDM_BASE + 202)
- #define IDM_EDITCLEAR (IDM_BASE + 203)
- #define IDM_EDITSELECT (IDM_BASE + 204)
-
- #define IDM_WIDGETBUTTON (IDM_BASE + 300)
- #define IDM_WIDGETTEXT (IDM_BASE + 301)
- #define IDM_WIDGETEDIT (IDM_BASE + 302)
- #define IDM_WIDGETTRANSCRIPT (IDM_BASE + 303)
- #define IDM_WIDGETBITMAP (IDM_BASE + 304)
- #define IDM_WIDGETDRAWING (IDM_BASE + 305)
- #define IDM_WIDGETSTATEBOX (IDM_BASE + 306)
- #define IDM_WIDGETMETER (IDM_BASE + 307)
- #define IDM_WIDGETLINEPLOT (IDM_BASE + 308)
- #define IDM_WIDGETSLIDER (IDM_BASE + 309) /*Set to IDM_WIDGETCLASSLAST*/
-
- #define IDM_WIDGETCUSTOM (IDM_BASE + 399)
-
- #define IDM_WIDGETCLASSFIRST IDM_WIDGETBUTTON
- #define IDM_WIDGETCLASSLAST IDM_WIDGETSLIDER
- #define NONEXTWIDGETCLASS -1
-
- #define IDM_OPTIONSTOOLBOX (IDM_BASE + 400)
- #define IDM_OPTIONSRULER (IDM_BASE + 401)
- #define IDM_OPTIONSGUIDELINES (IDM_BASE + 402)
- #define IDM_OPTIONSSTATUSBOX (IDM_BASE + 403)
- #define IDM_OPTIONSGRID (IDM_BASE + 404)
- #define IDM_OPTIONSLAYOUTMODE (IDM_BASE + 405)
-
- /********************************************************/
- /* NOTE: */
- /* All menu numbers above IDM_WINDOWS */
- /* is reserved. To add any menu item, make sure */
- /* you assign a number less than IDM_WINDOWS */
- /********************************************************/
- #define IDM_WINDOW 5000
-
- /***********************************************/
- /* FINALLY THE DIALOG BOXES AND THEIR CONTENTS */
- /***********************************************/
-
- /* Dialog box resource ids */
- #define IDD_ABOUT 1
- #define IDD_HELP 2
- #define IDD_HELPTOPIC 3
- #define IDD_EDITCLASS 11
- #define IDD_EDITOBJECT 12
- #define IDD_EDITSLOT 13
- #define IDD_EDITOPTIONS 14
- #define IDD_EDITMETHOD 15
- #define IDD_EDITFUNC 16
- #define IDD_EDITRULE 17
- #define IDD_EDITGOAL 18
- #define IDD_NAME 21
- #define IDD_NAMECLASS 22
- #define IDD_LBOXMENU 31
- #define IDD_QBOXDLG 32
- #define IDD_QUERYLISTDLG 33
- #define IDD_BrOptions 34
- #define IDD_CANCELPRINTDLG 35
- #define IDD_INPUTFORM 36
- #define IDD_EXPLAIN 37
- #define IDD_OBJECTSLOT 38
- #define IDD_SLOTLEVEL 39
- #define IDD_SINGLEMENU 40
- #define IDD_MULTILBOXMENU 41
- #define IDD_OPENFILE 42
- #define IDD_SAVEFILE 43
- #define IDD_BUSY 44
- #define IDD_LBMENUSELECTION 45
- #define IDD_POSTALERT 46
- #define IDD_POSTMESSAGE 47
- #define IDD_TRACERULE 48
- #define IDD_PASTECOMMAND 49
- #define IDD_QARGDLG 50
- #define IDD_OPENSAVEFILE 51
-
- /* general control definitions */
- #define IDNULL -1
- #define IDDNULL -1
-
- /* controls within Help dialog boxes */
- #define IDDTOPICS 1101
- #define IDDHELP 1102
- #define IDDNEXT 1103
- #define IDDPREVIOUS 1104
- #define IDDCONTENTS 1105
-
- /* controls within knowledge editors */
- #define IDDNAME 1101
- #define IDDCLASS 1102
- #define IDDVALUE 1103
- #define IDDEXPLAIN 1104
- #define IDDFIXED 1105
- #define IDDMODIFYABLE 1106
- #define IDDSLOTS 1121
- #define IDDPRIORITY 1122
- #define IDDMETHODS 1123
- #define IDDOPTIONS 1125
- #define IDDVARS 1126
- #define IDDIF 1127
- #define IDDTHEN 1128
- #define IDDLISTVALUE 1129
-
- /*id's for query box dialog*/
- #define IDDEDIT 1130
- #define IDDREAD 1131
- #define IDDUNKNOWN 1132
- #define IDDWHY 1133
- #define IDDINFO 1135
- #define IDDINHERIT 1136
-
- /* control ID's for browser options */
- #define IDDXSCALE 1150
- #define IDDYSCALE 1151
-
- /* control ID's for Options Dialog */
- #define IDDSLOT 1200
- #define IDDNEEDED 1201
- #define IDDBCHANGE 1202
- #define IDDACHANGE 1203
- #define IDDSINGLE 1204
- #define IDDLIST 1205
- #define IDDSTRINGTYPE 1206
- #define IDDNUMBERTYPE 1207
- #define IDDBOOLEANTYPE 1208
- #define IDDOBJECTTYPE 1209
- #define IDDCLASSTYPE 1210
- #define IDDPOSSTRINGSLABEL 1211
- #define IDDPOSVALUES 1212
- #define IDDNUMRANGE 1213
- #define IDDMINLABEL 1214
- #define IDDMAXLABEL 1215
- #define IDDSUBCLASSLABEL 1216
- #define IDDINSTANCELABEL 1217
- #define IDDMINVALUE 1218
- #define IDDMAXVALUE 1219
- #define IDDPROMPT 1220
- #define IDDENFORCESTRING 1221
- #define IDDENFORCENUM 1222
- #define IDDNEEDEDL 1223
- #define IDDBCHANGEL 1225
- #define IDDACHANGEL 1226
- #define IDDPROMPTL 1227
- #define IDDCARDL 1228
- #define IDDTYPEL 1229
- #define IDDHIERARC 1230
- #define IDDSUBCLASS 1231
- #define IDDINSTANCE 1232
-
- /* Controls for ABOUT dialog box */
- #define IDDVERSION 1251
- #define IDDSERIALID 1252
- #define IDDCUSTOMER 1253
- #define IDDWAIT 1254
-
- /* Additional control ID's for editor resources */
- #define IDDVALUEL 1260
-
- /* Controls for PostAlert dialog box */
- #define IDDMESSAGE 1281
- #define IDDCALLSTACK 1282
- #define IDDSHOWARGS 1283
-
- /* Controls for RULE TRACE SETUP dialog box */
- #define IDDTOTALTITLE 1301
- #define IDDSELECTTITLE 1302
- #define IDDTOTALLIST 1303
- #define IDDSELECTLIST 1304
- #define IDDADDLIST 1305
- #define IDDADDALL 1306
- #define IDDREMOVELIST 1307
- #define IDDREMOVEALL 1308
-
- /*
- Controls.
- These are designed so that controls in different dialogue
- boxes which look the same (have the same labels) will have
- the same numbers.
- */
- #define IDDWIDGET_SHOW_BORDER 1401
- #define IDDWIDGET_TITLE 1402
- #define IDDWIDGET_RIGHT_ACTION 1403
- #define IDDWIDGET_OWNER 1404
- #define IDDWIDGET_OWNER_SLOT 1405
- #define IDDWIDGET_AUTO_UPDATE 1406
- #define IDDWIDGET_LENGTH 1407
- #define IDDWIDGET_ACTION 1408
- #define IDDWIDGET_MAX_VALUE 1409
- #define IDDWIDGET_MIN_VALUE 1410
- #define IDDWIDGET_ALLOWABLE_VALUES 1411
- /*
- The 3 IDDWIDGET_JUST numbers must be sequential.
- */
- #define IDDWIDGET_JUST_LEFT 1412
- #define IDDWIDGET_JUST_RIGHT 1413
- #define IDDWIDGET_JUST_CENTER 1414
- #define IDDWIDGET_FILE_NAME 1415
- #define IDDWIDGET_FIT_TO_SCREEN 1416
- #define IDDWIDGET_X_LEFT 1417
- #define IDDWIDGET_X_RIGHT 1418
- #define IDDWIDGET_Y_BOTTOM 1419
- #define IDDWIDGET_Y_TOP 1420
- #define IDDWIDGET_DRAW_FUNCTION 1421
- /*
- The 6 IDDWIDGET_NUM_LINES numbers must be sequential.
- */
- #define IDDWIDGET_NUM_LINES_1 1422
- #define IDDWIDGET_NUM_LINES_2 1423
- #define IDDWIDGET_NUM_LINES_3 1424
- #define IDDWIDGET_NUM_LINES_4 1425
- #define IDDWIDGET_NUM_LINES_5 1426
- #define IDDWIDGET_NUM_LINES_6 1427
- #define IDDWIDGET_X_TITLE 1428
- #define IDDWIDGET_Y_TITLE 1429
- #define IDDWIDGET_LEGEND_ON 1430
- /*
- The 6 IDDWIDGET_LINE numbers must be sequential.
- */
- #define IDDWIDGET_LINE_1 1431
- #define IDDWIDGET_LINE_2 1432
- #define IDDWIDGET_LINE_3 1433
- #define IDDWIDGET_LINE_4 1434
- #define IDDWIDGET_LINE_5 1435
- #define IDDWIDGET_LINE_6 1436
- #define IDDWIDGET_AUTO_SCALE 1437
- #define IDDWIDGET_X_MIN 1438
- #define IDDWIDGET_X_MAX 1439
- #define IDDWIDGET_Y_MIN 1440
- #define IDDWIDGET_Y_MAX 1441
- /*
- Sub-dialog for XyPlot.
- */
- #define IDDWIDGET_XYPLOT_LINE_TITLE 1442
- #define IDDWIDGET_XYPLOT_X_OWNER 1443
- #define IDDWIDGET_XYPLOT_X_OWNER_SLOT 1444
- #define IDDWIDGET_XYPLOT_Y_OWNER 1445
- #define IDDWIDGET_XYPLOT_Y_OWNER_SLOT 1446
- #define IDDWIDGET_XYPLOT_LEGEND 1447
- #define IDDWIDGET_XYPLOT_LEGEND_LABEL 1448
-
- #define IDW_BASE 1500 /* Window IDs */
- #define IDW_HRULER (IDW_BASE + 1)
- #define IDW_VRULER (IDW_BASE + 2)
- #define IDW_TOOLBOX (IDW_BASE + 3)
- #define IDW_STATUSBOX (IDW_BASE + 4)
-
-
- /* Controls for the Input form Label controls */
- #define SH 5 /* Beginning height for LABEL 1 */
- #define LX 5 /* X-coord. of labels */
- #define VX 80 /* X-coordinates of value field */
- #define RX 165 /* X-coordinate of range field */
- #define LW 70 /* Label width */
- #define LH 12 /* Label height */
- #define VW 80 /* Value width */
- #define SVH 12 /* Single Value Height */
- #define LVH 21 /* List Value Height */
- #define RW 65 /* Range width */
- #define RH 12 /* Range height */
- #define DH 9 /* Height difference S vs. L */
- #define VGAP 3 /* Gap between vertical cells */
- #define HGAP 5 /* Gap between horiz. cells */
- #define OKX 130 /* X-coord. of OK button */
- #define OKW 32 /* Width of OK button */
- #define OKH 14 /* Height of OK button */
- #define CANCELX 165 /* X-Coord of CANCEL button */
- #define INFOW 224 /* Width of input form */
- #define INFOH 210 /* Height of input form */
-
- #define IDDINPUTLABEL1 13000
- #define IDDINPUTLABEL2 IDDINPUTLABEL1+1
- #define IDDINPUTLABEL3 IDDINPUTLABEL1+2
- #define IDDINPUTLABEL4 IDDINPUTLABEL1+3
- #define IDDINPUTLABEL5 IDDINPUTLABEL1+4
- #define IDDINPUTLABEL6 IDDINPUTLABEL1+5
- #define IDDINPUTLABEL7 IDDINPUTLABEL1+6
- #define IDDINPUTLABEL8 IDDINPUTLABEL1+7
- #define IDDINPUTLABEL9 IDDINPUTLABEL1+8
- #define IDDINPUTLABEL10 IDDINPUTLABEL1+9
- #define IDDINPUTLABEL11 IDDINPUTLABEL1+10
- #define IDDINPUTLABEL12 IDDINPUTLABEL1+11
- #define IDDINPUTLABEL13 IDDINPUTLABEL1+12
- #define IDDINPUTLABEL14 IDDINPUTLABEL1+13
- #define IDDINPUTLABEL15 IDDINPUTLABEL1+14
-
- /* Input value controls */
- #define IDDINPUTVALUE1 IDDINPUTLABEL15+1
- #define IDDINPUTVALUE2 IDDINPUTVALUE1+1
- #define IDDINPUTVALUE3 IDDINPUTVALUE1+2
- #define IDDINPUTVALUE4 IDDINPUTVALUE1+3
- #define IDDINPUTVALUE5 IDDINPUTVALUE1+4
- #define IDDINPUTVALUE6 IDDINPUTVALUE1+5
- #define IDDINPUTVALUE7 IDDINPUTVALUE1+6
- #define IDDINPUTVALUE8 IDDINPUTVALUE1+7
- #define IDDINPUTVALUE9 IDDINPUTVALUE1+8
- #define IDDINPUTVALUE10 IDDINPUTVALUE1+9
-
- /* Input list values controls */
- #define IDDINPUTLISTVALUE1 IDDINPUTVALUE10+1
- #define IDDINPUTLISTVALUE2 IDDINPUTLISTVALUE1+1
- #define IDDINPUTLISTVALUE3 IDDINPUTLISTVALUE1+2
- #define IDDINPUTLISTVALUE4 IDDINPUTLISTVALUE1+3
- #define IDDINPUTLISTVALUE5 IDDINPUTLISTVALUE1+4
- #define IDDINPUTLISTVALUE6 IDDINPUTLISTVALUE1+5
- #define IDDINPUTLISTVALUE7 IDDINPUTLISTVALUE1+6
- #define IDDINPUTLISTVALUE8 IDDINPUTLISTVALUE1+7
- #define IDDINPUTLISTVALUE9 IDDINPUTLISTVALUE1+8
- #define IDDINPUTLISTVALUE10 IDDINPUTLISTVALUE1+9
-
- /* Input restriction controls */
- #define IDDINPUTRANGE1 IDDINPUTLISTVALUE10+1
- #define IDDINPUTRANGE2 IDDINPUTRANGE1+1
- #define IDDINPUTRANGE3 IDDINPUTRANGE1+2
- #define IDDINPUTRANGE4 IDDINPUTRANGE1+3
- #define IDDINPUTRANGE5 IDDINPUTRANGE1+4
- #define IDDINPUTRANGE6 IDDINPUTRANGE1+5
- #define IDDINPUTRANGE7 IDDINPUTRANGE1+6
- #define IDDINPUTRANGE8 IDDINPUTRANGE1+7
- #define IDDINPUTRANGE9 IDDINPUTRANGE1+8
- #define IDDINPUTRANGE10 IDDINPUTRANGE1+9
-
- /* Choice Buttons */
- #define IDDINPUTCHOICE1 IDDINPUTRANGE10+1
- #define IDDINPUTCHOICE2 IDDINPUTCHOICE1+1
- #define IDDINPUTCHOICE3 IDDINPUTCHOICE1+2
- #define IDDINPUTCHOICE4 IDDINPUTCHOICE1+3
- #define IDDINPUTCHOICE5 IDDINPUTCHOICE1+4
- #define IDDINPUTCHOICE6 IDDINPUTCHOICE1+5
- #define IDDINPUTCHOICE7 IDDINPUTCHOICE1+6
- #define IDDINPUTCHOICE8 IDDINPUTCHOICE1+7
- #define IDDINPUTCHOICE9 IDDINPUTCHOICE1+8
- #define IDDINPUTCHOICE10 IDDINPUTCHOICE1+9
-
- #define IDDVERTICALCHOICE IDDINPUTCHOICE10+1
-
- /* Size of controls in Option dialogue */
- #define RTX 5 /* Read-text x-start */
- #define RTW 75 /* Read-text Width */
- #define TH 12 /* Text_Height */
- #define TW 125 /* Text Width */
- #define EX 95 /* Edit text x-start */
-
- /* controls for files.rc dialogs */
- #define ID_FILENAME 400
- #define ID_EDIT 401
- #define ID_FILES 402
- #define ID_PATH 403
- #define ID_LISTBOX 404
- #define ID_ECHO 405
- #define ID_KAL 501
- #define ID_BIN 502
-
- /* KAPPA specific message controls */
- #define IDG_AUTOOPEN 3001
- #define IDG_SETOWNER 3002
- #define IDG_CLOSESLOT 3003
- #define IDG_CLOSEMETHOD 3004
- #define IDG_PARENDETECT 3005
- #define IDG_UPDATEINDEX 3006
- #define IDG_HSCROLL 3007
- #define IDG_VSCROLL 3008
- #define IDG_UPDATEVALUEWINDOW 3009
- #define IDG_RESET 3010
- #define IDG_SELECTMENU 3011
- #define WG_SETMODE 3012
-
- /* ReadOnlyText window support */
- #define ROT_APPEND_FILE 3013
- #define ROT_APPEND_BUFFER 3014
- #define ROT_SAVE 3015
- #define ROT_DELETE 3016
-
- #define OSF_APPEND 3017 /* Open Save File Append command. */
- #define IDG_SETFIXEDFONT 3018
- #define IDG_ISFIXEDFONT 3019
-
- /* ID's for userdefined names and type */
- #define IDR_NAME 10001
- #define IDR_TYPE 10002
-
- /**************************************************
- ATTENTION: Alert String IDS
- ID's 10000-11000 are reserved for this purpose
- **************************************************/
-
- /* error messages from kappa library functions */
- #define IDE_ERROR 10000
- #define IDE_MISSINGARGS 10001
- #define IDE_TOOMANYARGS 10002
- #define IDE_NOSUCCESS 10003
- #define IDE_ERRORINFUNC 10004
- #define IDE_NOTEXIST 10005
- #define IDE_NOARGLIST 10006
- #define IDE_BADARG 10007
- #define IDE_ILLEGALARG 10008
- #define IDE_FWRITEOK 10009
- #define IDE_FCANTOPEN 10010
- #define IDE_FNOTOPEN 10011
- #define IDE_FALREADYOPEN 10012
- #define IDE_FEOF 10013
- #define IDE_PAIRNOTFOUND 10014
- #define IDE_PAIRNOTATOMS 10015
- #define IDE_WRONGEXPFORMAT 10016
- #define IDE_FUNCNOTFOUND 10017
- #define IDE_FLOATERROR 10018
- #define IDE_EXPECTFOUND 10019
- #define IDE_ERRORUSER 10020
- #define IDE_NOTWIDGET 10021
- #define IDE_NOTTRANSWIDGET 10022
- #define IDE_INTERRUPTEVAL 10023
- #define IDE_PAIRNOTEXIST 10024
- #define IDE_NOTSUBCLASS 10025
- #define IDE_ERRORSYSTIME 10026
- #define IDE_TIMENOTSET 10027
- #define IDE_BADRANGEMARKER 10028
- #define IDE_MISSINGRANGE 10029
- #define IDE_BADRANGE 10030
- #define IDE_CLOSELABELRANGE 10031
- #define IDE_BADLABEL 10032
- #define IDE_RANGETYPE 10033
- #define IDE_BADNUMARG 10034
- #define IDE_IFFULL 10035
- #define IDE_IFDUPLICATEPAIR 10036
- #define IDE_IFDUPLICATENAME 10037
- #define IDE_BADWIDGETFORLINK 10038
- #define IDE_ALREADYLINKED 10039
- #define IDE_BADESCAPEFORMAT 10040
- #define IDE_BADFILLERTYPE 10041
- #define IDE_NOTLINKED 10042
- #define IDE_USEEXIT 10043
- #define IDE_BADDBOBJECT 10044
- #define IDE_MUSTBEOBJECT 10045
- #define IDE_NEEDQUERYFILENAME 10046
- #define IDE_NOQUERY 10047
- #define IDE_NODBTYPE 10048
- #define IDE_UNKNOWNDBTYPE 10049
- #define IDE_RULEERROR 10050
- #define IDE_MUSTBECLASS 10051
- #define IDE_POSTMENUZEROITEM 10052
- #define IDE_FITONAPAGE 10053
- #define IDE_NOOUTPUTFILE 10054
- #define IDE_DBFIELDS 10055
- #define IDE_OUTPUTNOTEXIST 10056
- #define IDE_NORENAMEROOT 10057
- #define IDE_NOBITMAP 10058
- #define IDE_FILETOOLARGE 10059
- #define IDE_NOBMONCLIPBOARD 10060
- #define IDE_FOUTOFDISK 10061
- #define IDE_BITMAPTOOLARGE 10062
- #define IDE_UNSUPPORTEDBM 10063
- #define IDE_EXPTOOBIG 10064
- #define IDE_BADOPTKEY 10065
- #define IDE_MUSTBENUMBER 10066
- #define IDE_MISSINGFILENAME 10067
- #define IDE_DIVIDEBYZERO 10068
- #define IDE_NEGATIVEVALUE 10069
- #define IDE_NOTOWNEDSLOT 10070
- #define IDE_DUPLICATESLOT 10071
- #define IDE_BEINGEDITED 10072
- #define IDE_UNCLOSEDQUOTE 10073
- #define IDE_ENDOFEXPINPAIR 10074
- #define IDE_CLOSEPARINPAIR 10075
- #define IDE_OPENPARINPAIR 10076
- #define IDE_DOUBLECOLON 10077
- #define IDE_TOOMANYCLOSEPAR 10078
- #define IDE_UNCLOSEDPAR 10079
- #define IDE_MORETHANONEEXP 10080
- #define IDE_EMPTYEXP 10081
- #define IDE_BADBITMAPFILE 10082
- #define IDE_OUTOFRANGE 10083
- #define IDE_MUSTBESINGLE 10084
- #define IDE_NULLCLAUSE 10085
-
- #define IDE_DB_INVALIDFILE 10086
- #define IDE_BADINFERMODE 10087
- #define IDE_BADNAME 10088
- #define IDE_NOSUCHMETHOD 10089
-
- #define IDE_DUMMY 10100
- #define IDE_FLOATERR 10101
- #define IDE_OUTOFMEMQUIT 10102
- #define IDE_NONAME 10103
- #define IDE_NOTVALNAME 10104
- #define IDE_NOWILDCRD 10105
- #define IDE_EDITFILE 10106
- #define IDE_SLOTSOPEN 10107
- #define IDE_YOUSURE 10108
- #define IDE_BLANKSTRING 10110
- #define IDE_OUTOFMEMSAVE 10113
- #define IDE_CONTACTUS 10114
- #define IDE_BADSCALE 10115
- #define IDE_NODUMP 10116
- #define IDE_CANCELPRINT 10117
- #define IDE_PRINTERROR 10118
- #define IDE_PRINTFAIL 10119
- #define IDE_NOCONTRP 10120
- #define IDE_TRPERROR 10121
- #define IDE_TOOLONG 10122
- #define IDE_SAVEDIREXISTS 10123
- #define IDE_SAVEFILEEXISTS 10124
- #define IDE_REACHEDMAXID 10125
- #define IDE_OUTOFLOCALMEMQUIT 10126
- #define IDE_OUTOFLOCALMEMSAVE 10127
- #define IDE_INTERRUPT 10128
- #define IDE_DUPLICATENAME 10129
- #define IDE_QUERYSAVE 10130
- #define IDE_MUSTBEANUMBER 10132
- #define IDE_PRINTWIDGETFAILED 10133
- #define IDE_NOPRINTFUNC 10134
- #define IDE_BADCLASS 10135
- #define IDE_CLOSEEDITORS 10136
- #define IDE_DUPLICATEEDITOR 10137
- #define IDE_BADOBJECT 10138
- #define IDE_BADSLOT 10139
- #define IDE_OUTSIDEMINMAX 10143
- #define IDE_OUTSIDEPOSSVALUES 10144
- #define IDE_NONNUMERIC 10145
- #define IDE_BADEXP 10146
- #define IDE_REALLOCBRTABLE 10147
- #define IDE_REACHEDMAXSTRINGLENGTH 10148
- #define IDE_NOMOVEPTOC 10149
- #define IDE_ITEMALREADYEXISTS 10150
- #define IDE_OBJECTALREADYEXISTS 10151
- #define IDE_CLASSALREADYEXISTS 10152
- #define IDE_NOOBJECTCLASSBYNAME 10153
- #define IDE_NOSYSDELETE 10154
- #define IDE_NOSYSRENAME 10155
- #define IDE_NOSYSMETHRENAME 10156
- #define IDE_NOSYSMETHDELETE 10157
- #define IDE_NOSYSSLOTRENAME 10158
- #define IDE_NOSYSSLOTDELETE 10159
- #define IDE_NOIMAGEOPTIONS 10160
-
- #define IDE_RULEIFERROR 10170
- #define IDE_RULETHENERROR 10171
- #define IDE_RULEIFERROR1 10172
- #define IDE_RULETHENERROR1 10173
-
- #define IDE_NORULES 10174
- #define IDE_NOSLOTS 10175
- #define IDE_NOTINFERING 10176
-
- #define IDE_BCBADRETURN 10177
-
- #define IDE_NOEXPLAIN 10200
- #define IDE_NOTAVAILBC 10201
- #define IDE_NOHELPFORQUERY 10202
-
-
- #define IDE_WRITEERROR 10300
- #define IDE_DBASEERROR 10301
-
- /**********************************
- TK: SYNTAX ERROR CODES
- **********************************/
- #define SYNTAX_ERROR_BASE 3350
- #define IDE_EXPECT_NAME SYNTAX_ERROR_BASE+ 1
- #define IDE_INTERNAL1 SYNTAX_ERROR_BASE+ 2
- #define IDE_INTERNAL2 SYNTAX_ERROR_BASE+ 3
- #define IDE_INTERNAL3 SYNTAX_ERROR_BASE+ 4
- #define IDE_BLOCK_ERROR SYNTAX_ERROR_BASE+ 5
- #define IDE_PARENT_ERROR SYNTAX_ERROR_BASE+ 6
- #define IDE_EXPECT_OB SYNTAX_ERROR_BASE+ 7
- #define IDE_EXPECT_CB SYNTAX_ERROR_BASE+ 8
- #define IDE_EXP_ERROR SYNTAX_ERROR_BASE+ 9
- #define IDE_EXPECT_VB SYNTAX_ERROR_BASE+ 10
- #define IDE_EXPECT_NP SYNTAX_ERROR_BASE+ 11
- #define IDE_EXPECT_THEN SYNTAX_ERROR_BASE+ 12
- #define IDE_EXPECT_ELSE SYNTAX_ERROR_BASE+ 13
- #define IDE_CONTROL_ERROR SYNTAX_ERROR_BASE+ 14
- #define IDE_EXPECT_OPERATOR SYNTAX_ERROR_BASE+ 15
- #define IDE_NOTEXPECT SYNTAX_ERROR_BASE+ 16
- #define IDE_EXPECT_CP SYNTAX_ERROR_BASE+ 17
- #define IDE_INFIX_ERROR SYNTAX_ERROR_BASE+ 18
- #define IDE_TERMINATION_ERROR SYNTAX_ERROR_BASE+ 19
- #define IDE_END_STRING SYNTAX_ERROR_BASE+ 20
- #define IDE_LEFTOFASSIGNMENT SYNTAX_ERROR_BASE+ 21
-
-
- /**********************************************************************
- KAPPA resource include file, includes all stringtable
- constants for KAL functions.
- **********************************************************************/
-
- /*
- build_function names.
- These are listed by the sections in libman.c.
- */
- #define IDF_FBASE 2200
- /*
- Expanded memory.
- */
- /*
- #define IDF_INITEXPANDED (IDF_FBASE + 0)
- #define IDF_CLEANUPEXPANDED (IDF_FBASE + 1)
- #define IDF_ALLOCEXPANDED (IDF_FBASE + 2)
- #define IDF_FREEEXPANDED (IDF_FBASE + 3)
- #define IDF_LOCKEXPANDED (IDF_FBASE + 4)
- #define IDF_UNLOCKEXPANDED (IDF_FBASE + 5)
- #define IDF_PUTCHAR (IDF_FBASE + 6)
- #define IDF_SHOWALLOCTABLE (IDF_FBASE + 7)
- #define IDF_SHOWLOCKTABLE (IDF_FBASE + 8)
- */
- /*
- Knowledge.
- */
- #define IDF_MAKECLASS (IDF_FBASE + 9)
- #define IDF_CLASSQUESTION (IDF_FBASE + 10)
- #define IDF_DELETECLASS (IDF_FBASE + 11)
- #define IDF_RENAMECLASS (IDF_FBASE + 12)
- #define IDF_SETCLASSINFO (IDF_FBASE + 13)
- #define IDF_GETCLASSINFO (IDF_FBASE + 14)
- #define IDF_TOOBJECT (IDF_FBASE + 15)
- #define IDF_MAKEOBJECT (IDF_FBASE + 16)
- #define IDF_OBJECTQUESTION (IDF_FBASE + 17)
- #define IDF_DELETEOBJECT (IDF_FBASE + 18)
- #define IDF_RENAMEOBJECT (IDF_FBASE + 19)
- #define IDF_SETOBJECTINFO (IDF_FBASE + 20)
- #define IDF_GETOBJECTINFO (IDF_FBASE + 21)
- #define IDF_TOCLASS (IDF_FBASE + 22)
- #define IDF_GETPARENT (IDF_FBASE + 23)
- #define IDF_ISAKINDOFQUESTION (IDF_FBASE + 24)
- #define IDF_MOVEOBJECT (IDF_FBASE + 25)
- #define IDF_CONVERTBROWSERDISPLAYTEXT (IDF_FBASE + 26)
- #define IDF_COUNTOBJECTS (IDF_FBASE + 27)
- #define IDF_COUNTALLOBJECTS (IDF_FBASE + 28)
- #define IDF_COUNTSUBCLASSES (IDF_FBASE + 29)
- #define IDF_COUNTALLSUBCLASSES (IDF_FBASE + 30)
- #define IDF_GETOBJECTLIST (IDF_FBASE + 31)
- #define IDF_GETSUBCLASSLIST (IDF_FBASE + 32)
- #define IDF_MOVEHIERARCHY (IDF_FBASE + 33)
- #define IDF_GETDEPTH (IDF_FBASE + 34)
- #define IDF_PRINTHIERARCHY (IDF_FBASE + 35)
-
- #define IDF_GETSLOTLIST (IDF_FBASE + 38)
- #define IDF_MAKEFUNCTION (IDF_FBASE + 39)
- #define IDF_FUNCTIONQUESTION (IDF_FBASE + 40)
- #define IDF_DELETEFUNCTION (IDF_FBASE + 41)
- #define IDF_RENAMEFUNCTION (IDF_FBASE + 42)
- #define IDF_SETFUNCTIONINFO (IDF_FBASE + 43)
- #define IDF_GETFUNCTIONINFO (IDF_FBASE + 44)
- #define IDF_SHOWFUNCTION (IDF_FBASE + 45)
- #define IDF_MAKEGOAL (IDF_FBASE + 46)
- #define IDF_GOALQUESTION (IDF_FBASE + 47)
- #define IDF_DELETEGOAL (IDF_FBASE + 48)
- #define IDF_RENAMEGOAL (IDF_FBASE + 49)
- #define IDF_SETGOALINFO (IDF_FBASE + 50)
- #define IDF_GETGOALINFO (IDF_FBASE + 51)
- #define IDF_TESTGOAL (IDF_FBASE + 52)
- #define IDF_MAKERULE (IDF_FBASE + 53)
- #define IDF_RULEQUESTION (IDF_FBASE + 54)
- #define IDF_SETRULEPRIORITY (IDF_FBASE + 55)
- #define IDF_DELETERULE (IDF_FBASE + 56)
- #define IDF_RENAMERULE (IDF_FBASE + 57)
- #define IDF_SETRULEINFO (IDF_FBASE + 58)
- #define IDF_GETRULEINFO (IDF_FBASE + 59)
- #define IDF_TESTRULE (IDF_FBASE + 60)
- #define IDF_EXECRULE (IDF_FBASE + 61)
- #define IDF_EVALRULE (IDF_FBASE + 62)
- /*
- Inference.
- */
- #define IDF_ACTIVATERULE (IDF_FBASE + 63)
- #define IDF_DEACTIVATERULE (IDF_FBASE + 64)
- #define IDF_SETACTIVERULES (IDF_FBASE + 65)
- #define IDF_BACKCHAIN (IDF_FBASE + 66)
- #define IDF_EXPLAIN (IDF_FBASE + 68)
- /*
- Slots.
- */
- #define IDF_MAKESLOT (IDF_FBASE + 69)
- #define IDF_GETOWNER (IDF_FBASE + 70)
- #define IDF_DELETESLOT (IDF_FBASE + 71)
- #define IDF_RENAMESLOT (IDF_FBASE + 72)
- #define IDF_SETSLOTINFO (IDF_FBASE + 73)
- #define IDF_GETSLOTINFO (IDF_FBASE + 74)
- #define IDF_RESETVALUE (IDF_FBASE + 75)
- #define IDF_ASKVALUE (IDF_FBASE + 76)
- #define IDF_SETVALUE (IDF_FBASE + 77)
- #define IDF_KNOWNVALUEQUESTION (IDF_FBASE + 78)
- #define IDF_ASSERT (IDF_FBASE + 79)
- #define IDF_GETVALUE (IDF_FBASE + 80)
- #define IDF_SLOTQUESTION (IDF_FBASE + 81)
- #define IDF_LOCALVALUEQUESTION (IDF_FBASE + 82)
- #define IDF_SETSLOTOPTION (IDF_FBASE + 83)
- #define IDF_GETSLOTOPTION (IDF_FBASE + 84)
- #define IDF_RESETSLOTOPTION (IDF_FBASE + 85)
- /*
- Methods.
- */
- #define IDF_MAKEMETHOD (IDF_FBASE + 86)
- #define IDF_DELETEMETHOD (IDF_FBASE + 87)
- #define IDF_RENAMEMETHOD (IDF_FBASE + 88)
- #define IDF_SETMETHODINFO (IDF_FBASE + 89)
- #define IDF_GETMETHODINFO (IDF_FBASE + 90)
- #define IDF_METHODQUESTION (IDF_FBASE + 91)
- #define IDF_SENDMESSAGE (IDF_FBASE + 92)
- #define IDF_MAILMESSAGE (IDF_FBASE + 93)
- #define IDF_SHOWMETHOD (IDF_FBASE + 94)
- /*
- Numerical.
- */
- #define IDF_CALCULATE (IDF_FBASE + 99)
- #define IDF_PLUS (IDF_FBASE + 100)
- #define IDF_MINUS (IDF_FBASE + 101)
- #define IDF_TIMES (IDF_FBASE + 102)
- #define IDF_DIVIDE (IDF_FBASE + 103)
- #define IDF_SQRT (IDF_FBASE + 104)
- #define IDF_POWER (IDF_FBASE + 105)
- #define IDF_FLOOR (IDF_FBASE + 106)
- #define IDF_CEIL (IDF_FBASE + 107)
- #define IDF_ABS (IDF_FBASE + 108)
- #define IDF_NEGATIVE (IDF_FBASE + 109)
- /*
- Strings.
- */
- #define IDF_APPEND (IDF_FBASE + 118)
- #define IDF_SAMEQUESTION (IDF_FBASE + 119)
- #define IDF_FORMATVALUE (IDF_FBASE + 120)
- /*
- Float array.
- */
- #define IDF_ALLOCFLOATARRAY (IDF_FBASE + 121)
- #define IDF_REALLOCFLOATARRAY (IDF_FBASE + 122)
- #define IDF_FREEFLOATARRAY (IDF_FBASE + 123)
- #define IDF_SETFLOATARRAY (IDF_FBASE + 124)
- #define IDF_GETFLOATARRAY (IDF_FBASE + 125)
- #define IDF_LISTTOFLOATARRAY (IDF_FBASE + 126)
- /*
- Lists.
- */
- #define IDF_MAKELIST (IDF_FBASE + 127)
- #define IDF_DELETELIST (IDF_FBASE + 128)
- #define IDF_COPYLIST (IDF_FBASE + 129)
- #define IDF_CLEARLIST (IDF_FBASE + 130)
- #define IDF_LENGTHLIST (IDF_FBASE + 131)
- #define IDF_MEMBERQUESTION (IDF_FBASE + 132)
- #define IDF_APPENDTOLIST (IDF_FBASE + 133)
- #define IDF_REMOVEFROMLIST (IDF_FBASE + 134)
- #define IDF_INSERTNTHELEM (IDF_FBASE + 135)
- #define IDF_SETNTHELEM (IDF_FBASE + 136)
- #define IDF_GETNTHELEM (IDF_FBASE + 137)
- #define IDF_GETELEMPOS (IDF_FBASE + 138)
- #define IDF_REMOVENTHELEM (IDF_FBASE + 139)
- /*
- Item selection in lists.
- */
- #define IDF_ENUMLIST (IDF_FBASE + 140)
- #define IDF_SELECTLIST (IDF_FBASE + 141)
- /*
- Item selection in classes.
- */
- #define IDF_ENUMSUBCLASSES (IDF_FBASE + 142)
- #define IDF_SELECTSUBCLASS (IDF_FBASE + 143)
- /*
- List mathematics.
- */
- #define IDF_SUM (IDF_FBASE + 144)
- #define IDF_MULTIPLY (IDF_FBASE + 145)
- #define IDF_AVERAGE (IDF_FBASE + 146)
- #define IDF_MAX (IDF_FBASE + 147)
- #define IDF_MIN (IDF_FBASE + 148)
- /*
- Lotus 1-2-3.
- */
- #define IDF_GET123CELL (IDF_FBASE + 149)
- #define IDF_GET123RANGE (IDF_FBASE + 150)
- /*
- File i/o.
- */
- #define IDF_INTERPRETFILE (IDF_FBASE + 151)
- #define IDF_OPENREADFILE (IDF_FBASE + 152)
- #define IDF_OPENWRITEFILE (IDF_FBASE + 153)
- #define IDF_CLOSEREADFILE (IDF_FBASE + 154)
- #define IDF_CLOSEWRITEFILE (IDF_FBASE + 155)
- #define IDF_READWORD (IDF_FBASE + 156)
- #define IDF_WRITELINE (IDF_FBASE + 157)
- #define IDF_WRITEQUOTED (IDF_FBASE + 158)
- #define IDF_WRITEHIERARCHY (IDF_FBASE + 159)
- #define IDF_WRITECLASS (IDF_FBASE + 160)
- #define IDF_WRITEOBJECT (IDF_FBASE + 161)
- #define IDF_WRITEFUNCTION (IDF_FBASE + 162)
- #define IDF_WRITERULE (IDF_FBASE + 163)
- #define IDF_WRITEGOAL (IDF_FBASE + 164)
- #define IDF_WRITEALLCLASSES (IDF_FBASE + 165)
- #define IDF_WRITEALLOBJECTS (IDF_FBASE + 166)
- #define IDF_WRITEALLFUNCTIONS (IDF_FBASE + 167)
- #define IDF_WRITEALLRULES (IDF_FBASE + 168)
- #define IDF_WRITEALLGOALS (IDF_FBASE + 169)
- #define IDF_WRITEALLKNOWLEDGE (IDF_FBASE + 170)
- #define IDF_WRITEALL (IDF_FBASE + 171)
- #define IDF_CLEARINTERPRETER (IDF_FBASE + 172)
- #define IDF_SAVEINTERPRETER (IDF_FBASE + 173)
- #define IDF_SAVETRACE (IDF_FBASE + 174)
- #define IDF_SHOWWINDOW (IDF_FBASE + 175)
- #define IDF_HIDEWINDOW (IDF_FBASE + 176)
- #define IDF_POSITIONWINDOW (IDF_FBASE + 177)
- #define IDF_ICONIFYWINDOW (IDF_FBASE + 178)
- #define IDF_MAXIMIZEWINDOW (IDF_FBASE + 179)
- #define IDF_SETWINDOWTITLE (IDF_FBASE + 180)
- #define IDF_FREEZEWINDOW (IDF_FBASE + 181)
- #define IDF_UNFREEZEWINDOW (IDF_FBASE + 182)
- #define IDF_REMOVEWINDOWMENU (IDF_FBASE + 183)
- #define IDF_RESETWINDOWMENU (IDF_FBASE + 184)
- #define IDF_SETFOCUS (IDF_FBASE + 185)
- #define IDF_GETFOCUS (IDF_FBASE + 186)
- #define IDF_SETPOSTMESSAGETITLE (IDF_FBASE + 187)
- #define IDF_SHOWOBJECTS (IDF_FBASE + 188)
- #define IDF_SHOWSUBCLASSES (IDF_FBASE + 189)
- #define IDF_HIDEOBJECTS (IDF_FBASE + 190)
- #define IDF_HIDESUBCLASSES (IDF_FBASE + 191)
- #define IDF_SETWINDOWBACKGROUND (IDF_FBASE + 192)
- /*
- Error functions.
- */
- #define IDF_CATCHERROR (IDF_FBASE + 200)
- #define IDF_POSTERROR (IDF_FBASE + 201)
- #define IDF_POSTMESSAGE (IDF_FBASE + 202)
- #define IDF_POSTBUSY (IDF_FBASE + 203)
- /*
- Meta-functions.
- */
- #define IDF_DO (IDF_FBASE + 204)
- #define IDF_IF (IDF_FBASE + 205)
- #define IDF_LET (IDF_FBASE + 206)
- #define IDF_FOR (IDF_FBASE + 207)
- #define IDF_WHILE (IDF_FBASE + 208)
- #define IDF_FORALL (IDF_FBASE + 209)
- #define IDF_ISTHEREANYQUESTION (IDF_FBASE + 210)
- #define IDF_AREALLQUESTION (IDF_FBASE + 211)
- /*
- System functions.
- */
- #define IDF_EXECUTE (IDF_FBASE + 232)
- #define IDF_BEEP (IDF_FBASE + 233)
- #define IDF_TIME (IDF_FBASE + 234)
- #define IDF_DATE (IDF_FBASE + 235)
- #define IDF_TIMEDIFF (IDF_FBASE + 236)
- #define IDF_RESETCLOCK (IDF_FBASE + 237)
- #define IDF_GETCLOCK (IDF_FBASE + 238)
- #define IDF_EXIT (IDF_FBASE + 239)
- #define IDF_WAIT (IDF_FBASE + 240)
- #define IDF_GETSCREENWIDTH (IDF_FBASE + 241)
- #define IDF_GETSCREENHEIGHT (IDF_FBASE + 242)
- #define IDF_PROT (IDF_FBASE + 243)
- /*
- Widgets.
- */
- #define IDF_MAKEWIDGET (IDF_FBASE + 244)
- #define IDF_POSITIONWIDGET (IDF_FBASE + 245)
- #define IDF_DRAWWIDGET (IDF_FBASE + 246)
- #define IDF_UPDATEWIDGET (IDF_FBASE + 247)
- #define IDF_INPUTWIDGET (IDF_FBASE + 248)
- #define IDF_PRINTWIDGET (IDF_FBASE + 249)
- #define IDF_RESETWIDGET (IDF_FBASE + 250)
- #define IDF_SELECTWIDGET (IDF_FBASE + 251)
- #define IDF_SETWIDGETLINK (IDF_FBASE + 252)
- #define IDF_CLEARWIDGETLINK (IDF_FBASE + 253)
- #define IDF_DELETEWIDGET (IDF_FBASE + 254)
- #define IDF_SHOWWIDGET (IDF_FBASE + 255)
- #define IDF_HIDEWIDGET (IDF_FBASE + 256)
- #define IDF_DISPLAYTEXT (IDF_FBASE + 258)
- #define IDF_CLEARTRANSCRIPTWIDGET (IDF_FBASE + 259)
- #define IDF_SAVETRANSCRIPTWIDGET (IDF_FBASE + 260)
- #define IDF_DISPLAYFILE (IDF_FBASE + 261)
- #define IDF_COPYBITMAPTOCLIPBOARD (IDF_FBASE + 262)
- #define IDF_SAVECLIPBOARDBITMAP (IDF_FBASE + 263)
- #define IDF_DRAWT (IDF_FBASE + 264)
- /*
- Trigonometric functions.
- */
- #define IDF_LOG (IDF_FBASE + 275)
- #define IDF_COS (IDF_FBASE + 276)
- #define IDF_SIN (IDF_FBASE + 277)
- #define IDF_TAN (IDF_FBASE + 278)
- #define IDF_ACOS (IDF_FBASE + 279)
- #define IDF_ASIN (IDF_FBASE + 280)
- #define IDF_ATAN (IDF_FBASE + 281)
- /*
- More i/o.
- */
- #define IDF_POSTINPUTFORM (IDF_FBASE + 282)
- #define IDF_POSTMENU (IDF_FBASE + 283)
- #define IDF_POSTMULTIPLESELECTION (IDF_FBASE + 284)
- #define IDF_SETPOSTMENUPOSITION (IDF_FBASE + 285)
- /*
- Graphics.
- */
- #define IDF_MOVETO (IDF_FBASE + 295)
- #define IDF_LINETO (IDF_FBASE + 296)
- #define IDF_MOVETOREL (IDF_FBASE + 297)
- #define IDF_LINETOREL (IDF_FBASE + 298)
- #define IDF_RECTANGLE (IDF_FBASE + 299)
- #define IDF_ELLIPSE (IDF_FBASE + 300)
- #define IDF_SETLINESTYLE (IDF_FBASE + 301)
- /*
- #define IDF_INITIALIZEGRAPHICS (IDF_FBASE + 302)
- #define IDF_ENDGRAPHICS (IDF_FBASE + 303)
- */
- #define IDF_DRAWTEXT (IDF_FBASE + 304)
-
- #define IDF_INITIALIZEDB (IDF_FBASE + 305)
-
- #define IDF_IMPORTDBDATA (IDF_FBASE + 306)
- #define IDF_EXPORTDBDATA (IDF_FBASE + 307)
- #define IDF_FORM_LIST (IDF_FBASE + 308)
-
- /*
- Tony's new functions
- */
- /*
- #define IDF_COMPILERULENETWORK (IDF_FBASE + 320)
- #define IDF_PRINTRULENETWORK (IDF_FBASE + 321)
- #define IDF_INITFORWARDCHAIN (IDF_FBASE + 322)
- #define IDF_PRINTAGENDA (IDF_FBASE + 326)
- */
- #define IDF_STOPFORWARDCHAIN (IDF_FBASE + 323)
- #define IDF_SETFORWARDCHAINMODE (IDF_FBASE + 324)
- #define IDF_FORWARDCHAIN (IDF_FBASE + 325)
- /*
- Logic.
- */
- #define IDF_FIRSTVALUE (IDF_FBASE + 350)
- #define IDF_AND (IDF_FBASE + 351)
- #define IDF_OR (IDF_FBASE + 352)
- #define IDF_XOR (IDF_FBASE + 353)
- #define IDF_NOT (IDF_FBASE + 354)
- #define IDF_NULLQUESTION (IDF_FBASE + 355)
-
- /*
- Numerical test.
- */
- #define IDF_NUMBERQUESTION (IDF_FBASE + 380)
- #define IDF_INTEGERQUESTION (IDF_FBASE + 381)
- #define IDF_ALMOSTEQUAL (IDF_FBASE + 382)
- #define IDF_EQUAL (IDF_FBASE + 383)
- #define IDF_NOTEQUAL (IDF_FBASE + 384)
- #define IDF_LESSEQUAL (IDF_FBASE + 385)
- #define IDF_GREATEREQUAL (IDF_FBASE + 386)
- #define IDF_LESS (IDF_FBASE + 387)
- #define IDF_GREATER (IDF_FBASE + 388)
- #define IDF_PLUSEQUAL (IDF_FBASE + 389)
- #define IDF_MINUSEQUAL (IDF_FBASE + 390)
- #define IDF_SAMEEQUAL (IDF_FBASE + 391)
- #define IDF_INFIX (IDF_FBASE + 392)
- #define IDF_MAPESCAPEKEY (IDF_FBASE + 393)
-
- /*
- Database Interface Module
- */
- #define IDF_DB_OPENFILE (IDF_FBASE + 500)
- #define IDF_DB_CLOSEFILE (IDF_FBASE + 501)
- #define IDF_DB_OPENINDEX (IDF_FBASE + 502)
- #define IDF_DB_CLOSEINDEX (IDF_FBASE + 503)
- #define IDF_DB_SELECTFILE (IDF_FBASE + 504)
- #define IDF_DB_SELECTINDEXFILE (IDF_FBASE + 505)
- #define IDF_DB_SETROWPOSITION (IDF_FBASE + 506)
- #define IDF_DB_GETROWPOSITION (IDF_FBASE + 507)
- #define IDF_DB_GETNUMROWS (IDF_FBASE + 508)
- #define IDF_DB_SKIPROW (IDF_FBASE + 509)
- #define IDF_DB_READCELL (IDF_FBASE + 510)
- #define IDF_DB_WRITECELL (IDF_FBASE + 511)
- #define IDF_DB_GETNUMFIELDS (IDF_FBASE + 512)
- #define IDF_DB_GETFIELDNAMES (IDF_FBASE + 513)
- #define IDF_DB_READFIELD (IDF_FBASE + 514)
- #define IDF_DB_WRITEFIELD (IDF_FBASE + 515)
- #define IDF_DB_SETMAPPARAMETERS (IDF_FBASE + 516)
- #define IDF_DB_MAPROWTOINSTANCE (IDF_FBASE + 517)
- #define IDF_DB_MAPINSTANCETOROW (IDF_FBASE + 518)
-
- #define IDF_DB_SETFILTER (IDF_FBASE + 519)
- #define IDF_DB_FINDRECORD (IDF_FBASE + 520)
- #define IDF_DB_SEEKRECORD (IDF_FBASE + 521)
-
- #define IDF_DB_INITDATABASE (IDF_FBASE + 522)
- #define IDF_DB_TERMINATEDATABASE (IDF_FBASE + 523)
-
-
- /***********************************************************************
- ** Declaration of KAPPA data structures
- ***********************************************************************/
-
- /* DEFINING ITEM TYPE */
- /* bit 1 through bit 4 define the struct type */
- #define LIST 0x0000 /* 0000 0000 0000 0000 */
- #define CLASS 0x0001 /* 0000 0000 0000 0001 */
- #define OBJECT 0x0002 /* 0000 0000 0000 0010 */
- #define METHOD 0x0003 /* 0000 0000 0000 0011 */
- #define FUNC 0x0004 /* 0000 0000 0000 0100 */
- #define RULE 0x0005 /* 0000 0000 0000 0101 */
- #define GOAL 0x0006 /* 0000 0000 0000 0110 */
- #define SLOT 0x0007 /* 0000 0000 0000 0111 */
- #define OPTIONS 0x0008 /* 0000 0000 0000 1000 */
- #define CFUNC 0x0009 /* 0000 0000 0000 1001 */
- #define EXP 0x000a /* 0000 0000 0000 1010 */
- #define ATOMADT 0x000b /* 0000 0000 0000 1011 */
- #define VAR 0x000c /* 0000 0000 0000 1100 */
- /* bit 5 through bit 8 reserved for future use */
-
- #define LISTID ITEMID
- #define CLASSID ITEMID
- #define OBJECTID ITEMID
- #define METHODID ITEMID
- #define FUNCID ITEMID
- #define RULEID ITEMID
- #define GOALID ITEMID
- #define SLOTID ITEMID
- #define CFUNCID ITEMID
- #define EXPID ITEMID
- #define VARID ITEMID
-
-
- #define ITEM_FLAGS BYTE /* GENERIC BYTE bitmask to define attributes */
- /* The ITEM_FLAGS bits */
- #define ITEMOPEN 0x01 /* 0000 0001 */
- #define UNDELETABLE 0x02 /* 0000 0010 */
- #define UNMODIFYABLE 0x06 /* 0000 0110 */
- #define UNREADABLE 0x0e /* 0000 1110 */
- #define HIDDEN 0x10 /* 0001 0000 */
- /* bits 6, 7, and 8 reserved for future use */
-
- /************************
- * EXPRESSION *
- ************************/
- struct s_exp
- {
- BYTE expFlags; /* CAR type, etc. */
- WORD next; /* rel. position of CDR */
- ITEMID car; /* id of CAR element */
- };
-
- typedef struct s_exp FAR * LPEXP;
- #define ARGLIST LPEXP
-
- typedef short (*KAPPROC) (ARGLIST);
- #define NULLPROC (KAPPROC)0
-
- #define CAR(X) (((struct s_exp FAR *)(X))->car)
- #define CDR(X) (((struct s_exp FAR *)(X))->next)
- #define NEXT(X) (((struct s_exp FAR *)(X))->next)
- #define EXPFLAGS(X) (((struct s_exp FAR *)(X))->expFlags)
- /* EXPFLAGS are below */
- #define EXPNULL 0x00 /* 0000 0000 */
- #define EXPATOM 0x01 /* 0000 0001 */
- #define EXPNUMBER 0x02 /* 0000 0010 */
- #define EXPBOOL 0x03 /* 0000 0011 */
- #define EXPEXP 0x04 /* 0000 0100 */
- #define EXPOBJECT 0x05 /* 0000 0101 */
- #define EXPFUNC 0x06 /* 0000 0110 */
- #define EXPRULE 0x07 /* 0000 0111 */
- #define EXPGOAL 0x08 /* 0000 1000 */
- #define EXPCLASS 0x09 /* 0000 1001 */
- #define EXPCFUNC 0x0a /* 0000 1010 */
- #define EXPPAIR 0x0b /* 0000 1011 */
- #define EXPLIST 0x0c /* 0000 1100 */
-
- /** Flags and corresponding test macros **/
- #define kADDMODE 0x00
- #define kPERMMODE 0x00
- #define kCHECKMODE 0x01
- #define kDELETEMODE 0x02
- #define kGETMODE 0x03
- #define kSELECTMODE 0x04
- #define kENUMMODE 0x05
- #define kTEMPMODE 0x06
- #define kINSERTMODE 0x07
- #define kCOUNTMODE 0x08
- #define kINDEXMODE 0x09
- #define kAPPENDMODE 0x0A
- #define kPOSITIONMODE 0x0B
- #define kRELEASEMODE 0x0C
- #define kAPPENDUMODE 0x0D
- #define kCLEARMODE 0x0E
- #define kNAMEMODE 0x0F
- #define kPAIRMODE 0x10
-
- /** Macros checking mode of operation **/
- #define IS_ADD_MODE(wFlag) (!wFlag)
- #define IS_CHECK_MODE(wFlag) (!(wFlag ^ kCHECKMODE))
- #define IS_DELETE_MODE(wFlag) (!(wFlag ^ kDELETEMODE))
- #define IS_CLEAR_MODE(wFlag) (!(wFlag ^ kCLEARMODE))
- #define IS_GET_MODE(wFlag) (!(wFlag ^ kGETMODE))
- #define IS_SELECT_MODE(wFlag) (!(wFlag ^ kSELECTMODE))
- #define IS_ENUM_MODE(wFlag) (!(wFlag ^ kENUMMODE))
- #define IS_TEMP_MODE(wFlag) (!(wFlag ^ kTEMPMODE))
- #define IS_INSERT_MODE(wFlag) (!(wFlag ^ kINSERTMODE))
- #define IS_COUNT_MODE(wFlag) (!(wFlag ^ kCOUNTMODE))
- #define IS_INDEX_MODE(wFlag) (!(wFlag ^ kINDEXMODE))
- #define IS_APPEND_MODE(wFlag) (!(wFlag ^ kAPPENDMODE))
- #define IS_APPENDU_MODE(wFlag) (!(wFlag ^ kAPPENDUMODE))
- #define IS_POSITION_MODE(wFlag) (!(wFlag ^ kPOSITIONMODE))
- #define IS_RELEASE_MODE(wFlag) (!(wFlag ^ kRELEASEMODE))
- #define IS_NAME_MODE(wFlag) (!(wFlag ^ kNAMEMODE))
- #define IS_PAIR_MODE(wFlag) (!(wFlag ^ kPAIRMODE))
-
- /** Item status flags and corresponding macros **/
- #define kDELETED 0x01
- #define IS_ITEM_DELETED(wFlag) (wFlag & kDELETED)
- #define MARK_ITEM_DELETED(wFlag) (wFlag = (wFlag | kDELETED))
-
- /**********************************************************************
- Number of LISTS
-
- NUM_LISTS number of lists in a chunks
- NUM_LISTELEM number of liste items in a list
- **********************************************************************/
- #define NUM_LISTS 100
- #define NUM_LISTELEM 10
-
- /**********************************************************************
- Number of EXPS
-
- kEXPCHUNK size of each expression chunk
- **********************************************************************/
- #define kEXPCHUNK 5000
-
- /**********************************************************************
- Number of ATOMs
-
- kSTRINGHASH is the size of the hash table
- kSTRINGCHUNK size of each string
- **********************************************************************/
- #define kSTRINGHASH 100 /* size of hash table */
- #define kSTRINGCHUNK 500 /* size of each string chunk */
-
- /*********************************************************************
- Item Numbers
-
- Each item chunk is initialized to allow NUM_item of objects.
- When adding (NUM_item + 1) items, a new chunk of size
- NUM_item is created.
- *********************************************************************/
- #define NUM_OBJECT 100
- #define NUM_CLASS 100
- #define NUM_RULE 50
- #define NUM_METHOD 50
- #define NUM_FUNC 100
- #define NUM_GOAL 50
- #define NUM_SLOT 500
- #define NUM_OPTIONS 100
- #define NUM_CFUNC 100
- #define NUM_VAR 100
-
- /**********************************************************************
- Additional TYPEDEF's
- **********************************************************************/
- typedef unsigned char BITS;
-
- /**********************************************************************
- L O O P I N G
- **********************************************************************/
-
- /*************************/
- /** LIST_LOOP **/
- /*************************/
- typedef struct {
- ITEMID listId;
- GLOBALHANDLE hCurrentChunk;
- GLOBALHANDLE hNextChunk;
- WORD wIndex;
- ITEMID FAR *lpList;
- BOOL bFlags;
- } LIST_LOOP;
-
- typedef LIST_LOOP FAR *LISTLOOP;
- #define SIZE_LISTLOOP (sizeof (LIST_LOOP))
- #define INUSE 0x01
- #define WIRED 0x02
-
- GLOBALHANDLE InitListLoop (ITEMID, LISTLOOP FAR *);
- ITEMID NextElement (LISTLOOP);
-
- /**********************************************************************
- L I S T L O O P Macros
- **********************************************************************/
- /******************************
- INIT_LIST_LOOP: initializes the list loop struct. Need
- to call before starting loop on list.
- ******************************/
- #define INIT_LIST_LOOP(listId,hLoop,lpLoop) \
- hLoop = InitListLoop(listId, (LISTLOOP FAR *)&lpLoop)
-
- /******************************
- NEXT_ELEMENT: returns the next list element. Returns the next itemId.
- If itemId is zero, loop has terminated.
- ******************************/
- ITEMID NEXT_LIST_ELEMENT(LISTLOOP);
-
- /******************************
- RELEASE_LIST_LOOP: Unlocks any locked chunks and frees loop struct.
- ******************************/
- int RELEASE_LIST_LOOP(GLOBALHANDLE,LISTLOOP);
-
-
- /**********************************************************************
- Interface Functions
- **********************************************************************/
- /* initialize routines in kappa.c */
- int FAR PASCAL WinMain (HANDLE, HANDLE, LPSTR, int);
- void InitNewApplication (void);
- void InitOpenApplication (void);
- WORD KappaInit (WORD, HANDLE, HANDLE, LPSTR, int);
- int KappaLoad (WORD, LPSTR);
-
- /** item.c **/
- WORD Init_Items (void);
- short Clear_Items (void);
- ITEMID Add_Item (WORD, LPSTR FAR *);
- WORD Check_Item (WORD, ITEMID);
- LPSTR Get_Item (WORD, ITEMID);
- ITEMID Copy_Item (WORD, ITEMID, LPSTR FAR *);
- WORD Delete_Item (WORD, ITEMID);
- WORD Release_Item (WORD, ITEMID);
- ITEMID Select_Item (WORD, LPSTR FAR *, WORD (FAR *)(), LPSTR);
- void Enum_Item (WORD, WORD (FAR *)(), LPSTR);
- WORD Count_Item (WORD);
- ATOMID _GetItemDesc (WORD, ITEMID);
- ATOMID _SetItemDesc (WORD, ITEMID, ATOMID);
-
- /** exp.c **/
- WORD Init_Exps (void);
- short Clear_Exps (void);
- EXPID Make_Exp (WORD, LPSTR FAR *, BITS);
- LPSTR Get_Exp (EXPID, WORD *);
- WORD Check_Exp (EXPID, WORD *);
- WORD Delete_Exp (EXPID);
- WORD Release_Exp (EXPID);
- ITEMID Copy_Exp (EXPID, LPSTR FAR *, BITS);
- GLOBALHANDLE MakeTempExp( WORD, LPLPSTR );
- WORD ReleaseTempExp( GLOBALHANDLE, short );
- WORD ReleaseAllTempExp (void);
-
- /********************************************
- * Expression handling
- ********************************************/
-
- #define TEMP_EXP_SIZE 900
- #define GETCAR(X,A,L) Get_AtomName(CAR(X),(LPSTR)A,L)
- #define SETCAR(X,A) CAR(X)=Add_Atom((LPSTR)A),EXPFLAGS(X)=EXPATOM
-
- WORD _PrintSyntax( FILE *, HWND, LPSTR, LPWORD, WORD, LPEXP, WORD );
-
- WORD FillExpNew ( LPEXP, WORD, FILE *, LPSTR, LPWORD, WORD, LPWORD );
- WORD _ExpToWndStr (LPSTR, LPEXP, WORD, WORD);
- WORD ExpToWndStr (LPSTR, EXPID, WORD, WORD);
- WORD _PrintExp (HWND, FILE *, LPEXP, WORD);
- WORD _PrintExp1 (HWND, FILE *, LPEXP, WORD);
- WORD PrintExp( HWND, FILE *, EXPID, WORD);
- WORD PrintExp1( HWND, FILE *, EXPID, WORD);
- void _PrintVarList (HWND, LISTID);
- void SaveAllVars (HWND, FILE *, LISTID);
-
- WORD CalculateExpSize( LPSTR, LPWORD );
- WORD FillExp( LPEXP, LPSTR, LPWORD );
- WORD CheckExp( LPSTR, LPWORD );
- WORD Exp_Len (EXPID);
- BOOL CatExp (EXPID, EXPID, WORD);
- WORD SubExp_Len (LPEXP, WORD);
- void _CopySubExp (LPEXP, WORD, WORD, LPEXP);
- EXPID CopySubExp (LPEXP, WORD, WORD);
- LPEXP CopyTempSubExp (LPEXP, WORD, WORD, GLOBALHANDLE FAR *);
- LPEXP CopyTempExp (EXPID, GLOBALHANDLE FAR *);
- short EvalExp (EXPID);
- EXPID JoinIfThen (EXPID, EXPID);
- BOOL ClearVarList (LISTID);
- BOOL __BindVars (LISTID, LPEXP, WORD);
- BOOL BindVars (LISTID, EXPID);
- ITEMID __CopyVar (VARID, OBJECTID);
- void ___LoadArgs (LPEXP, LISTID, LPEXP);
- void __LoadArgs (LPEXP, LISTID, LISTID);
- void _LoadArgs (EXPID, LISTID, LPEXP);
- void LoadArgs (EXPID, LISTID, LISTID);
-
- LISTID BuildList (LPSTR);
- LISTID BuildVarList (LPSTR, LISTID FAR *);
- EXPID BuildExp (LPSTR);
- LPEXP _BuildTempExp (LPSTR, GLOBALHANDLE FAR *, BYTE);
- LPEXP BuildTempExp (LPSTR, GLOBALHANDLE FAR *);
- WORD CheckExp (LPSTR, LPWORD);
- BOOL CheckSilentExp (LPSTR);
- SHORT CheckParen (LPSTR, char);
-
- /** list.c **/
- WORD Init_Lists (void);
- short Clear_Lists (void);
- LISTID Make_List (WORD);
- WORD Delete_List (LISTID);
- WORD Release_List (LISTID);
- LISTID Copy_List (LISTID, BITS);
- WORD Check_List (LISTID, WORD *);
- WORD Delete_Elem (LISTID, ITEMID, BITS);
- WORD Append_Elem (LISTID, ITEMID);
- WORD AppendU_Elem (LISTID, ITEMID);
- WORD Insert_Elem (LISTID, ITEMID, ITEMID, BITS);
- ITEMID Get_Elem (LISTID, WORD);
- WORD Get_ElemPos (LISTID, ITEMID);
- WORD Append_ElemPair (LISTID idList, ITEMID idKey, ITEMID idData);
- WORD Delete_ElemPair (LISTID idList, ITEMID idKey);
- ITEMID Get_ElemPair (LISTID idList, ITEMID idKey);
- WORD Replace_PairKey (LISTID idList, ITEMID idOldKey, ITEMID idNewKey);
-
- /** atom.c **/
- WORD Init_AtomTable (WORD);
- short Clear_AtomTable (void);
- WORD Get_AtomName (ITEMID, LPSTR, WORD);
- ATOMID Add_Atom (LPSTR);
- ATOMID Check_Atom (LPSTR);
- WORD Delete_Atom (ATOMID);
- short DumpAtomTable (HANDLE);
- short RestoreAtomTable (HANDLE);
-
- /** adt.c **/
- WORD Init_Adt (void);
- LONG WriteAdtSaveBuf (HANDLE, WORD, WORD, WORD);
- WORD ReadAdtSaveBuf (HANDLE, WORD *, WORD *, WORD *);
- WORD Clear_Adt (void);
- WORD Save_Adt (HANDLE);
- WORD Restore_Adt (HANDLE);
-
-
-
- /* item */
- WORD SelectByName (LPSTR, LPSTR);
- ITEMID _GetItem (WORD, ATOMID);
- ATOMID GetItemName (ITEM_FLAGS, ITEMID);
- WORD _RenameItem (ITEM_FLAGS, ITEMID, ITEMID);
-
- /* Returns the product version in ATOMID form */
- ATOMID GetKAPPAVersionID ();
-
- /**********/
- /* OBJECT */
- /**********/
- OBJECTID _MakeObject( ITEMID, CLASSID );
- ATOMID _DeleteCO (WORD, ITEMID);
- #define MakeObject( ObjName, ClassName ) \
- _MakeObject( ObjName, GetClass( ClassName ) )
- #define GETOBJECT( ObjName ) _GetItem( OBJECT, ObjName )
- #define DELETEOBJECT( ObjName ) _DeleteCO( OBJECT, GETOBJECT( ObjName ) )
- #define SetObjectInfo( ObjectName, idDesc ) \
- _SetItemDesc ( OBJECT, GETOBJECT (ObjectName), idDesc )
- #define GetObjectInfo( ObjectName ) \
- _GetItemDesc ( OBJECT, GETOBJECT (ObjectName) )
- #define RenameObject( ObjectName, NewName ) \
- _RenameItem ( OBJECT, GETOBJECT (ObjectName), NewName )
- WORD SaveAllObjects (FILE *);
- #define WriteAllObjects(file) SaveAllObjects (file)
- WORD SaveObject (OBJECTID, FILE *);
- #define WriteObject(idObjName,file) SaveObject (GETOBJECT(idObjName),file)
- ATOMID MakeIntoObject (ATOMID);
-
- /*********/
- /* CLASS */
- /*********/
- CLASSID _MakeClass( ITEMID, CLASSID );
- #define GetClass( ClassName ) _GetItem( CLASS, ClassName )
- #define MakeClass( ClassName, SuperName ) \
- _MakeClass( ClassName, GetClass( SuperName ) )
- #define DeleteClass( ClassName ) _DeleteCO( CLASS, GetClass( ClassName ) )
- #define SetClassInfo( ClassName, idDesc ) \
- _SetItemDesc ( CLASS, GetClass (ClassName), idDesc )
- #define GetClassInfo( ClassName ) _GetItemDesc ( CLASS, GetClass (ClassName) )
- #define RenameClass( ClassName, NewName ) \
- _RenameItem ( CLASS, GetClass (ClassName), NewName )
- WORD SaveAllClasses (FILE *, CLASSID);
- #define WriteAllClasses(file,idClassName) SaveAllClasses (file,idClassName)
- WORD SaveClass (CLASSID, FILE *);
- #define WriteClass(idClassName,file) SaveClass (GetClass(idClassName),file)
- ATOMID MakeIntoClass (ATOMID);
-
- /* inheritance */
- WORD IsAKindOf( ITEMID, ITEMID );
- WORD _Is_AKindOf( WORD, ITEMID, ITEMID );
- #define _IsObjectAKindOf( Obj, Class ) _Is_AKindOf( OBJECT, Obj, Class )
- #define _IsClassAKindOf( Obj, Class ) _Is_AKindOf( CLASS, Obj, Class )
- ATOMID GetSuper (ATOMID);
-
- /************/
- /* FUNCTION */
- /************/
- FUNCID _MakeFunc( ITEMID, LISTID, EXPID );
- ATOMID _DeleteFunc( FUNCID );
- #define MakeFunc( FuncName, VarList, Body ) \
- _MakeFunc( FuncName, VarList, Body )
- #define MakeFunction( FuncName, VarList, Body ) \
- _MakeFunc( FuncName, VarList, Body )
- #define GetFunc( FuncName ) _GetItem( FUNC, FuncName )
- #define GetFunction( FuncName ) _GetItem( FUNC, FuncName )
- #define DeleteFunc( FuncName ) _DeleteFunc( GetFunc( FuncName ) )
- #define DeleteFunction( FuncName ) _DeleteFunc( GetFunc( FuncName ) )
- #define SetFunctionInfo( idName, idDesc ) \
- _SetItemDesc ( FUNC, GetFunc (idName), idDesc )
- #define GetFunctionInfo( idName ) \
- _GetItemDesc ( FUNC, GetFunc (idName) )
- #define RenameFunction( FuncName, NewName ) \
- _RenameItem ( FUNC, GetFunc (FuncName), NewName )
- #define EvalFunction(idFuncName,idArgList) \
- EvalFunc ( GetFunc (idFuncName), idArgList )
- WORD SaveAllFuncs (FILE *);
- #define WriteAllFunctions(file) SaveAllFuncs (file)
- WORD SaveFunc (FUNCID, FILE *);
- #define WriteFunction(idFuncName,file) SaveFunc(GetFunc(idFuncName),file)
-
- /********/
- /* RULE */
- /********/
- RULEID _MakeRule( ITEMID, LISTID, LISTID, EXPID, EXPID );
- BOOL _SetRulePriority( RULEID, short );
- BOOL _DeleteRule( RULEID );
- #define MakeRule( RuleName, VarList, ClassList, IfPart, ThenPart ) \
- _MakeRule( RuleName, VarList, ClassList, IfPart, ThenPart )
- #define SetRulePriority( RuleName, Priority ) \
- _SetRulePriority( GetRule( RuleName ), (Priority) )
- #define GetRule( RuleName ) _GetItem( RULE, RuleName )
- #define DeleteRule( RuleName ) _DeleteRule( GetRule( RuleName ) )
- #define SetRuleInfo( idName, idDesc ) \
- _SetItemDesc ( RULE, GetRule (idName), idDesc )
- #define GetRuleInfo( idName ) \
- _GetItemDesc ( RULE, GetRule (idName) )
- #define RenameRule( RuleName, NewName ) \
- _RenameItem ( RULE, GetRule (RuleName), NewName )
- WORD SaveAllRules (FILE *);
- #define WriteAllRules(file) SaveAllRules (file)
- WORD SaveRule (RULEID, FILE *);
- #define WriteRule(idRuleName,file) SaveRule (GetRule(idRuleName),file)
- void SetValueInferenceHook (ATOMID, ATOMID, ATOMID, WORD);
- ATOMID g_reset_forward_chain (LPEXP);
-
- /********/
- /* GOAL */
- /********/
- GOALID _MakeGoal( ITEMID, EXPID );
- ATOMID _DeleteGoal( GOALID );
- #define MakeGoal( GoalName, Body ) _MakeGoal( GoalName, Body )
- #define SetGoalPriority( GoalName, Priority ) \
- _SetGoalPriority( GetGoal( GoalName ), Priority )
- #define GetGoal( GoalName ) _GetItem( GOAL, GoalName )
- #define DeleteGoal( GoalName ) _DeleteGoal( GetGoal( GoalName ) )
- #define SetGoalInfo( idName, idDesc ) \
- _SetItemDesc ( GOAL, GetGoal (idName), idDesc )
- #define GetGoalInfo( idName ) \
- _GetItemDesc ( GOAL, GetGoal (idName) )
- #define RenameGoal( GoalName, NewName ) \
- _RenameItem ( GOAL, GetGoal (GoalName), NewName )
- WORD SaveAllGoals (FILE *);
- #define WriteAllGoals(file) SaveAllGoals (file)
- WORD SaveGoal (GOALID, FILE *);
- #define WriteGoal(idGoalName,file) SaveGoal (GetGoal(idGoalName),file)
- BOOL TestGoal (GOALID);
-
- /* slot */
- ITEMID __CopySlot( ITEMID );
- WORD __DeleteSlot( ITEMID, LPSTR );
- SLOTID MakeSlot( ITEMID, ITEMID );
- SLOTID MakeSlotHidden( ITEMID, ITEMID );
- SLOTID _Make_Slot( WORD, ITEMID, ITEMID );
- WORD DeleteSlot( ITEMID, ITEMID );
- WORD _Delete_Slot( WORD, ITEMID, ITEMID );
- SLOTID CopySlot( ITEMID, ITEMID );
- SLOTID _Copy_Slot( WORD, ITEMID, ITEMID );
- SLOTID GetSlot( ITEMID, ITEMID );
- SLOTID _Get_Slot( WORD, ITEMID, ITEMID );
- ITEMID Get_InheritedSlotNames( LPSTR );
- WORD RenameSlot( ITEMID, ITEMID, ITEMID );
- ATOMID SetSlotDesc (ATOMID, ATOMID, ATOMID);
- #define SetSlotInfo( idObjName, idSlotName, idDesc ) \
- SetSlotDesc ( idObjName, idSlotName, idDesc )
- ATOMID GetSlotDesc (ATOMID, ATOMID);
- #define GetSlotInfo( idObjName, idSlotName ) \
- GetSlotDesc ( idObjName, idSlotName )
-
- /* value */
- ITEMID GetSlotValue( ITEMID, ITEMID );
- ITEMID _Get_SlotValue( WORD, ITEMID, ITEMID );
- ITEMID SetSlotValue( ITEMID, ITEMID, ITEMID, WORD );
- ITEMID _Set_SlotValue( WORD, ITEMID, ITEMID, ITEMID, ITEMID, WORD );
-
- /**********/
- /* METHOD */
- /**********/
- ITEMID __CopyMethod( ITEMID, ITEMID );
- WORD __DeleteMethod( ITEMID, LPSTR );
-
- METHODID MakeMethod( ITEMID, ITEMID, ITEMID, ITEMID );
- METHODID _Make_Method( WORD, ITEMID, ITEMID, ITEMID, ITEMID );
- ATOMID DeleteMethod( ITEMID, ITEMID );
- WORD _Delete_Method( WORD, ITEMID, ITEMID );
- METHODID CopyMethod( ITEMID, ITEMID );
- METHODID _Copy_Method( WORD, ITEMID, ITEMID );
- METHODID GetMethod( ITEMID, ITEMID );
- METHODID _Get_Method( WORD, ITEMID, ITEMID );
- WORD EvalMethod( ITEMID, ITEMID, ITEMID );
- WORD _Eval_Method( WORD, ITEMID, ITEMID, ITEMID );
- ITEMID Get_InheritedMethodNames ( LPSTR );
- ATOMID SetMethodDesc (ATOMID, ATOMID, ATOMID);
- #define SetMethodInfo(idObjName,idMethodName,idInfo) \
- SetMethodDesc ( idObjName, idMethodName, idInfo )
- ATOMID GetMethodDesc (ATOMID, ATOMID);
- #define GetMethodInfo(idObjName,idMethodName) \
- GetMethodDesc ( idObjName, idMethodName )
- WORD RenameMethod (ITEMID, ITEMID, ITEMID);
-
-
- /********/
- /* LIST */
- /********/
- WORD List_Len( LISTID );
- BOOL ClearList( LISTID, WORD );
- LISTID DeepListCopy( LISTID, ITEMID (FAR *)(), ITEMID );
- void EnumList( LISTID, WORD (FAR *)(), LPSTR );
- ITEMID SelectElem( LISTID, WORD (FAR *)(), LPSTR );
- #define _CopyList(OldListID) Copy_List(OldListID, kPERMMODE)
-
- /************/
- /* UI Stuff */
- /************/
- ATOMID AfromT (WORD);
- void AskUser (ATOMID, ATOMID, LPSTR, WORD, LPSTR);
- short ExplainPair (ATOMID, ATOMID, WORD);
- BOOL IsNumber (PSTR);
- ATOMID KappaPostInputForm (WORD wOpt, ATOMID idTitle, WORD wLen, ...);
- ATOMID KappaPostMenu (ATOMID idTitle, WORD wLen, ...);
- ATOMID KappaPostMultipleSelection (ATOMID idTitle, ATOMID idObjName,
- ATOMID idSlotName, WORD wLen, ...);
- ATOMID PrintHierarchy (ATOMID);
- WORD GetWordFromFile (FILE *, LPSTR, WORD);
- ATOMID SetPostMessageTitle (ATOMID);
- int WriteTreeOnFile (ATOMID, FILE *);
-
- /* Constants for mode of argument evaluation */
- #define NO_EVAL_ARGS 1
- #define EVAL_ARGS 0
-
- /*
- ** registering and posting errors
- */
- void PostKappaErrorMessage (void);
- void ClearTraceStack (void);
- WORD RegisterKappaMessage (WORD, ATOMID, ATOMID, ATOMID);
-
- /**********************************************************************
- Macros for ShowSubNodes of Browser
- **********************************************************************/
- #define BR_MAKEVISIBLE 1
- #define BR_MAKEINVISIBLE 2
- #define BR_TOGGLE 3
-
- /*********************************************************************/
- /* KAL function definitions */
- /*********************************************************************/
- KAPPROC GetKappaFunction (ITEMID, WORD *);
- void build_function (LPSTR, KAPPROC, BYTE, BYTE);
- #define Register_Function(name,fcn,eval,type) \
- build_function ( (LPSTR)name, (KAPPROC)fcn, (BYTE)eval, (BYTE)type )
-
- /**********************************************************************
- Macros for different function categories
- **********************************************************************/
- #define CAT_KNOW 0x01
- #define CAT_MATH 0x02
- #define CAT_STR 0x03
- #define CAT_LST 0x04
- #define CAT_LOG 0x05
- #define CAT_FILE 0x06
- #define CAT_CONS 0x07
- #define CAT_USER 0x08
- #define CAT_WND 0x09
- #define CAT_MISC 0x0b
- #define CAT_NONE 0x0e
- #define CAT_ALL 0x0f
-
- /**********************************************************************
- Macros for return types
- **********************************************************************/
- #define RET_STR 0x10
- #define RET_NUM 0x20
- #define RET_BOOL 0x30
- #define RET_OBJ 0x40
- #define RET_CLA 0x50
- #define RET_FUN 0x60
- #define RET_LST 0x70 /* returns a list */
- #define RET_ATM 0x80 /* returns an atom */
- #define RET_NONE 0xe0
- #define RET_ALL 0xf0
-
- /**********************************************************************
- Macros for making catagories
- **********************************************************************/
- #define CAT_TYPE 0x0f
- #define RET_TYPE 0xf0
- #define GET_CATEGORY(x) (BYTE) (((BYTE)(x)) & CAT_TYPE)
- #define GET_RETURN(x) (BYTE) (((BYTE)(x)) & RET_TYPE)
- #define MAKE_WORD(a,b) ((WORD) ( (((WORD) (b)) << 8) | ((BYTE) (a)) ))
-
-
- /**********************************************************************
- Mark as System functions.
- **********************************************************************/
- WORD _Mark_SystemItem (WORD, ITEMID, BOOL);
- WORD MarkSystemSlot (ATOMID, ATOMID);
- WORD MarkSystemMethod (ATOMID, ATOMID);
- #define KappaMarkSystemClass(idClassName) \
- (_Mark_SystemItem (CLASS, GetClass(idClassName), TRUE) ? idClassName : NULLID)
- #define KappaMarkSystemRule(idRuleName) \
- (_Mark_SystemItem (RULE, GetRule(idRuleName), TRUE) ? idRuleName : NULLID)
- #define KappaMarkSystemGoal(idGoalName) \
- (_Mark_SystemItem (GOAL, GetGoal(idGoalName), TRUE) ? idGoalName : NULLID)
- #define KappaMarkSystemFunc(idFuncName) \
- (_Mark_SystemItem (FUNC, GetFunc(idFuncName), TRUE) ? idFuncName : NULLID)
- #define KappaMarkSystemInstance(idObjName) \
- (_Mark_SystemItem (OBJECT, GETOBJECT(idObjName), TRUE) ? idObjName : NULLID)
- #define KappaMarkSystemSlot(idObjName,idSlotName) \
- MarkSystemSlot (idObjName, idSlotName)
- #define KappaMarkSystemMethod(idObjName,idMethName) \
- MarkSystemMethod (idObjName, idMethName)
-
- /*************************************************************************/
- /* Conversion functions */
- /*************************************************************************/
- #define KAPPA_ATOMTYPE 1
- #define KAPPA_LISTTYPE 2
- #define KAPPA_EXPTYPE 3
- #define KAPPA_STRINGTYPE 4
- #define KAPPA_DOUBLETYPE 5
- #define KAPPA_FLOATTYPE 6
- #define KAPPA_INTTYPE 7
- #define KAPPA_LONGTYPE 8
-
- /* ATOMID to C-variables */
- WORD _KappaGetAtom (ATOMID, BYTE, LPSTR, WORD);
-
- /* Temp declaration */
- short sKappaTmpShort;
- WORD wKappaTmpWord;
- LISTID idKappaTmpList;
-
- /**************************************
- WORD KappaGetString (IdString, Buffer, BufferSize);
- ***************************************/
- #define KappaGetString(atm,x,y) \
- _KappaGetAtom (atm, KAPPA_STRINGTYPE, (LPSTR)(x), (WORD) y)
- /**************************************
- WORD KappaGetDouble (IdDouble, DoubleVar);
- ***************************************/
- #define KappaGetDouble(atm,x) \
- _KappaGetAtom (atm, KAPPA_DOUBLETYPE, (LPSTR)&(x), 0)
- /**************************************
- WORD KappaGetFloat (IdFloat, FloatVar);
- ***************************************/
- #define KappaGetFloat(atm,x) \
- _KappaGetAtom (atm, KAPPA_FLOATTYPE, (LPSTR)&(x), 0)
- /**************************************
- WORD KappaGetInt (IdInt, IntVar);
- ***************************************/
- #define KappaGetInt(atm,x) \
- _KappaGetAtom (atm, KAPPA_INTTYPE, (LPSTR)&(x), 0)
- /**************************************
- WORD KappaGetLong (IdLong, LongVar);
- ***************************************/
- #define KappaGetLong(atm,x) \
- _KappaGetAtom (atm, KAPPA_LONGTYPE, (LPSTR)&(x), 0)
-
- /* C-variables to ATOMID */
- ATOMID _KappaMakeAtom (BYTE, LPSTR, LONG, double);
-
- /*************************************
- WORD KappaMakeString (null_terminated_string);
- **************************************/
- #define KappaMakeString(x) \
- _KappaMakeAtom (KAPPA_STRINGTYPE, (LPSTR)x, 0L, (double)0.0 )
- /*************************************
- WORD KappaMakeDouble (DoubleVar);
- **************************************/
- #define KappaMakeDouble(x) \
- _KappaMakeAtom (KAPPA_DOUBLETYPE, LPNULL, 0L, (double)x)
- /*************************************
- WORD KappaMakeFloat (FloatVar);
- **************************************/
- #define KappaMakeFloat(x) \
- _KappaMakeAtom (KAPPA_FLOATTYPE, LPNULL, 0L, (double)x )
- /*************************************
- WORD KappaMakeInt (IntVar);
- **************************************/
- #define KappaMakeInt(x) \
- _KappaMakeAtom (KAPPA_INTTYPE, LPNULL, (LONG)x, (double)0.0 )
- /*************************************
- WORD KappaMakeLong (LongVar);
- **************************************/
- #define KappaMakeLong(x) \
- _KappaMakeAtom (KAPPA_LONGTYPE, LPNULL, (LONG)x, (double)0.0 )
-
- /* SLOTS to C variables */
- ATOMID GetValue (ATOMID, ATOMID);
- LISTID GetListValue (ATOMID, ATOMID);
-
- /*************************************
- WORD KappaGetSlotString (idObjName, idSlotName, Buffer, BufferSize);
- **************************************/
- #define KappaGetSlotString(obj,slot,x,y) \
- KappaGetString (GetValue (obj, slot), x, y)
- /*************************************
- WORD KappaGetSlotDouble (idObjName, idSlotName, DoubleVar);
- **************************************/
- #define KappaGetSlotDouble(obj,slot,x) \
- KappaGetDouble (GetValue (obj, slot), x)
- /*************************************
- WORD KappaGetSlotFloat (idObjName, idSlotName, FloatVar);
- **************************************/
- #define KappaGetSlotFloat(obj,slot,x) \
- KappaGetFloat (GetValue (obj, slot), x)
- /*************************************
- WORD KappaGetSlotInt (idObjName, idSlotName, IntVar);
- **************************************/
- #define KappaGetSlotInt(obj,slot,x) \
- KappaGetInt (GetValue (obj, slot), x)
- /*************************************
- WORD KappaGetSlotLong (idObjName, idSlotName, LongVar);
- **************************************/
- #define KappaGetSlotLong(obj,slot,x) \
- KappaGetLong( GetValue( obj, slot ), x)
-
- /* Set Slot from C variables */
- WORD SetValue (ATOMID, ATOMID, ATOMID);
- WORD SetListValue (ATOMID, ATOMID, LISTID);
-
- /*************************************
- WORD KappaSetSlotString (idObjName, idSlotName, Null_Terminated_String);
- **************************************/
- #define KappaSetSlotString(obj,slot,x) \
- SetValue (obj, slot, KappaMakeString (x))
- /*************************************
- WORD KappaSetSlotDouble (idObjName, idSlotName, DoubleVar);
- **************************************/
- #define KappaSetSlotDouble(obj,slot,x) \
- SetValue (obj, slot, KappaMakeDouble (x))
- /*************************************
- WORD KappaSetSlotFloat (idObjName, idSlotName, FloatVar);
- **************************************/
- #define KappaSetSlotFloat(obj,slot,x) \
- SetValue (obj, slot, KappaMakeFloat (x))
- /*************************************
- WORD KappaSetSlotInt (idObjName, idSlotName, IntVar);
- **************************************/
- #define KappaSetSlotInt(obj,slot,x) \
- SetValue (obj, slot, KappaMakeInt(x))
- /*************************************
- WORD KappaSetSlotLong( idObjName, idSlotName, LongVar );
- **************************************/
- #define KappaSetSlotLong(obj,slot,x) \
- SetValue( obj, slot, KappaMakeLong( x ))
-
- /* Get C-Kappa variables from argument list (LPEXP) */
- WORD KappaArgCount (ARGLIST);
- ATOMID KappaGetNthArg (ARGLIST, WORD, BYTE);
-
- /*************************************
- LPEXP KappaGetArgExp (ArgList, pos);
- **************************************/
- LPEXP KappaGetArgExp (ARGLIST, WORD);
-
- /*************************************
- WORD KappaGetArgAtom (ArgList, pos, AtomIdVar);
- **************************************/
- #define KappaGetArgAtom(exp,n,x) \
- (x = (ATOMID) KappaGetNthArg (exp, n, KAPPA_ATOMTYPE))
- /*************************************
- WORD KappaGetArgList (ArgList, pos, ListIdVar);
- **************************************/
- #define KappaGetArgList(exp,n,x) \
- (x = (LISTID) KappaGetNthArg (exp, n, KAPPA_LISTTYPE))
- /*************************************
- WORD KappaGetArgString (ArgList, pos, Buffer, BufferSize);
- **************************************/
- #define KappaGetArgString(exp,n,x,y) \
- KappaGetString (KappaGetNthArg (exp, n, KAPPA_ATOMTYPE), x, y)
- /*************************************
- WORD KappaGetArgDouble (ArgList, pos, DoubleVar);
- **************************************/
- #define KappaGetArgDouble(exp,n,x) \
- KappaGetDouble (KappaGetNthArg (exp, n, KAPPA_ATOMTYPE), x)
- /*************************************
- WORD KappaGetArgFloat (ArgList, pos, FloatVar);
- **************************************/
- #define KappaGetArgFloat(exp,n,x) \
- KappaGetFloat (KappaGetNthArg (exp, n, KAPPA_ATOMTYPE), x)
- /*************************************
- WORD KappaGetArgInt (ArgList, pos, IntVar);
- **************************************/
- #define KappaGetArgInt(exp,n,x) \
- KappaGetInt (KappaGetNthArg (exp, n, KAPPA_ATOMTYPE), x)
- /*************************************
- WORD KappaGetArgLong (ArgList, pos, LongVar);
- **************************************/
- #define KappaGetArgLong(exp,n,x) \
- KappaGetLong( KappaGetNthArg( exp, n, KAPPA_ATOMTYPE ), x)
-
- /*********************************************************************
- ** Definition of Macros for returning values **
- ** extern LONG KappaReturnSet; **
- ** extern ATOMID idOk, idFalse, idTrue, idNull; **
- **********************************************************************/
- #define RETURNVALUE HIWORD( KappaReturnSet )
- #define RETURNFLAGS LOWORD( KappaReturnSet )
- short _KappaReturn (WORD, WORD);
- #define KappaReturnError return (KappaReturnSet=MAKELONG(EXPNULL,NULL), ERROR)
- #define KappaReturn(x,y) return _KappaReturn (x, y)
-
- #define KappaReturnOk KappaReturn( EXPATOM, idOk )
- #define KappaReturnTrue KappaReturn( EXPATOM, idTrue )
- #define KappaReturnFalse KappaReturn( EXPATOM, idFalse )
-
- #define KappaReturnAtom(x) KappaReturn (EXPATOM, x)
- #define KappaReturnString(x) KappaReturnAtom (KappaMakeString (x))
- #define KappaReturnDouble(x) KappaReturnAtom (KappaMakeDouble (x))
- #define KappaReturnFloat(x) KappaReturnAtom (KappaMakeFloat (x))
- #define KappaReturnInt(x) KappaReturnAtom (KappaMakeInt (x))
- #define KappaReturnLong(x) KappaReturnAtom (KappaMakeLong (x))
- #define KappaReturnList(x) KappaReturn (EXPLIST, x)
-
- /********************************************************************
- KAL Function equivalants
- *********************************************************************/
- /* ApplyKALStatement takes string representing a KAL expression,
- and then parses it and evaluates it
- */
- ATOMID ApplyKALStatement (LPSTR);
-
- /* ApplyFunction takes a variable number of arguments!
- 1st arg = function name id,
- 2nd arg = number of arguments,
- 3rd ... = argument atom ids
- Example:
- ...
- if (ApplyFunction (idSetValue, 3, idObj, idSlot, idValue) == ERROR)
- return ERROR;
- ...
- */
- ATOMID ApplyFunction (ATOMID, WORD, ...);
-
- /* ApplyListFunction takes a variable number of arguments!
- 1st arg = function name id,
- 2nd arg = number of arguments,
- 3rd arg = argument list id is always first,
- 4th ... = argumeet atom ids
- Example:
- ...
- if (ApplyListFunction (idGetNthElem, 3, idList, idN) == ERROR)
- return ERROR;
- ...
- */
- ATOMID ApplyListFunction (ATOMID, WORD, ...);
-
- /* ApplyQueryFunction takes a pointer to a function
- 1st arg = function name id,
- 2nd arg = ATOMID argument,
- 3rd arg = lpFunction
- Example:
- ...
- if (ApplyQueryFunction (idForAll, idClass, lpFunction) == ERROR)
- return ERROR;
- ...
- */
- ATOMID ApplyQueryFunction (ATOMID, ATOMID, short (FAR *)() );
-
- /* ApplyQueryListFunction, returns a list
- 1st arg = function name id,
- 2nd arg = ATOMID argument
- Example:
- ...
- if ((idList=ApplyQueryListFunction (idGetSlotList, idObjName)) == ERROR)
- return ERROR;
- ...
- */
- LISTID ApplyQueryListFunction (ATOMID, ATOMID);
-
- /* ApplyInferenceFunction, invokes I.E.
- 1st arg = function name id, (idForwardChain or idBackwardChain)
- 2nd arg = Goal Name,
- 3rd arg = Rule List
- Example:
- ...
- if (ApplyInferenceFunction (idForwardChain,NULLID,NULLID) == ERROR)
- return ERROR;
- ...
- */
- LISTID ApplyInferenceFunction( ATOMID, ATOMID, LISTID );
-
- short Kpp_SaveTranscriptImage( ATOMID, FILE * );
-
- /********************************************************
- **
- ** DEFINITIONS FOR THE 'C' REPRESENTATIONS
- ** OF THE KAL FUNCTIONS IN KAPPA.
- **
- ** All functions start with the Kappa prefix, followed by
- ** the actual name of the function in KAL. All ? are
- ** replaced by Q.
- **
- ********************************************************/
-
- WORD wDummy1;
- char kappa_c_buffer[RET_BUFFER_LEN];
-
- #define KappaRegisterMessage( idAtom1 ) \
- RegisterKappaMessage( IDE_USER, idAtom1, NULLID, NULLID );
-
- /* ATOMID KappaActivateRule (ATOMID idRuleName); */
- #define KappaActivateRule(idRuleName) \
- ApplyFunction(AfromT(IDF_ACTIVATERULE),1,idRuleName)
-
- /* LISTID _KappaAppendToList (LISTID idList, ATOMID idElem); */
- #define _KappaAppendToList(idList,idElem) \
- (Append_Elem (idList,idElem) ? idList : NULLID)
-
- /* LISTID KappaAppendToList (ATOMID idObjName, ATOMID idSlotName,
- ATOMID idElem); */
- #define KappaAppendToList(idObjName,idSlotName,idElem) \
- ApplyFunction (AfromT(IDF_APPENDTOLIST),3,idObjName,idSlotName,idElem)
-
- /* ATOMID KappaAreAllQ (ATOMID idClassName,
- short (FAR * lpFunction) (ATOMID)); */
- #define KappaAreAllQ(idClass,lpFunction) \
- ApplyQueryFunction(AfromT(IDF_AREALLQUESTION),idClass,lpFunction)
-
- #define KappaAskValue(idObjName,idSlotName) \
- ApplyFunction(AfromT(IDF_ASKVALUE),2,idObjName,idSlotName)
-
- #define KappaAssert(idObjName,idSlotName) \
- SetValueInferenceHook(idObjName,idSlotName,NULL,EXPATOM)
-
- #define _KappaAverage(idList) \
- ApplyListFunction(AfromT(IDF_AVERAGE),1,idList)
-
- #define KappaAverage(idObjName,idSlotName) \
- _KappaAverage(GetListValue(idObjName,idSlotName))
-
- #define KappaBackwardChain(idGoalName,idRuleList) \
- ApplyInferenceFunction(AfromT(IDF_BACKCHAIN),idGoalName,idRuleList)
-
- #define KappaBeep() \
- ApplyFunction(AfromT(IDF_BEEP),0)
-
- #define KappaClassQ(idClassName) \
- ((GetClass(idClassName)==NULLID)?idFalse:idTrue)
-
- #define KappaClearImageLink(idImageName) \
- ApplyFunction(AfromT(IDF_CLEARWIDGETLINK),1,idImageName)
-
- #define KappaClearTranscriptImage(idImageName) \
- ApplyFunction(AfromT(IDF_CLEARTRANSCRIPTWIDGET),1,idImageName)
-
- #define _KappaClearList(idList) \
- (Clear_List(idList) ? idList : NULLID)
-
- #define KappaClearList(idObjName,idSlotName) \
- ApplyFunction(AfromT(IDF_CLEARLIST),2,idObjName,idSlotName)
-
- #define KappaConvertBrowserDisplayText(idClassName) \
- ApplyFunction(AfromT(IDF_CONVERTBROWSERDISPLAYTEXT),1,idClassName)
-
- #define KappaCopyBitmapToClipboard(idBitmapImage) \
- (ApplyFunction(AfromT(IDF_COPYBITMAPTOCLIPBOARD),1,idBitmapImage) \
- ? idTrue : FALSE)
-
- #define KappaCountAllInstances(idClassName) \
- ApplyFunction(AfromT(IDF_COUNTALLOBJECTS),1,idClassName)
-
- #define KappaCountAllSubClasses(idClassName) \
- ApplyFunction(AfromT(IDF_COUNTALLSUBCLASSES),1,idClassName)
-
- #define KappaCountInstances(idClassName) \
- ApplyFunction(AfromT(IDF_COUNTOBJECTS),1,idClassName)
-
- #define KappaCountSubClasses(idClassName) \
- ApplyFunction(AfromT(IDF_COUNTSUBCLASSES),1,idClassName)
-
- #define KappaDate() \
- ApplyFunction(AfromT(IDF_DATE),0)
-
- #define KappaDeactivateRule(idRuleName) \
- ApplyFunction(AfromT(IDF_DEACTIVATERULE),1,idRuleName)
-
- #define KappaDeleteClass(idClassName) \
- (DeleteClass(idClassName) ? idClassName : ERROR)
-
- #define KappaDeleteFunction(idFuncName) \
- (DeleteFunction(idFuncName) ? idFuncName : ERROR)
-
- #define KappaDeleteGoal(idGoalName) \
- (DeleteGoal(idGoalName) ? idGoalName : ERROR)
-
- #define KappaDeleteMethod(idObjName,idMethodName) \
- DeleteMethod(idObjName,idMethodName)
-
- #define KappaDeleteImage(idImageName) \
- (DELETEOBJECT(idImageName) ? idTrue : ERROR)
-
- #define KappaDeleteInstance(idInstanceName) \
- (DELETEOBJECT(idInstanceName) ? idTrue : ERROR)
-
- /* FSC: This is a dangerous function. The user may delete a list that
- is refered to by someone else. */
- #define KappaDeleteList(idList) \
- (Delete_List(idList)?idTrue:NULLID)
-
- #define KappaDeleteRule(idRuleName) \
- DeleteRule(idRuleName)
-
- #define KappaDeleteSlot(idObjName,idSlotName) \
- DeleteSlot(idObjName,idSlotName)
-
- #define KappaDisplayFile(idTransImage,idFileName) \
- ApplyFunction(AfromT(IDF_DISPLAYFILE),2,idTransImage,idFileName)
-
- #define KappaDisplayText(idTransImage,idText) \
- ApplyFunction(AfromT(IDF_DISPLAYTEXT),2,idTransImage,idText)
-
- #define KappaDrawImage(idImageName) \
- ApplyFunction(AfromT(IDF_DRAWWIDGET),1,idImageName)
-
- #define KappaDrawText(idText) \
- ApplyFunction(AfromT(IDF_DRAWTEXT),1,idText)
-
- #define KappaEllipse(iX,iY) \
- ApplyFunction(AfromT(IDF_ELLIPSE),2,KappaMakeInt(iX),KappaMakeInt(iY))
-
- #define KappaEnumList(idList,lpFunction) \
- ApplyQueryFunction(AfromT(IDF_ENUMLIST),idList,lpFunction)
-
- #define KappaEnumSubClasses(idClass,lpFunction) \
- ApplyQueryFunction(AfromT(IDF_ENUMSUBCLASSES),idClass,lpFunction)
-
- #define KappaExecute(idProgName,idArg1,idArg2,idArg3) \
- ApplyFunction(AfromT(IDF_EXECUTE),4,idProgName,idArg1,idArg2,idArg3)
-
- #define KappaExit() \
- ApplyFunction(AfromT(IDF_EXIT),0)
-
- #define KappaExplain(idObjName,idSlotName) \
- (ExplainPair(idObjName,idSlotName,0) ? idTrue : FALSE)
-
- #define KappaForAll(idClass,lpFunction) \
- ApplyQueryFunction(AfromT(IDF_FORALL),idClass,lpFunction)
-
- #define KappaForwardChain(idGoalName,idRuleList) \
- ApplyInferenceFunction(AfromT(IDF_FORWARDCHAIN),idGoalName,idRuleList)
-
- #define KappaFreezeWindow(idKappaWindowCode) \
- ApplyFunction(AfromT(IDF_FREEZEWINDOW),1,idKappaWindowCode)
-
- #define KappaFunctionQ(idFuncName) \
- ((GetKappaFunction(idFuncName,&wDummy1)==(KAPPROC)NULL)?idFalse:idTrue)
-
- #define KappaGetBrowserFocus() \
- ApplyFunction(AfromT(IDF_GETFOCUS),0)
-
- #define KappaGetClassComment(idClassName) \
- GetClassInfo(idClassName)
-
- #define KappaGetClock() \
- ApplyFunction(AfromT(IDF_GETCLOCK),0)
-
- #define KappaGetDepth(idClassName) \
- ApplyFunction(AfromT(IDF_GETDEPTH),1,idClassName)
-
- #define _KappaGetElemPos(idList,idElem) \
- ((wKappaTmpWord = Get_ElemPos(idList,idElem)) ? \
- KappaMakeInt (wKappaTmpWord) : ERROR)
-
- #define KappaGetElemPos(idObjName,idSlotName,idElem) \
- _KappaGetElemPos(GetListValue(idObjName,idSlotName),idElem)
-
- #define KappaGetFunctionComment(idFuncName) \
- GetFunctionInfo(idFuncName)
-
- #define KappaGetGoalComment(idGoalName) \
- GetGoalInfo(idGoalName)
-
- #define KappaGetMethodComment(idObjName,idMethodName) \
- GetMethodInfo(idObjName,idMethodName)
-
- #define _KappaGetNthElem(idList,nth) \
- Get_Elem(idList,nth)
-
- #define KappaGetNthElem(idObjName,idSlotName,nth) \
- _KappaGetNthElem(GetListValue(idObjName,idSlotName),nth)
-
- #define KappaGetInstanceComment(idInstanceName) \
- GetObjectInfo(idInstanceName)
-
- /* FSC: This is a dangerous function. The user has to delete this
- list after being done with it. */
- #define _KappaGetInstanceList(idClassName) \
- ApplyQueryListFunction(AfromT(IDF_GETOBJECTLIST),idClassName)
-
- #define KappaGetInstanceList(idClassName,idObjName,idSlotName) \
- ((idKappaTmpList = _KappaGetInstanceList(idClassName)) ? \
- (KappaSetListValue(idObjName,idSlotName,idKappaTmpList) ? \
- idKappaTmpList : FALSE) : FALSE)
-
- #define KappaGetOwner(idObjName,idSlotName) \
- ApplyFunction(AfromT(IDF_GETOWNER),2,idObjName,idSlotName)
-
- #define KappaGetParent(idObjName) \
- GetSuper(idObjName)
-
- #define KappaGetRuleComment(idRuleName) \
- GetRuleInfo(idRuleName)
-
- #define KappaGetScreenWidth() \
- ApplyFunction(AfromT(IDF_GETSCREENWIDTH),0)
-
- #define KappaGetScreenHeight() \
- ApplyFunction(AfromT(IDF_GETSCREENHEIGHT),0)
-
- #define KappaGetSlotComment(idObjName,idSlotName) \
- GetSlotInfo(idObjName,idSlotName)
-
- /* FSC: This is a dangerous function. The user has to delete this
- list after being done with it. */
- #define _KappaGetSlotList(idObjName) \
- ApplyQueryListFunction(AfromT(IDF_GETSLOTLIST),idObjName)
-
- #define KappaGetSlotList(idSlotObjName,idObjName,idSlotName) \
- KappaSetListValue(idObjName,idSlotName,_KappaGetSlotList(idSlotObjName))
-
- #define KappaGetSlotOption(idObjName,idSlotName,idOptionCode) \
- ApplyFunction(AfromT(IDF_GETSLOTOPTION),3,idObjName,idSlotName,idOptionCode)
-
- /* FSC: This is a dangerous function. The user has to delete this
- list after being done with it. */
- #define _KappaGetSubClassList(idClassName) \
- ApplyQueryListFunction(AfromT(IDF_GETSUBCLASSLIST),idClassName)
-
- #define KappaGetSubClassList(idClassName,idObjName,idSlotName) \
- KappaSetListValue(idObjName,idSlotName,_KappaGetSubClassList(idClassName))
-
- #define KappaGetValue(idObjName,idSlotName) \
- GetValue(idObjName,idSlotName)
-
- #define KappaGetListValue(idObjName,idSlotName) \
- GetListValue(idObjName,idSlotName)
-
- #define KappaGoalQ(idGoalName) \
- ((GetGoal(idGoalName)==NULLID)?idFalse:idTrue)
-
- #define KappaHideBrowserInstances(idClassName) \
- ApplyFunction(AfromT(IDF_HIDEOBJECTS),1,idClassName)
-
- #define KappaHideBrowserSubClasses(idClassName) \
- ApplyFunction(AfromT(IDF_HIDESUBCLASSES),1,idClassName)
-
- #define KappaHideImage(idImageName) \
- ApplyFunction(AfromT(IDF_HIDEWIDGET),1,idImageName)
-
- #define KappaHideWindow(idKappaWindowCode) \
- ApplyFunction(AfromT(IDF_HIDEWINDOW),1,idKappaWindowCode)
-
- #define KappaIconifyWindow(idKappaWindowCode) \
- ApplyFunction(AfromT(IDF_ICONIFYWINDOW),1,idKappaWindowCode)
-
- #define _KappaInsertNthElem(idList,nth,idElem) \
- (Check_List (idList, &wKappaTmpWord) ? \
- (Insert_Elem((idList),nth,idElem,kPOSITIONMODE) ? idTrue : FALSE) \
- : ERROR)
-
- #define KappaInsertNthElem(idObjName,idSlotName,nth,idElem) \
- (ApplyFunction (AfromT(IDF_INSERTNTHELEM),4,idObjName,idSlotName,KappaMakeInt(nth),idElem) ? idTrue : FALSE)
-
- #define KappaIntegerQ(idAtom) \
- ApplyFunction(AfromT(IDF_INTEGERQUESTION),1,idAtom)
-
- #define KappaInterpretFile(idKALFileName) \
- ApplyFunction(AfromT(IDF_INTERPRETFILE),1,idKALFileName)
-
- #define KappaIsAKindOfQ(idObjName,idClassName) \
- ApplyFunction(AfromT(IDF_ISAKINDOFQUESTION),2,idObjName,idClassName)
-
- #define KappaIsThereAnyQ(idClass,lpFunction) \
- ApplyQueryFunction(AfromT(IDF_ISTHEREANYQUESTION),idClass,lpFunction)
-
- #define KappaKnownValueQ(idObjName,idSlotName) \
- ApplyFunction(AfromT(IDF_KNOWNVALUEQUESTION),2,idObjName,idSlotName)
-
- #define _KappaLengthList(idList) \
- (Check_List (idList, &wKappaTmpWord) ? \
- KappaMakeInt (wKappaTmpWord) : ERROR)
-
- #define KappaLengthList(idObjName,idSlotName) \
- ((idKappaTmpList = GetListValue (idObjName, idSlotName)) \
- ? _KappaLengthList(idKappaTmpList) : ERROR)
-
- #define KappaLineTo(iX,iY) \
- ApplyFunction(AfromT(IDF_LINETO),2,KappaMakeInt(iX),KappaMakeInt(iY))
-
- #define KappaLineToRel(iX,iY) \
- ApplyFunction(AfromT(IDF_LINETOREL),2,KappaMakeInt(iX),KappaMakeInt(iY))
-
- #define KappaLocalValueQ(idObjName,idSlotName) \
- ApplyFunction(AfromT(IDF_LOCALVALUEQUESTION),2,idObjName,idSlotName)
-
- #define KappaMakeClass(idClassName,idSuperClassName) \
- (MakeClass(idClassName,idSuperClassName) ? idClassName : NULLID)
-
- #define KappaMakeFunction(idFuncName,idArgList,idExp) \
- MakeFunction(idFuncName,idArgList,idExp)
- /* you may make the idExp through Build_Exp(LPSTR), or from KappaGetArgExp */
-
- #define KappaMakeGoal(idGoalName,idExp) \
- (MakeGoal(idGoalName,idExp) ? idGoalName : NULLID)
- /* you may make the idExp through Build_Exp(LPSTR), or from KappaGetArgExp */
-
- #define KappaMakeImage(idImageName,idImageClass) \
- ApplyFunction(AfromT(IDF_MAKEWIDGET),2,idImageName,idImageClass)
-
- /* FSC: This is a dangerous function. The user has to delete this
- list after being done with it. */
- #define KappaMakeList() Make_List(0)
-
- #define KappaMakeMethod(idObjName,idMethodName,idArgList,idExp) \
- MakeMethod(idObjName,idMethodName,idArgList,idExp)
- /* you may make the idExp through Build_Exp(LPSTR), or from KappaGetArgExp */
-
- #define KappaMakeInstance(idInstanceName,idClassName) \
- (MakeObject(idInstanceName,idClassName) ? idInstanceName : NULLID)
-
- #define KappaMakeRule(idRuleName,idMatchList,idClassList,idIfExp,idThenExp) \
- MakeRule(idRuleName,idMatchList,idClassList,idIfExp,idThenExp)
- /* you may make the idExp's through Build_Exp(LPSTR), or from KappaGetArgExp */
-
- #define KappaMakeSlot(idObjName,idSlotName) \
- (MakeSlot(idObjName,idSlotName) ? idSlotName : NULLID)
-
- #define KappaMapEscapeKey(idKeyCode) \
- ApplyFunction(AfromT(IDF_MAPESCAPEKEY),1,idKeyCode)
-
- #define _KappaMax(idList) \
- ApplyListFunction(AfromT(IDF_MAX),1,idList)
-
- #define KappaMax(idObjName,idSlotName) \
- _KappaMax(KappaGetListValue(idObjName,idSlotName))
-
- #define KappaMaximizeWindow(idKappaWindowCode) \
- ApplyFunction(AfromT(IDF_MAXIMIZEWINDOW),1,idKappaWindowCode)
-
- #define _KappaMemberQ(idList,idElem) \
- (Get_ElemPos(idList,idElem) ? idTrue : idFalse)
-
- #define KappaMemberQ(idObjName,idSlotName,idElem) \
- _KappaMemberQ(GetListValue(idObjName,idSlotName),idElem)
-
- #define KappaMethodQ(idObjName,idMethodName) \
- ((GetMethod(idObjName,idMethodName)==NULLID)?idFalse:idTrue)
-
- #define _KappaMin(idList) \
- ApplyListFunction(AfromT(IDF_MIN),1,idList)
-
- #define KappaMin(idObjName,idSlotName) \
- _KappaMin(KappaGetListValue(idObjName,idSlotName))
-
- #define KappaMoveHierarchy(idClassName,idNewParent) \
- ApplyFunction(AfromT(IDF_MOVEHIERARCHY),2,idClassName,idNewParent)
-
- #define KappaMoveInstance(idInstanceName,idClassName) \
- (ApplyFunction(AfromT(IDF_MOVEOBJECT),2,idInstanceName,idClassName) \
- ? idTrue : FALSE )
-
- #define KappaMoveTo(iX,iY) \
- ApplyFunction(AfromT(IDF_MOVETO),2,KappaMakeInt(iX),KappaMakeInt(iY))
-
- #define KappaMoveToRel(iX,iY) \
- ApplyFunction(AfromT(IDF_MOVETOREL),2,KappaMakeInt(iX),KappaMakeInt(iY))
-
- #define _KappaMultiply(idList) \
- ApplyListFunction(AfromT(IDF_MULTIPLY),1,idList)
-
- #define KappaMultiply(idObjName,idSlotName) \
- _KappaMultiply(KappaGetListValue(idObjName,idSlotName))
-
- #define KappaNullQ(idAtom) \
- ((idAtom==idNull)?idTrue:idFalse)
-
- #define KappaNumberQ(idAtom) \
- (KappaGetString(idAtom,kappa_c_buffer,RET_BUFFER_LEN),\
- (IsNumber(kappa_c_buffer) ? idTrue : idFalse))
-
- #define KappaInstanceQ(idInstanceName) \
- ((GETOBJECT(idInstanceName)==NULLID)?idFalse:idTrue)
-
- #define KappaPositionImage(idImageName,x,y,width,height) \
- ApplyFunction(AfromT(IDF_POSITIONWIDGET),5,idImageName, \
- KappaMakeInt(x),KappaMakeInt(y),KappaMakeInt(width),KappaMakeInt(height))
-
- #define KappaPositionWindow(idWindowCode,x,y,width,height) \
- ApplyFunction(AfromT(IDF_POSITIONWINDOW),5,idWindowCode, \
- KappaMakeInt(x),KappaMakeInt(y),KappaMakeInt(width),KappaMakeInt(height))
-
- #define KappaPostBusy(idToggle,idMessage) \
- ApplyFunction(AfromT(IDF_POSTBUSY),2,idToggle,idMessage)
-
- #define KappaPostError(idErrorMessage) \
- return RegisterKappaMessage(IDE_ERRORUSER,idErrorMessage,NULLID,NULLID)
-
-
- #define KappaPostMessage(idMessageText) \
- ApplyFunction(AfromT(IDF_POSTMESSAGE),1,idMessageText)
-
- #define KappaPrintHierarchy(idClass) \
- (PrintHierarchy(idClass) ? idTrue : FALSE)
-
- #define KappaPrintImage(idImageName) \
- ApplyFunction(AfromT(IDF_PRINTWIDGET),1,idImageName)
-
- #define KappaReadWord(file) \
- (GetWordFromFile(file,kappa_c_buffer,RET_BUFFER_LEN),Add_Atom(kappa_c_buffer))
-
- #define KappaRectangle(iX,iY) \
- ApplyFunction(AfromT(IDF_RECTANGLE),2,KappaMakeInt(iX),KappaMakeInt(iY))
-
- #define _KappaRemoveFromList(idList,idElem) \
- (Delete_Elem(idList,idElem,kDELETEMODE) ? idList : FALSE)
-
- #define KappaRemoveFromList(idObjName,idSlotName,idElem) \
- ApplyFunction (AfromT(IDF_REMOVEFROMLIST),3,idObjName,idSlotName,idElem)
-
- #define _KappaRemoveNthElem(idList,nth) \
- (Delete_Elem(idList,nth,kPOSITIONMODE) ? idList : FALSE)
-
- #define KappaRemoveNthElem(idObjName,idSlotName,nth) \
- ApplyFunction (AfromT(IDF_REMOVENTHELEM),3,idObjName,idSlotName,KappaMakeInt(nth))
-
- #define KappaRemoveWindowMenu(idKappaWindowCode) \
- ApplyFunction(AfromT(IDF_REMOVEWINDOWMENU),1,idKappaWindowCode)
-
- #define KappaRenameClass(idClassName,idNewName) \
- (RenameClass(idClassName,idNewName) ? idTrue : FALSE)
-
- #define KappaRenameFunction(idFuncName,idNewName) \
- (RenameFunction(idFuncName,idNewName) ? idTrue : FALSE)
-
- #define KappaRenameGoal(idGoalName,idNewName) \
- (RenameGoal(idGoalName,idNewName) ? idTrue : FALSE)
-
- #define KappaRenameMethod(idObjName,idMethodName,idNewName) \
- (RenameMethod(idObjName,idMethodName,idNewName) ? idTrue : FALSE)
-
- #define KappaRenameInstance(idInstanceName,idNewName) \
- (RenameObject(idInstanceName,idNewName) ? idTrue : FALSE)
-
- #define KappaRenameRule(idRuleName,idNewName) \
- (RenameRule(idRuleName,idNewName) ? idTrue : FALSE)
-
- #define KappaRenameSlot(idObjName,idSlotName,idNewName) \
- (RenameSlot(idObjName,idSlotName,idNewName) ? idTrue : FALSE)
-
- #define KappaResetClock() \
- ApplyFunction(AfromT(IDF_RESETCLOCK),0)
-
- #define KappaResetForwardChain() \
- (g_reset_forward_chain(LPNULL), RETURNVALUE)
-
- #define KappaResetImage(idImageName) \
- ApplyFunction(AfromT(IDF_RESETWIDGET),1,idImageName)
-
- #define KappaResetSlotOption(idObjName,idSlotName,idOptionCode) \
- (ApplyFunction(AfromT(IDF_RESETSLOTOPTION),3, \
- idObjName,idSlotName,idOptionCode) ? idTrue : FALSE)
-
- #define KappaResetValue(idObjName,idSlotName) \
- ApplyFunction(AfromT(IDF_RESETVALUE),2,idObjName,idSlotName)
-
- #define KappaResetWindowMenu(idKappaWindowCode) \
- ApplyFunction(AfromT(IDF_RESETWINDOWMENU),1,idKappaWindowCode)
-
- #define KappaRuleQ(idRuleName) \
- ((GetRule(idRuleName)==NULLID)?idFalse:idTrue)
-
- #define KappaSaveClipboardBitmap(idFileName) \
- (ApplyFunction(AfromT(IDF_SAVECLIPBOARDBITMAP),1,idFileName)?idTrue:FALSE)
-
- #define KappaSaveTranscriptImage(idTranscriptName,file) \
- Kpp_SaveTranscriptImage(idTranscriptName,file)
-
- #define KappaSelectList(idList,lpFunction) \
- ApplyQueryFunction(AfromT(IDF_SELECTLIST),idList,lpFunction)
-
- #define KappaSelectSubClass(idClass,lpFunction) \
- ApplyQueryFunction(AfromT(IDF_SELECTSUBCLASS),idClass,lpFunction)
-
- #define KappaSendMessage(idObjName,idMethod,idArgList) \
- ((EvalMethod(idObjName,idMethod,idArgList)==ERROR)?NULLID:RETURNVALUE)
-
- #define _KappaSetActiveRules(idList) \
- ApplyListFunction(AfromT(IDF_SETACTIVERULES),1,idList)
-
- #define KappaSetActiveRules(idObjName,idSlotName) \
- _KappaSetActiveRules(GetListValue(idObjName,idSlotName))
-
- #define KappaSetBrowserFocus(idClassName) \
- ApplyFunction(AfromT(IDF_SETFOCUS),1,idClassName)
-
- #define KappaSetClassComment(idClassName,idComment) \
- SetClassInfo(idClassName,idComment)
-
- #define KappaSetForwardChainMode(idRuleConflict,idAgendaConflict) \
- ApplyFunction(AfromT(IDF_SETFORWARDCHAINMODE),2, \
- idRuleConflict,idAgendaConflict)
-
- #define KappaSetFunctionComment(idFuncName,idComment) \
- SetFunctionInfo(idFuncName,idComment)
-
- #define KappaSetGoalComment(idGoalName,idComment) \
- SetGoalInfo(idGoalName,idComment)
-
- #define KappaSetImageLink(idImageName,idObjName,idSlotName) \
- ApplyFunction(AfromT(IDF_SETWIDGETLINK),3,idImageName,idObjName,idSlotName)
-
- #define KappaSetLineStyle(iThickness,iStyle) \
- ApplyFunction(AfromT(IDF_SETLINESTYLE),2,KappaMakeInt(iThickness),\
- KappaMakeInt(iStyle))
-
- #define KappaSetMethodComment(idObjName,idMethodName,idComment) \
- (SetMethodInfo(idObjName,idMethodName,idComment) ? idComment : FALSE)
-
- #define _KappaSetNthElem(idList,nth,idElem) \
- (!Delete_Elem(idList,nth,kPOSITIONMODE) ? FALSE : \
- (Insert_Elem(idList,nth,idElem,kPOSITIONMODE) ? idList : FALSE))
-
- #define KappaSetNthElem(idObjName,idSlotName,nth,idElem) \
- ApplyFunction(AfromT(IDF_SETNTHELEM),4,idObjName,idSlotName,KappaMakeInt(nth),idElem)
-
- #define KappaSetPostMenuPosition(iX,iY) \
- ApplyFunction(AfromT(IDF_SETPOSTMENUPOSITION),2, \
- KappaMakeInt(iX),KappaMakeInt(iY))
-
- #define KappaSetPostMessageTitle(idTitle) \
- (SetPostMessageTitle(idTitle) ? idTrue : FALSE)
-
- #define KappaSetInstanceComment(idInstanceName,idComment) \
- SetObjectInfo(idInstanceName,idComment)
-
- #define KappaSetRuleComment(idRuleName,idComment) \
- SetRuleInfo(idRuleName,idComment)
-
- #define KappaSetRulePriority(idRuleName,iPriority) \
- (SetRulePriority(idRuleName, iPriority) ? iPriority : FALSE)
-
- #define KappaSetSlotComment(idObjName,idSlotName,idComment) \
- (SetSlotInfo(idObjName,idSlotName,idComment) ? idComment : FALSE )
-
- #define KappaSetSlotOption(idObjName,idSlotName,idOptionCode,idValue) \
- ((idOptionCode == idMultiple || idOptionCode == idSingle) ? \
- ApplyFunction(AfromT(IDF_SETSLOTOPTION), \
- 3,idObjName,idSlotName,idOptionCode) : \
- ApplyFunction(AfromT(IDF_SETSLOTOPTION),4, \
- idObjName,idSlotName,idOptionCode,idValue))
-
- #define KappaSetValue(idObjName,idSlotName,idValue) \
- SetSlotValue(idObjName,idSlotName,idValue,EXPATOM)
-
- /* TK: This is a dangerous function. The user may have two references to
- this list. */
- #define KappaSetListValue(idObjName,idSlotName,idListValue) \
- SetSlotValue(idObjName,idSlotName,idListValue,EXPLIST)
-
- #define KappaSetWindowTitle(idKappaWindowCode,idTitle) \
- ApplyFunction(AfromT(IDF_SETWINDOWTITLE),2,idKappaWindowCode,idTitle)
-
- #define KappaShowBrowserInstances(idClassName) \
- ApplyFunction(AfromT(IDF_SHOWOBJECTS),1,idClassName)
-
- #define KappaShowBrowserSubClasses(idClassName) \
- ApplyFunction(AfromT(IDF_SHOWSUBCLASSES),1,idClassName)
-
- #define KappaShowImage(idImageName) \
- ApplyFunction(AfromT(IDF_SHOWWIDGET),1,idImageName)
-
- #define KappaShowWindow(idKappaWindowCode) \
- ApplyFunction(AfromT(IDF_SHOWWINDOW),1,idKappaWindowCode)
-
- #define KappaSlotQ(idObjName,idSlotName) \
- ((GetSlot(idObjName,idSlotName)==NULLID)?idFalse:idTrue)
-
- #define _KappaSum(idList) \
- ApplyListFunction(AfromT(IDF_SUM),1,idList)
-
- #define KappaSum(idObjName,idSlotName) \
- _KappaSum(KappaGetListValue(idObjName,idSlotName))
-
- #define KappaTestGoal(idGoalName) \
- (TestGoal(GetGoal(idGoalName)) ? idTrue : idFalse)
-
- #define KappaTime() \
- ApplyFunction(AfromT(IDF_TIME),0)
-
- #define KappaToClass(idInstanceName) \
- (MakeIntoClass(idInstanceName) ? idInstanceName : FALSE)
-
- #define KappaToInstance(idClassName) \
- (MakeIntoObject(idClassName) ? idClassName : FALSE)
-
- #define KappaUnfreezeWindow(idKappaWindowCode) \
- ApplyFunction(AfromT(IDF_UNFREEZEWINDOW),1,idKappaWindowCode)
-
- #define KappaUpdateImage(idImageName,idValue) \
- ApplyFunction(AfromT(IDF_UPDATEWIDGET),2,idImageName,idValue)
-
- #define KappaWait(seconds) \
- ApplyFunction(AfromT(IDF_WAIT),1,seconds)
-
- #define KappaWriteAllClasses(file) \
- (ferror(file)!=0 ? NULLID : \
- (WriteAllClasses(file,idRootClass),idTrue))
-
- #define KappaWriteAllFunctions(file) \
- (ferror(file)!=0 ? NULLID : \
- (WriteAllFunctions(file),idTrue))
-
- #define KappaWriteAllGoals(file) \
- (ferror(file)!=0 ? NULLID : \
- (WriteAllGoals(file),idTrue))
-
- #define KappaWriteAllInstances(file) \
- (ferror(file)!=0)?NULLID: \
- (WriteAllObjects(file),idTrue)
-
- #define KappaWriteAllRules(file) \
- (ferror(file)!=0 ? NULLID : \
- (WriteAllRules(file),idTrue))
-
- #define KappaWriteAll(file) \
- (ferror(file)!=0 ? NULLID : \
- (WriteAllFunctions(file),WriteAllClasses(file,idRootClass), \
- WriteAllObjects(file),WriteAllRules(file), \
- WriteAllGoals(file),idTrue))
-
- #define KappaWriteAllKnowledge(file) \
- KappaWriteAll(file)
-
- #define KappaWriteClass(file,idClassName) \
- (ferror(file)!=0 ? NULLID : \
- (WriteClass(idClassName,file),idTrue))
-
- #define KappaWriteFunction(file,idFuncName) \
- (ferror(file)!=0 ? NULLID : \
- (WriteFunction(idFuncName,file),idTrue))
-
- #define KappaWriteGoal(file,idGoalName) \
- (ferror(file)!=0 ? NULLID : \
- (WriteGoal(idGoalName,file),idTrue))
-
- #define KappaWriteHierarchy(file,idClassName) \
- (ferror(file)!=0 ? NULLID : \
- (WriteTreeOnFile(idClassName,file),idTrue))
-
- #define KappaWriteInstance(file,idInstanceName) \
- (ferror(file)!=0 ? NULLID: \
- (WriteObject(idInstanceName,file),idTrue))
-
- #define KappaWriteRule(file,idRuleName) \
- (ferror(file)!=0 ? NULLID : \
- (WriteRule(idRuleName,file),idTrue))
-
- #define KappaGetVersion() GetKAPPAVersionID ()
-
- /**************************************************************
- ** GLOBAL VARIABLES
-
- ** some windows related variables
- ***************************************************************/
- extern HANDLE hInstKappa; /* Instance of Kappa window */
- extern HWND hWndKappa, /* Kappa Window */
- hWndKAL, /* KAL Window -- [mlm] 2/15/90 */
- hWndInterpret, /* Interpreter Text Window */
- hWndTrace, /* Trace Debugger Window */
- hWndTraceText, /* Trace Debugger Text */
- hWndKTools, /* Knowledge Tools Popup Window */
- hWndBrowser, /* Graphics Browser Window */
- hWndInference, /* Graphics Rule Browser Window */
- hWndSession, /* Inference Session Window */
- hWndComment ; /* Comment Window -- [mlm] 2/15/90 */
- extern HWND hWndRuleRel ;
- extern HMENU hMenuKappa; /* handle to Kappa menu bar */
- extern HBRUSH hbrWhite, hbrBlack, /* handle to white and black brushes */
- hbrColor; /* handle to system color brush */
- extern HCURSOR arrowCursor, /* Arrow Cursor Handle */
- handCursor, /* Hand Cursor Handle */
- ibeamCursor, /* Ibeam Cursor Handle */
- hHourGlass; /* Busy cursor */
- extern HANDLE hAccelTable; /* handle to accelerator table */
- extern HICON kappaIcon, objectIcon, ruleIcon, funcIcon, classIcon,
- goalIcon, slotIcon, toolsIcon, browserIcon, helpIcon,
- interpIcon, sessionIcon, thumbIcon, methodIcon, inferenceIcon,
- kalIcon, /* [mlm] 2/15/90 */
- rulerelIcon ;
- extern char szAppName[], szTitle[], szKTools[], szUntitled[],
- szInterpret[], szTrace[], szDebugger[], szBrowser[],
- szInference[], szSession[], sztools[], szError[],
- szRootWidget[], szRuleRel [] ;
- extern char szClassIcon[], szObjectIcon[], szSlotIcon[], szFuncIcon[],
- szRuleIcon[], szGoalIcon[], szToolsIcon[], szBrowserIcon[],
- szInferenceIcon[], szHelpIcon[], szInterpIcon[],
- szSessionIcon[], szThumbIcon[], szMethodIcon[],
- szKALIcon [], szRuleRelIcon [] ; /* [mlm] 2/15/90 */
-
- /**************************************************************
- ** for interpreter's text
- ***************************************************************/
- extern char return_buffer[];
- extern SHORT par_count;
-
- /**************************************************************
- ** switches for selected knowledge item, or interface mode
- ***************************************************************/
- extern ITEM_FLAGS SelectedItemType;
- extern BOOL bEchoMode, bBrowserMode, bInferenceMode, bKToolsMode, bSessionMode;
- extern BOOL bDebugMode, bTraceMode, bSilentMode;
- extern BOOL bInterpMode ; /* [mlm] 2/15/90 */
- extern BOOL bRuleRelMode ; /* [mlm] 3/1/90 */
-
- extern BOOL bCommentShown ;
-
- /**************************************************************
- ** Inference Engine Modes and Information
- ***************************************************************/
- extern SHORT max_pass;
- extern char source_type;
- extern char source_name[];
-
- /*********************************************************************
- ** Remembers whether application has changed
- **********************************************************************/
- extern BOOL bAppChanged;
-
- /*********************************************************************
- ** ID of root Class, and Object containing global variables
- **********************************************************************/
- extern ITEMID idRootClass;
- extern ITEMID idGlobalVars;
-
- /*********************************************************************
- ** ID's of atoms used often in the system, defined here globally
- **********************************************************************/
- extern ITEMID idSelf, idTheParent, idTheSlot, idOpenBracket, idVerticalBar,
- idCloseBracket, idOk, idTrue, idFalse, idError, idNull,
- idPrompt, idCardinality, idSingle, idMultiple, idStart,
- idRootWidgetName, idBChange, idAChange, idEcho, idPossValue,
- idIfNeeded, idValueType, idMinValue, idMaxValue,
- idObjStr, idStrStr, idBoolStr, idNumberStr, idPossClass,
- idDot, idDotDot, idSpace, idWidgets, idEndOfFile,
- idPlus, idMinus, idTimes, idDivide, idPower, idAlmost,
- idSetEqual, idEqual, idNotEqual, idLessEqual, idGreaterEqual,
- idGreater, idLess, idPound, idAtSign, idBackSlash,
- idExclamation, idQuestionMark, idComma, idColon,
- idSemiColon, idOpenCurly, idCloseCurly, idPercent,
- idKnownValue, idAssert, idKappa, idSession, idTrace,
- idKAL, idRuleRel, /* [mlm] 2/15/90 */
- idKTools, idBrowser, idInference, idDbaseIII, idDbaseIV,
- idMakeObject, idMakeClass, idDeleteObject, idDeleteClass,
- idShowClassMenu, idShowObjectMenu, idWriteObject,
- idWriteClass, idCancel, idSetBrowserDisplayText,
- idSetBrowserNodeHeight, idNameKey, idDbData, idOn, idOff,
- idSendMessage, idSetValue, idGetValue, idDDEFunc,idRootDBName,
- idSelective, idBreadthFirst, idDepthFirst, idBestFirst,
- idIgnore, idNoIgnore, idMinusEqual, idPlusEqual, idAnd,
- idOr, idXor, idAlmostEqual, idSameEqual, idAppend,
- idOpenParent, idCloseParent, idFor, idForAll, idDo, idLet,
- idIf, idWhile, idInfix, idThen, idElse, idRight, idLeft,
- idCenter, idMeterWN, idButtonWN, idTranscriptWN, idEditWN,
- idDrawWN, idBitmapWN, idStaticWN, idSliderWN, idStateWN,
- idLinePlotWN, idShowWidgetOptions, idMakeFunction,
- idMakeRule, idMakeMethod, idEscapeFunc;
-
- /*********************************************************************
- ** ID and type of value returned by KAPPA function calls
- **********************************************************************/
- extern DWORD KappaReturnSet;
-
- /*********************************************************************
- ** Screen size in pixels initialized to the Display terminal
- **********************************************************************/
- extern short sXPixels, sYPixels;
- extern short IconXPixels, IconYPixels ; /* [mlm] 1/22/90 */
-
- /*********************************************************************
- ** Font for text display in dialog windows
- **********************************************************************/
- extern HFONT hDlgTextFont;
- extern HFONT hDlgTitleFont;
-
- /*********************************************************************
- ** List of active rules for forward chaining
- **********************************************************************/
- extern LISTID idActiveRules;
-
- /*********************************************************************
- ** List of editor windows and menu ids in WINDOWS menu
- **********************************************************************/
- extern LISTID idWindowsList;
- extern LISTID idMenuIdsList;
-
- extern LISTID idObjectEditors;
- extern LISTID idClassEditors;
- extern LISTID idFuncEditors;
- extern LISTID idRuleEditors;
- extern LISTID idGoalEditors;
-
- /**********************************************************************
- ** Version information
- **********************************************************************/
- #define VERSION_LEN 9 /* if modified, modify extern.h */
- #define CUSTOMER_LEN 30 /* if modified, modify extern.h */
- #define SERIALID_LEN 8 /* if modified, modify extern.h */
- extern char szVersion [];
- extern char szCustomer [];
- extern char szSerialID [];
-
- /**********************************************************************
- ** Extended Memory Flag
- **********************************************************************/
- extern WORD wExtended;
-
- /**********************************************************************
- ** Number of Items, always updated on the KTOOLS window
- **********************************************************************/
- extern WORD wNumObjects, wNumClasses, wNumFunctions;
- extern WORD wNumRules, wNumGoals;
-
- /* ADDED BY TONY FOR NEW SYNTAX */
- extern WORD wInputLineNumber;
-
- extern HWND hDlgAbout ;
-
- /********************************************
- ** Window positioning
- *********************************************/
- extern BOOL nFirstKAL, nFirstSession, nFirstRuleRel, nFirstInference,
- nFirstTrace;
-