home *** CD-ROM | disk | FTP | other *** search
- /* @(#) $Revision: 1.0 */
-
- /*
- * Definitions for .wks types of records, as structures
- * All elements are type char, even when numeric...
- * That's because they must be byte-aligned (and, by the
- * way, byte-swapped) in the .wks file.
- */
-
- typedef struct {
- char opcode[2]; /* 02h (02d) */
- char record_length[2]; /* 2d */
- char ff_version[2]; /* file format version (0404h,1028d) */
- } BOF;
-
- typedef struct {
- char opcode[2]; /* 06h (06d) */
- char record_length[2]; /* 8d */
- char start_column[2];
- char start_row[2];
- char end_column[2];
- char end_row[2];
- } RANGE;
-
- typedef struct {
- char opcode[2]; /* 96h (150d) */
- char record_length[2]; /* variable */
- char column_number[2];
- char lowest_row[2]; /* lowest row number of active cell */
- char highest_row[2]; /* highest row number of active cell */
- } CPI;
-
- typedef struct {
- char opcode[2]; /* 2Fh (47d) */
- char record_length[2]; /* 1d */
- char iteration_count[1];
- } CALCCOUNT;
-
- typedef struct {
- char opcode[2]; /* 02h (02d) */
- char record_length[2]; /* 1d */
- char recalculation[1]; /* 00h is manual, FFh is automatic */
- } CALCMODE;
-
- typedef struct {
- char opcode[2]; /* 03h (03d) */
- char record_length[2]; /* 1d */
- char calc_order[1]; /* 00h is natural recalc order */
- /* 01h is recalculation by column */
- /* FFh is recalculation by row */
- } CALCORDER;
-
- typedef struct {
- char opcode[2]; /* 04h (04d) */
- char record_length[2]; /* 1d */
- char window_split[1]; /* 00h is not split */
- /* 01h is vertical split */
- /* FFh is horizontal split */
- } SPLIT;
-
- typedef struct {
- char opcode[2]; /* 05h (05d) */
- char record_length[2]; /* 1d */
- char window_sync[1]; /* 00h is not synchronized */
- /* FFh is window synchronized */
- } SYNC;
-
- typedef struct {
- char opcode[2]; /* 07h (07d) */
- char record_length[2]; /* 32d */
- char cc_column[2]; /* current cursor column */
- char cc_row[2]; /* current cursor row */
- char cell_format[1];
- char unused1[1]; /* must be 00h ? */
- char column_width[2];
- char ncol_on_screen[2]; /* number of columns on screen */
- char nrow_on_screen[2]; /* number of rows on screen */
- char leftmost_column[2];
- char top_row[2];
- char ntitle_col[2]; /* number of title columns */
- char ntitle_row[2]; /* number of title rows */
- char ltitle_col[2]; /* left title column */
- char ttitle_row[2]; /* top title row */
- char borderwd_col[2]; /* border width column */
- char borderwd_row[2]; /* border width row */
- char window_width[2];
- char unused2[1]; /* must be 00h */
- char unused3[1]; /* this spot was undocumented */
- } WINDOW1;
-
- typedef struct {
- char opcode[2]; /* 08h (08d) */
- char record_length[2]; /* 3d */
- char column_number[2];
- char column_width[1];
- } COLW1;
-
- typedef struct {
- char opcode[2]; /* 31h (49d) */
- char record_length[2]; /* 1d */
- char cursor_window[1]; /* 01h is cursor in window 1 */
- /* 02h is cursor in window 2 */
- } CURSORW12;
-
- typedef struct {
- char opcode[2]; /* 0Bh (11d) */
- char record_length[2]; /* 24d */
- char range_name[16];
- char start_column[2];
- char start_row[2];
- char end_column[2];
- char end_row[2];
- } RNAME;
-
- typedef struct {
- char y_start_col[2]; /* y-range start column */
- char y_start_row[2]; /* y-range start row */
- char y_end_col[2]; /* y-range end column */
- char y_end_row[2]; /* y-range end row */
- } grange;
-
- typedef struct {
- char opcode[2]; /* 2Eh (45d) */
- char record_length[2]; /* 453d */
- char graph_name[16]; /* null-terminated */
- char x_start_col[2]; /* x-range start column */
- char x_start_row[2]; /* x-range start row */
- char x_end_col[2]; /* x-range end column */
- char x_end_row[2]; /* x-range end row */
- grange yd_range[6]; /* y-range structures (data) */
- grange yl_range[6]; /* y-range structures (labels) */
- char graph_type[1]; /* 0=XY, 1=bar, 2=pie, 3=unused, */
- /* 4=line, 5=stacked bar */
- char grid[1]; /* 0=none, 1=horizontal, 2=vertical */
- /* 3=both */
- char color[1]; /* 0=b&w, FFh=color */
- char y_lformat[6]; /* y-range line formats */
- /* 0=none, 1=line, 2=symbol, */
- /* 3=line-symbol */
- char y_dlalign[6]; /* y-range data label alignment */
- /* 0=center, 1=right, 2=below, */
- /* 3=left, 4=above */
- char x_scale[1]; /* 0=auto, 1=manual */
- char x_low_limit[8]; /* x-range lower limit (real) */
- char x_up_limit[8]; /* x-range upper limit (real) */
- char y_scale[1]; /* 0=auto, 1=manual */
- char y_low_limit[8]; /* y-range lower limit (real) */
- char y_up_limit[8]; /* y-range upper limit (real) */
- char first_title[40]; /* top of the graph */
- char second_title[40]; /* just below the first */
- char x_title[40]; /* bottom of the graph */
- char y_title[40]; /* side of the graph */
- char y_legend[6][20];
- char x_format[1];
- char y_format[1];
- char skip_factor[2];
- char unknown[2];
- } NGRAPH;
-
- typedef struct {
- char opcode[2]; /* 18h (24d) */
- char record_length[2]; /* 25d */
- char table_ind[1]; /* 00h is no table */
- /* 01h is table 1 */
- /* 02h is table 2 */
- char table_start_column[2];
- char table_start_row[2];
- char table_end_column[2];
- char table_end_row[2];
- char cell1_start_column[2];
- char cell1_start_row[2];
- char cell1_end_column[2];
- char cell1_end_row[2];
- char cell2_start_column[2];
- char cell2_start_row[2];
- char cell2_end_column[2];
- char cell2_end_row[2];
- } TABLE;
-
- typedef struct {
- char opcode[2]; /* 19h (25d) */
- char record_length[2]; /* 25d */
- char input_start_column[2];
- char input_start_row[2];
- char input_end_column[2];
- char input_end_row[2];
- char output_start_column[2];
- char output_start_row[2];
- char output_end_column[2];
- char output_end_row[2];
- char criteria_start_column[2];
- char criteria_start_row[2];
- char criteria_end_column[2];
- char criteria_end_row[2];
- char command[1]; /* 00h is no command */
- /* 01h is find */
- /* 02h is extract */
- /* 03h is delete */
- /* 04h is unique */
- } QRANGE; /* query range */
-
- typedef struct {
- char opcode[2]; /* 1Ah (26d) */
- char record_length[2]; /* 8d */
- char start_column[2];
- char start_row[2];
- char end_column[2];
- char end_row[2];
- } PRANGE; /* print range */
-
- typedef struct {
- char opcode[2]; /* h (d) */
- char record_length[2]; /* d */
- } FORMAT;
-
- typedef struct {
- char opcode[2]; /* 1Ch (28d) */
- char record_length[2]; /* 8d */
- char start_column[2];
- char start_row[2];
- char end_column[2];
- char end_row[2];
- } FRANGE; /* fill range */
-
- typedef struct {
- char opcode[2]; /* 1Bh (27d) */
- char record_length[2]; /* 8d */
- char start_column[2];
- char start_row[2];
- char end_column[2];
- char end_row[2];
- } SRANGE; /* sort range */
-
- typedef struct {
- char opcode[2]; /* 1Dh (29d) */
- char record_length[2]; /* 9d */
- char start_column[2];
- char start_row[2];
- char end_column[2];
- char end_row[2];
- char sort_order[1]; /* 00h is descending, FFh ascending */
- } KRANGE; /* primary sort key range */
-
- typedef struct {
- char opcode[2]; /* 23h (35d) */
- char record_length[2]; /* 9d */
- char start_column[2];
- char start_row[2];
- char end_column[2];
- char end_row[2];
- char sort_order[1]; /* 00h is descending, FFh ascending */
- } KRANGE2; /* secondary sort key range */
-
-
- typedef struct {
- char opcode[2]; /* 67h (103d) */
- char record_length[2]; /* 25d */
- char depvar_start_column[2];
- char depvar_start_row[2];
- char depvar_end_column[2];
- char depvar_end_row[2];
- char indvar_start_column[2];
- char indvar_start_row[2];
- char invdar_end_column[2];
- char indvar_end_row[2];
- char output_start_column[2];
- char output_start_row[2];
- char output_end_column[2];
- char output_end_row[2];
- char zero_intercept[1]; /* 00h is not forced */
- /* -1 is forced intercept at origin */
- } RRANGES; /* linear regression ranges */
-
- typedef struct {
- char opcode[2]; /* 20h (32d) */
- char record_length[2]; /* 16d */
- char values_start_column[2];
- char values_start_row[2];
- char values_end_column[2];
- char values_end_row[2];
- char bin_start_column[2];
- char bin_start_row[2];
- char bin_end_column[2];
- char bin_end_row[2];
- } HRANGE; /* distribution range */
-
- typedef struct {
- char opcode[2]; /* 24h (36d) */
- char record_length[2]; /* 1d */
- char protection[1]; /* 00h is global off, 01h is on */
- } PROTECT; /* global protection */
-
- typedef struct {
- char opcode[2]; /* 25h (37d) */
- char record_length[2]; /* 242d */
- char footer_string[242]; /* NULL terminated ASCII */
- } FOOTER; /* print footer */
-
- typedef struct {
- char opcode[2]; /* 26h (38d) */
- char record_length[2]; /* 242d */
- char header_string[242]; /* NULL terminated ASCII */
- } HEADER; /* print header */
-
- typedef struct {
- char opcode[2]; /* 27h (39d) */
- char record_length[2]; /* 40d */
- char setup_string[40]; /* NULL terminated ASCII */
- } SETUP; /* print setup string */
-
- typedef struct {
- char opcode[2]; /* 28h (40d) */
- char record_length[2]; /* 10d */
- char left_margin[2];
- char right_margin[2];
- char page_length[2];
- char top_margin[2];
- char bottom_margin[2];
- } MARGINS;
-
- typedef struct {
- char opcode[2]; /* 29h (41d) */
- char record_length[2]; /* 1d */
- char label_alignment[1]; /* 27h is left */
- /* 22h is right */
- /* 5Eh is center */
- } LABELFMT;
-
- typedef struct {
- char opcode[2]; /* 2Ah (42d) */
- char record_length[2]; /* 16d */
- char border_start_column[2];
- char border_start_row[2];
- char border_end_column[2];
- char border_end_row[2];
- char col_start_column[2];
- char col_start_row[2];
- char col_end_column[2];
- char col_end_row[2];
- } TITLES; /* print borders */
-
- /***********************************************/
- /* Cell definitions */
- /***********************************************/
-
- typedef struct {
- char opcode[2]; /* 0Ch (12d) */
- char record_length[2]; /* 5d */
- char format[1];
- char column[2];
- char row[2];
- } BLANK; /* blank cell */
-
- typedef struct {
- char opcode[2]; /* 0Dh (13d) */
- char record_length[2]; /* 7d */
- char format[1];
- char column[2];
- char row[2];
- char value[2];
- } INTEGER;
-
- typedef struct {
- char opcode[2]; /* 0Eh (14d) */
- char record_length[2]; /* 13d */
- char format[1];
- char column[2];
- char row[2];
- char value[8];
- } NUMBER;
-
- typedef struct {
- char opcode[2]; /* 0Fh (15d) */
- char record_length[2]; /* variable */
- char format[1];
- char column[2];
- char row[2];
- char position[1];
- char string[239]; /* NULL terminated ASCII */
- } LABEL;
-
- typedef struct {
- char opcode[2]; /* 10h (16d) */
- char record_length[2]; /* variable to 2064 */
- char format[1];
- char column[2];
- char row[2];
- char value[8];
- char formula_size[2];
- char formula_code[256]; /* NOTE: Lotus allows up to 2048! */
- } FORMULA;
-
-
- typedef struct {
- char opcode[2]; /* 01h (01d) */
- char record_length[2]; /* 0d */
- } LEOF; /* changed name to avoid using standard EOF */
-
- /**************************************/
- /* opcode value definitions */
- /**************************************/
-
- #define BOF_op ((unsigned short)0x00)
- #define BOF_len ((unsigned short)2)
-
- #define LEOF_op ((unsigned short)0x01)
- #define LEOF_len ((unsigned short)0)
-
- #define CALCMODE_op ((unsigned short)0x02)
- #define CALCMODE_len ((unsigned short)1)
-
- #define CALCORDER_op ((unsigned short)0x03)
- #define CALCORDER_len ((unsigned short)1)
-
- #define SPLIT_op ((unsigned short)0x04)
- #define SPLIT_len ((unsigned short)1)
-
- #define SYNC_op ((unsigned short)0x05)
- #define SYNC_len ((unsigned short)1)
-
- #define RANGE_op ((unsigned short)0x06)
- #define RANGE_len ((unsigned short)8)
-
- #define WINDOW1_op ((unsigned short)0x07)
- #define WINDOW1_len ((unsigned short)32)
-
- #define COLW1_op ((unsigned short)0x08)
- #define COLW1_len ((unsigned short)3)
-
- #define NGRAPH_op ((unsigned short)0x2E)
- #define NGRAPH_len ((unsigned short)455)
-
- #define RNAME_op ((unsigned short)0x0B)
- #define RNAME_len ((unsigned short)24)
-
- #define BLANK_op ((unsigned short)0x0C)
- #define BLANK_len ((unsigned short)5)
-
- #define INTEGER_op ((unsigned short)0x0D)
- #define INTEGER_len ((unsigned short)7)
-
- #define NUMBER_op ((unsigned short)0x0E)
- #define NUMBER_len ((unsigned short)13)
-
- #define LABEL_op ((unsigned short)0x0F)
- /* #define LABEL_len ((unsigned short)) variable */
-
- #define FORMULA_op ((unsigned short)0x10)
- /* #define FORMULA_len ((unsigned short)) variable */
-
- #define TABLE_op ((unsigned short)0x18)
- #define TABLE_len ((unsigned short)25)
-
- #define QRANGE_op ((unsigned short)0x19)
- #define QRANGE_len ((unsigned short)25)
-
- #define PRANGE_op ((unsigned short)0x1A)
- #define PRANGE_len ((unsigned short)8)
-
- #define SRANGE_op ((unsigned short)0x1B)
- #define SRANGE_len ((unsigned short)8)
-
- #define FRANGE_op ((unsigned short)0x1C)
- #define FRANGE_len ((unsigned short)8)
-
- #define KRANGE_op ((unsigned short)0x1D)
- #define KRANGE_len ((unsigned short)9)
-
- #define HRANGE_op ((unsigned short)0x20)
- #define HRANGE_len ((unsigned short)16)
-
- #define PROTECT_op ((unsigned short)0x24)
- #define PROTECT_len ((unsigned short)1)
-
- #define FOOTER_op ((unsigned short)0x25)
- #define FOOTER_len ((unsigned short)242)
-
- #define HEADER_op ((unsigned short)0x26)
- #define HEADER_len ((unsigned short)242)
-
- #define SETUP_op ((unsigned short)0x27)
- #define SETUP_len ((unsigned short)40)
-
- #define MARGINS_op ((unsigned short)0x28)
- #define MARGINS_len ((unsigned short)10)
-
- #define LABELFMT_op ((unsigned short)0x29)
- #define LABELFMT_len ((unsigned short)1)
-
- #define TITLES_op ((unsigned short)0x2A)
- #define TITLES_len ((unsigned short)16)
-
- #define CALCCOUNT_op ((unsigned short)0x2F)
- #define CALCCOUNT_len ((unsigned short)1)
-
- #define UNFORMATTED_op ((unsigned short)0x30)
- #define UNFORMATTED_len ((unsigned short)1)
-
- #define CURSORW12_op ((unsigned short)0x31)
- #define CURSORW12_len ((unsigned short)1)
-