Scalar strings have no device, or owner, anonymous with no line of symmetry. They are not default, that is the purpose of the system, adapt to one and two lines of symmetry on strings. Noe the two top fields, the return status values, and the entry definition. It is the top values, return status, the one common header definition I could not eliminate. I wanted to do the zero return is normal, leave the other status flags to users. Couldn't do it. But that top line is the only requirement in this header, the others area, well known (entrytype, keyvalue) or purely optional commons.
We have a default of what I call single line of symmetry because the default is to assume a scrolling console windows and single line command window, with echo. Flush can be null, but command line is always at least available. That is why IO manager has to move a cursor in x and have a command line history in y; no way to avoid the default.
enum { NOTFOUND=0,CONTINUE,EXIT,QUIT,SUCCESS,ERROR};
typedef int EntryType(int*,void**);
typedef union {
unsigned long l;
char txt[8];
char * s;
}Key;
typedef struct {
Key cmd;
Key key;
long val;
} KeyValue;
typedef struct {
Key cmd;
char *ptr;
} Scalar;
typedef struct {
Key cmd;
Key dev;
char * ptr;
long x;
} XString;
typedef struct {
Key cmd;
Key dev;
char * ptr;
long x;
long y;
} XYString;
typedef struct {
Key cmd;
Key dev;
long dx;
long dy;
} XYCursor;
#define pk(a) *((unsigned long *) #a)
#define pkstr(a) *((long *) a)
#define prtchrs(ptr) i=0; while(ptr[i] && (i < 8)) putchar(ptr[i++])
No comments:
Post a Comment