-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlmem.h
executable file
·165 lines (138 loc) · 3.7 KB
/
lmem.h
1
#ifndef __LMEM_H_#define __LMEM_H_#include <types.h>/* defs from assembler file astoks.h * The symbol table field n_other bits 7-3 indicate the * method used to declare a variable to the assembler. * In the case of .fill bits 2-0 are the length of the data type. * The symbol table field n_desc is used to pass the size in bytes * consumed by the declaration. *//*if these change alter assembler astoks.h also*//*copied from as:astoks.h *from here */# define IBYTE 1# define IWORD 2# define IINT 3# define ILONG 4# define IQUAD 5# define IOCTA 6# define IFFLOAT 7# define IDFLOAT 8# define IGFLOAT 9# define IHFLOAT 10# define IENTER 11# define IASCII 12# define IASCIZ 13# define ISPACE 14# define IFILL 15# define IALIGN 16# define IORG 17# define BLKB 18# define BLKW 19# define BLKL 20 /*down to here*/#ifdef __LMEM_C_short type_sizes[] = /*beware order matches that of astok.h*/{/* NoType */ 1, /*assume it is 1 byte long*//* IBYTE */ 1,/* IWORD */ 2,/* IINT */ 4,/* ILONG */ 4,/* IQUAD */ 8,/* IOCTA */ 16,/* IFFLOAT */ 4,/* IDFLOAT */ 8,/* IGFLOAT */ 8,/* IHFLOAT */ 16,/* IENTER */ 2,/* IASCII */ 1,/* IASCIZ */ 1,/* ISPACE */ 1,/* IFILL */ 0,/* IALIGN */ 1,/* IORG */ 1,/* BLKB 18 */ 1,/* BLKW 19 */ 2,/* BLKL 20 */ 4 };#elseextern short type_sizes[] ;#endif#define LENGTH(x) ( (unsigned long)(x)->n_desc )#define TYPE(x) ( (((x)->n_other) >> 3) & 0x1f )#define SIZEOFTYPE(x) ( TYPE(x) == IFILL ? ((x)->n_other & 0x7)+1:type_sizes[TYPE(x)] )#define NUM_ITEMS(x) ( LENGTH(x)/ SIZEOFTYPE(x) )#define NUM_LINES(x) ( (TYPE(x) == IASCII || TYPE(x) == IASCIZ || NUM_ITEMS(x) == 0 ) ? 1:NUM_ITEMS(x) )#define NUM_ITEMS_PL(x) ( NUM_ITEMS(x)/NUM_LINES(x) ) /*causes internal error in cc mpw 3.0*/#define MLENGTH 17#define DTYPES 5struct burgle{ char *format; char fetchx; short nfetches;};#ifdef __LMEM_C_#define B 1#define BE 6#define C_ 2#define W 3#define WE 7#define L 4#define F 5#define COLUMN2 36#define COLUMN1 24struct burgle d_format[DTYPES][MLENGTH] ={/*decimal*/ { {"",0,0}, {"%+d",BE,1}, {"%+d",WE,1}, {"",0,0}, {"%+d",L,1} , {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}},/*unsigned*/ { {"",0,0}, {"%3.3u",B,1}, {"%5.5u",W,1}, {"",0,0}, {"%10.10u",L,1} , {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}},/*hex*/ { {"",0,0}, {"%2.2x",B,1}, {"%4.4x",W,1}, {"%2.2x",B,-3}, {"%8.8x",L,1}, {"%2.2x",B,-5}, {"%2.2x",B,-6}, {"%2.2x",B,-7}, {"%2.2x",B,-8}, {"%2.2x",B,-9}, {"%2.2x",B,-10},{"%2.2x",B,-11},{"%2.2x",B,-12}, {"%2.2x",B,-13},{"%2.2x",B,-14},{"%2.2x",B,-15},{"%2.2x",B,-16}},/*char*/ { {"",0,0}, {"%c",C_,1}, {"%c",C_,2}, {"%c",C_,3}, {"%c",C_,4}, {"%c",C_,5}, {"%c",C_,6}, {"%c",C_,7}, {"%c",C_,8}, {"%c",C_,9}, {"%c",C_,10}, {"%c",C_,11}, {"%c",C_,12}, {"%c",C_,13}, {"%c",C_,14}, {"%c",C_,15}, {"%c",C_,16}},/*float*/ { {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"%s",F,1}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}} };static long lmem_item = -1;static long lmem_system;#else __LMEM_C_extern struct burgle d_format[DTYPES][MLENGTH];#endif __LMEM_C_/*Functions*/void lmemw_click( Point *p, short modifiers);void lmemw_keypress(long);void lmemw_undo_keypress(void);void mem_display_mode( long mode);void update_lmem_window(void);void dumpsyms(void);void activate_lmem_window( long is_active);void lmem_nlines( void);#endif __LMEM_H_