1
/* --------------------- MIDAS definition Table ---------------------------
3
in file MID_INCLUDE:midas_def.h
5
..VERSION 880414: creation (KB)
8
--------------------- MIDAS definition Table --------------------------- */
13
Warning + information messages are numbered < 0 .
14
Error messages are numbered > 0 .
16
Updated error codes have to be reflected in errtable.h + ../errpar.dat
20
#ifndef MIDAS_DEF /* === Just to avoid multiple includes === */
23
#ifdef vms /* VMS does not implement the GNU readline library */
27
#include <fcntl.h> /* needed for defs of off_t, ... */
28
/* since glibc 2.17 we also need stddef.h at least for size_t ... */
41
#include <proto_st.h> /* ANSI-C prototyping for STandard interfaces */
42
#include <proto_tbl.h> /* ANSI-C prototyping for TaBLe interfaces */
43
#include <proto_os.h> /* ANSI-C prototyping for OS interfaces */
44
#include <proto_plt.h> /* ANSI-C prototyping for PLoT interfaces */
45
#include <proto_dsp.h> /* ANSI-C prototyping for DiSPLay interfaces */
46
#include <proto_gen.h> /* ANSI-C prototyping for GENeral interfaces */
47
#include <proto_xcon.h> /* ANSI-C prototyping for XConnection interfaces */
48
#include <proto_ctab.h> /* ANSI-C prototyping for CTAB interfaces */
49
#include <proto_agl.h> /* ANSI-C prototyping for CTAB interfaces */
51
#define ERR_NORMAL 0 /* successful return status */
52
#define ERR_DSCNPR 1 /* descriptor not present */
53
/* error no. 2 is free ... */
54
#define ERR_LOGFIL 3 /* problems with logfile */
55
#define ERR_OPSSYS 4 /* Operating system error */
56
#define ERR_DSKFUL 5 /* disk full */
57
#define ERR_FRMNAC 6 /* frame not accessible */
58
#define ERR_INPINV 7 /* input invalid */
59
#define ERR_CATOVF 8 /* overflow in general catalog */
60
#define ERR_DSCBAD 9 /* descriptor bad */
61
#define ERR_KEYBAD 10 /* keyword bad */
62
#define ERR_KEYOVL 11 /* overflow in keyword data area */
63
#define ERR_KEYOVN 12 /* overflow in keyword name table */
64
#define ERR_FILNAM 13 /* invalid syntax for file name */
65
#define ERR_FILBAD 14 /* file handling error */
66
#define ERR_CATBAD 15 /* bad catalog */
67
#define ERR_MEMOUT 16 /* out of memory */
68
#define ERR_FILPRO 17 /* file protection */
69
#define ERR_FMTBAD 18 /* bad (not matching) binary data format */
70
#define ERR_VERNOR 19 /* unrecognized Midas file version */
71
#define ERR_CBYTES -1 /* bytes per element are not exact */
72
#define ERR_DSCOVF -2 /* descriptor data overflow ( > 65535) */
73
#define ERR_NODATA -3 /* no data available */
74
#define ERR_KEYTYP -4 /* wrong type of keyword */
75
#define ERR_CATENT -5 /* no entry in catalog */
76
#define ERR_MESOVF -6 /* overflow in error message stack */
77
#define ERR_LOSPRC -8 /* loss of prec.: double data -> real descr */
78
#define ERR_DSCTYP -9 /* different descr.type than requested */
81
#define ERR_TBLFUL 20 /* Table errors start at 20 */
82
#define ERR_TBLMEM 21 /* error allocating dynamic mem. */
83
#define ERR_TBLMAP 22 /* error mapping the table */
84
#define ERR_TBLCOV 23 /* column overflow */
85
#define ERR_TBLENT 24 /* table not found wrong init. */
86
#define ERR_TBLCOL 25 /* wrong column number */
87
#define ERR_TBLROW 26 /* wrong row number */
88
#define ERR_TBLKEY 27 /* identifier not found */
89
#define ERR_TBLFMT 28 /* error in column format */
90
#define ERR_TBLIMP 29 /* not implemented */
91
#define ERR_TBLRFM 30 /* error reformatting table */
92
#define ERR_TBLDNM 31 /* duplicate table name */
93
#define ERR_TBLABL 32 /* illegal label */
94
#define ERR_TBLINI 33 /* error in table init */
95
#define ERR_TABVER 34 /* old VMS Midas table format */
97
/* here space for 2 more error codes,
98
for more ERRTAB (errtable.h) has to be extended */
100
#define ERR_FITEXT 37 /* invalid FITS extension */
101
#define ERR_INSBAD 38 /* bad Midas installation */
102
#define ERR_OUTLIM 39 /* 1. elem or no.elem out of bounds */
103
#define ERR_NOCLON 40 /* frame not clonable */
106
/* Character buffer length definitions: */
108
#define KEYNAME_LEN 15
109
#define DESCRNAME_LEN 40
111
#define TYPENAME_LEN 14
116
#define FNAME_LEN 128
123
all following definitions have to be reflected in files
124
st_def.inc + st_dat.inc
127
/* Mode definitions: */
129
#ifndef F_MODES /* CGS: Also defined in tbldef.h */
131
#define F_TRANS 0 /* table transposed format */
132
#define F_RECORD 1 /* table record format */
134
#define F_I_MODE 0 /* map file for input only */
135
#define F_O_MODE 1 /* map file for output */
136
#define F_IO_MODE 2 /* map file for updating */
137
#define F_U_MODE 2 /* map file for updating */
138
#define F_X_MODE 9 /* create/map virtual memory */
140
#define F_H_MODE 7 /* create header file only */
141
#define F_FO_MODE 11 /* map FITS file for output */
144
#define F_MAP_FORCE 0x10 /* Force the mapping (modifier) */
145
#define F_EIO_FORCE 0x20 /* Force the elementary i/o (modifier)*/
146
#define F_ALL_FORCE 0x40 /* Force the allocated values */
150
/* File parameter definitions: */
153
#define F_XD_PARM 0 /* create file with Xlarge dsc area */
154
#define F_DEL_PARM 1 /* set delete flag for extracted */
155
#define F_FITS_PARM 2 /* set flags for handling FITS headers */
158
/* File type definitions: */
161
#define F_OLD_TYPE 0 /* use old type of files */
162
#define F_IMA_TYPE 1 /* type no. for image files */
163
#define F_ASC_TYPE 2 /* type no. for ASCII files */
164
#define F_TBL_TYPE 3 /* type no. for table files */
165
#define F_FIT_TYPE 4 /* type no. for fit files */
166
#define F_FIMA_TYPE 11 /* type no. for FITS images */
167
#define F_FTBL_TYPE 13 /* type no. for FITS tables */
168
#define F_FFIT_TYPE 14 /* type no. for FITS fit files */
171
/* Data Format definitions: */
174
#define D_OLD_FORMAT 0
175
#define D_I1_FORMAT 1 /* I*1 = 1 byte */
176
#define D_I2_FORMAT 2 /* I*2 = 16 bit integer */
177
#define D_UI2_FORMAT 102 /* I*2 = 16 bit unsigned integer */
178
#define D_I4_FORMAT 4 /* I*4 = 32 bit integer */
179
#define D_R4_FORMAT 10 /* R*4 = 32 bit floating point */
180
#define D_R8_FORMAT 18 /* R*8 = 64 bit floating point */
181
#define D_L1_FORMAT 21 /* L*1 = 1 byte logical */
182
#define D_L2_FORMAT 22 /* L*2 = 16 bit logical */
183
#define D_L4_FORMAT 24 /* L*4 = 32 bit logical */
184
#define D_C_FORMAT 30 /* 1 byte character */
185
#define D_X_FORMAT 40 /* 1 byte flags */
186
#define D_P_FORMAT 50 /* pointers */
189
/* Direction definitions: */
201
/* text color definitions: */
204
#define M_DEF_COLOR 0
205
#define M_BLACK_COLOR 1
206
#define M_RED_COLOR 2
207
#define M_GREEN_COLOR 3
208
#define M_BLUE_COLOR 4
209
#define M_YELLOW_COLOR 5
210
#define M_MAGNT_COLOR 6
211
#define M_CYAN_COLOR 7
212
#define M_WHITE_COLOR 8
216
/* use builtin functions for gcc */
219
#define likely(x) __builtin_expect(!!(x), 1)
220
#define unlikely(x) __builtin_expect(!!(x), 0)
224
#define unlikely(x) x
229
/* ------------------------------------------------------------------ */