/* @(#)tblsys-recursive.h 14.1.1.1 (ESO-IPG) 09/16/99 10:01:50 */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .LANGUAGE C .IDENTIFICATION tblsys.h .AUTHOR J.D.Ponz, F. Ochsenbein [ESO-IPG] .KEYWORDS Table control definitions .ENVIRONMENT Independent .VERSION 1.0 01-Jun-1990: .VERSION 1.1 28-Oct-1990: Added NULL for floating-point (~0) .VERSION 1.2 18-Dec-1990: Added number of selected rows in TBL_FCT structure .VERSION 1.3 24-Feb-1991: Use standard lowercase for variables, uppercase for constants. .COMMENTS This file should not be included in applications programs; it is required for compilation of TBL / TC routines only. ------------------------------------------------------------------------*/ #ifndef TBL_VERSION #define TBL_VERSION 1 /* Version with Arrays =========*/ #include /* Symbols used for Tables */ /* Configuration Parameters: */ /* The TBL_LABCASE switch is 1 for case sensitivity */ #define TBL_NUMBER 16 /* maximum number of tables currently open */ #define COLS_MAX 128 /* Maximum number of columns */ #define SORT_MAX 8 /* For Sorting (TCC) */ #define TBL_LABCASE 0 /* No case sensitivity */ /* The TBL_EIO_LIMIT means: use EIO if size > TBL_EIO_LIMIT. It's possible to overrule defaults with the mode parameter in TCTOPN / TCTINI */ #define TBL_EIO_LIMIT (4<<20) /* 4Mb */ #define TBL_TBUFS 10 /* How many buffers */ /* Null values for Integers (Floating NULLS in tz0.c) */ #define NULL1 -128 #define NULL2 -32768 #define NULL4 0x80000000 /* The Datatypes for Tables are built as (element << TBL_D_BITS) + items. Note that the datatype is made of 5 bits abcde where => a=1 for Floating-Point => b=1 for Signed Numbers => (cde) gives the length as log2(length) */ #define TBL_D_BITS 24 #define TBL_D_MASK ((1<>TBL_D_BITS) #define TBL_ElementSize(t) (1<< (TBL_ElementType(t) & 3)) #define TBL_Items(t) (t & TBL_D_MASK) #define TBL_Bytes(t) (TBL_Items(t) << (TBL_ElementType(t)&7)) /* The size of buffers is defined here. Unit is 8k */ #define TBL_LOG2BUF 13 /* 8k = 2**13 ... */ #define TBL_BUFSIZE (1<1 */ char select; /* Selection flag: '\1' for All, zero if unknown */ char unused; /* --------- */ long reclen; /* Record length (bytes) */ long depend; /* Dependent Table */ long imno; /* File number for SC Interfaces */ unsigned char *loaded_map; /* 8k / bit, 64K/byte */ unsigned char *modified_map; /* 8k / bit, 64K/byte */ long nbuf; /* === In Eio mode===== */ long iocount; TABLE_BUF *tbuf; long vno; /* === View Info ====== */ long vsize; unsigned char *vsel; }; typedef struct TBL_FCT TABLE; /* Special Functions (those that don't return status) */ char *TBL_Dlab(); /* Edit the TBLLBLxxx descriptor */ char *TBL_Cfmt(); /* Convert F77 format to C */ char *TBL_ssave(); /* Save a string to a new memory */ char *TBL_RD(); /* Read at offset */ char *TBL_RDF(); /* Read and flag modified at offset */ TABLE *TBL_ptr(); /* Converts tid into pointer to TABLE */ TABLE *TBL_vptr(); /* Get a Virtual Table Structure */ long TBL_offset(); /* Compute offset position (bytes) */ long TBL_SSC(), TBL_SSI1(), TBL_SSI2(), TBL_SSI4(), TBL_SSR(), TBL_SSD(); long TBL_BSC(), TBL_BSI1(), TBL_BSI2(), TBL_BSI4(), TBL_BSR(), TBL_BSD(); /* Frequently used op's */ #define CheckTable(tp) (tp ? ERR_NORMAL : ERR_TBLENT ) #define CheckColumn(tp,c) ((c < 0) || (c > tp->cols) ? \ ERR_TBLCOL : ERR_NORMAL) #define CheckTrueColumn(tp,c) ((c < 1) || (c > tp->cols) ? \ ERR_TBLCOL : ERR_NORMAL) #define CheckRow(tp,row) ((row < 1) || (row > tp->arows) ? \ ERR_TBLROW : ERR_NORMAL) #define CheckTrueRow(tp,row) ((row < 1) || (row > tp->rows) ? \ ERR_TBLROW : ERR_NORMAL) #define ColumnType(tp,c) (tp)->dtype[(c)-1] #define ColumnWidth(tp,c) (tp)->bytes[(c)-1] #define ColumnOffset(tp,c) (tp)->offset[(c)-1] #define ColumnFormat(tp,c) ((tp)->format + (c-1)*(1+TBL_FORLEN)) #define ColumnLabel(tp,c) ((tp)->label + (c-1)*(1+TBL_LABLEN)) #define ColumnEditedWidth(tp,c) (tp)->abytes[(c)-1] #endif