Sindbad~EG File Manager
/* module "model" consists of files
model
editmod
savemod
adjmod
*/
/*
10.27.92 changed bit fields to unsigned int
4.23.96 last modified
*/
typedef int (*actualop)(term,term,term *, char *);
typedef struct { unsigned men:8;
unsigned choice:8;
} operation; /* operator is a C++ keyword */
#define HASHPRIME 3793
/* This is the dimension of the 'model' array, and the range of values of the
hash function. It should be a prime between 1K and 2K, larger to decrease the
load factor, smaller to save space, and not close to a power of 2. It
should be at least 1.5 times the total number of operations, to minimize
the number of collisions while hashing. Increased from 2309 on 1.16.00,
as saving 1K of memory no longer matters at all.
*/
typedef struct b { unsigned int status:2 ; /* UNKNOWN, LEARNING, KNOWN, WELLKNOWN */
unsigned int choice:4; /* choice-1 in optable entry for this op */
unsigned int used:1; /* needed in open addressing algorithm */
unsigned int inhibited:1; /* nonzero to 'inhibit' an operator */
unsigned int men:8; /* menu in optable entry for this op */
} hashbucket;
/* an object of type 'hashbucket' uses 2 bytes only,
since no link field is needed for 'open addressing' */
/* if .men is -1, that is 255, it means this op is not on the menus,
but is an automode_only op. */
short access_mod(actualop);
int status(actualop op);
void set_status(actualop, int);
#define UNKNOWN 0 /* four values for the user model */
#define LEARNING 1
#define KNOWN 2
#define WELLKNOWN 3
void init_model(int, hashbucket *);
void inhibit(actualop);
void release(actualop);
void temp_inhibit(actualop);
void temp_release(actualop);
void undo_inhibitions(void);
void kill_inhibitions(void);
int inhibited(actualop);
void set_model_arithflag(int);
#define VIEW_ONLY -2
#define EDIT -3
/* -1 must be avoided as it is the initial value of problemtype */
void set_model(hashbucket *);
void adjust_model(int); /* adjmod.c */
typedef struct inh { short index; /* offset in hashtable of inhibited operator */
short linenumber; /* line at which this was pushed,
for use of undo */
short kind; /* 1 = inhibition, -1 = release */
struct inh *link;
} inhibition;
void set_inhibitions(inhibition *);
inhibition *get_inhibitions(void);
void code_to_op(actualop, operation *);
void SetStopFlag(int n);
int GetStopFlag(void);
/* 1 to turn off the inhibit/release mechanism, 0 to turn it on again */
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists