12 #include <sys/types.h> 14 #if !defined(IO_BUFSIZE_DEFAULT) 16 #define IO_BUFSIZE_DEFAULT 4194304 22 fprintf(stderr,"%s: %s (in %s:%d) : errno#%d\n",msg?msg:NIL,strerror(errno),__FILE__, __LINE__,errno) 24 #if defined(VPP5000) || defined(VPP) 27 extern int snprintf(
char *str,
size_t size,
const char *format, ...);
30 #if defined(NO_TRUNC) || defined(VPP) || defined(SV2) 32 #define trunc(x) ((x) - fmod((x),1)) 34 #if !defined(__cplusplus) 35 extern double trunc(
double d);
39 #define PRIVATE static 47 #define F90nint(x) ( ((x) > 0) ? (int)((x) + 0.5) : (int)((x) - 0.5) ) 51 #define pi ((double)3.14159265358979323844e0) 52 #define half_pi (pi / 2) 53 #define two_pi (2 * pi) 54 #define four_pi (4 * pi) 55 #define pi_over_180 (pi/180) 56 #define recip_pi_over_180 (180/pi) 60 #define R2D(x) ( (180/pi) * ( ((x) > pi) ? ((x) - 2*pi) : (x) ) ) 61 #define D2R(x) ( (pi/180) * ( ((x) > 180) ? ((x) - 360) : (x) ) ) 65 #define R_Earth ((double)6371000e0) 66 #define R_Earth_km ((double)6371e0) 71 #define MIN(a,b) ( ((a) < (b)) ? (a) : (b) ) 74 #define MAX(a,b) ( ((a) > (b)) ? (a) : (b) ) 77 #define ABS(x) ( ((x) >= 0) ? (x) : -(x) ) 80 #define RNDUP_DIV(i,n) (( (i) + (n) - 1 ) / (n)) 83 #define RNDUP(i,n) ( RNDUP_DIV(i,n) * (n)) 85 #define STRLEN(x) (((const char *)(x)) ? (int)strlen(x) : (int)0) 87 #define _POOLNO "$pool#" 88 #define _NPOOLS "$npools#" 89 #define _NTABLES "$ntables#" 90 #define _UNIQNUM "$uniq#" 91 #define _ROWNUM "$row#" 92 #define _COLNUM "$col#" 93 #define _NROWS "$nrows#" 94 #define _NCOLS "$ncols#" 96 #define IS_BSNUM(s) ((s) && *(s) == '\\' && STRLEN(s) >= 2 && isdigit((s)[1])) 97 #define IS_HASH(s) ((s) && *(s) == '#') 98 #define IS_DOLLAR(s) ((s) && *(s) == '$') 99 #define IS_TABLE(s) ((s) && (s)[0] == '@') 101 #define IS_POOLNO(s) ((s) && (((s)[0] == '$' && (s)[1] == '#')|| strequ(s,_POOLNO))) 102 #define IS_(sym,s) strequ(s,_##sym) 103 #define IS_USDHASH(s) ((s) && (s)[0] == '$' && (s)[STRLEN(s)-1] == '#') 104 #define IS_USDDOTHASH(s) (IS_USDHASH(s) && strchr(s,'.') && (strchr(s,'.') == strrchr(s,'.'))) 107 #define GET_OFFSET(s) ((!(s) || IS_DOLLAR(s) || IS_HASH(s) || IS_USDHASH(s)) ? NULL : strrchr(s,*ODB_OFFSET_CHAR)) 120 extern void abor1fl_(
const char *filename,
const int *linenum,
122 int filenamelen,
int slen);
123 extern void abor1_(
const char *s,
int slen);
125 #define ABOR1(txt) { \ 126 const char *t = (txt); \ 127 xl__trbk_(); t ? abor1_(t, strlen(t)) : abor1_("",0); } 129 #define ABOR1FL(txt) { \ 130 const char *t = (txt); \ 131 int linenum=__LINE__; \ 132 t ? abor1fl_(__FILE__, &linenum, t, sizeof(__FILE__)-1, strlen(t)) \ 133 : abor1fl_(__FILE__, &linenum, "", sizeof(__FILE__)-1, 0); \ 138 if ((x) == SIGABRT) { \ 139 const char *txt = "*** Fatal error; aborting (SIGABRT) ..."; \ 150 #define BITS_PER_BYTE 8 161 #define INIT_LOCKID_WITH_NAME(mylock, lockname) \ 162 coml_init_lockid_with_name_(mylock, lockname, strlen(lockname)) 192 #define DEF_IT int it = get_thread_id_() 194 #define DEF_INUMT int inumt = get_max_threads_() 198 #define ZERO_POINT ((double)273.15e0) 202 #define ODB_AGGR_NONE 0x0000000 204 #define ODB_AGGRMASK_DISTINCT 0x0100000 205 #define ODB_AGGRMASK_BOOLEAN 0x1000000 207 #define ODB_AGGR_COUNT 0x0000001 208 #define ODB_AGGR_COUNT_DISTINCT (ODB_AGGRMASK_DISTINCT | ODB_AGGR_COUNT) 210 #define ODB_AGGR_BCOUNT (ODB_AGGRMASK_BOOLEAN | ODB_AGGR_COUNT) 211 #define ODB_AGGR_BCOUNT_DISTINCT (ODB_AGGRMASK_BOOLEAN | ODB_AGGR_COUNT_DISTINCT) 213 #define ODB_AGGR_MIN 0x0000002 214 #define ODB_AGGR_MAX 0x0000004 216 #define ODB_AGGR_SUM 0x0000008 217 #define ODB_AGGR_SUM_DISTINCT (ODB_AGGRMASK_DISTINCT | ODB_AGGR_SUM) 219 #define ODB_AGGR_AVG 0x0000010 220 #define ODB_AGGR_AVG_DISTINCT (ODB_AGGRMASK_DISTINCT | ODB_AGGR_AVG) 222 #define ODB_AGGR_STDEV 0x0000020 223 #define ODB_AGGR_STDEV_DISTINCT (ODB_AGGRMASK_DISTINCT | ODB_AGGR_STDEV) 225 #define ODB_AGGR_RMS 0x0000040 226 #define ODB_AGGR_RMS_DISTINCT (ODB_AGGRMASK_DISTINCT | ODB_AGGR_RMS) 228 #define ODB_AGGR_DOTP 0x0000080 229 #define ODB_AGGR_DOTP_DISTINCT (ODB_AGGRMASK_DISTINCT | ODB_AGGR_DOTP) 231 #define ODB_AGGR_NORM 0x0000100 232 #define ODB_AGGR_NORM_DISTINCT (ODB_AGGRMASK_DISTINCT | ODB_AGGR_NORM) 234 #define ODB_AGGR_VAR 0x0000200 235 #define ODB_AGGR_VAR_DISTINCT (ODB_AGGRMASK_DISTINCT | ODB_AGGR_VAR) 237 #define ODB_AGGR_COVAR 0x0000400 238 #define ODB_AGGR_CORR 0x0000800 240 #define ODB_AGGR_LINREGR_A 0x0001000 241 #define ODB_AGGR_LINREGR_B 0x0002000 243 #define ODB_AGGR_MEDIAN 0x0010000 244 #define ODB_AGGR_MEDIAN_DISTINCT (ODB_AGGRMASK_DISTINCT | ODB_AGGR_MEDIAN) 246 #define ODB_AGGR_MINLOC 0x0020000 247 #define ODB_AGGR_MAXLOC 0x0040000 249 #define ODB_AGGR_DENSITY 0x0080000 251 #define ODB_tag_delim ";" 277 #if !defined(RS6K) && !defined(LINUX) && !defined(HPPA) && !defined(VPP) && !defined(SUN4) && !defined(NECSX) && !defined(SV2) 401 #define S2DLEN (sizeof(S2D)-1) 404 #define S2DlcLEN (sizeof(S2Dlc)-1) 406 #define S2D_all_blanks (0x2020202020202020ull) 430 #define MASK_10 1023U 431 #define MASK_11 2047U 432 #define MASK_12 4095U 433 #define MASK_13 8191U 434 #define MASK_14 16383U 435 #define MASK_15 32767U 436 #define MASK_16 65535U 437 #define MASK_17 131071U 438 #define MASK_18 262143U 439 #define MASK_19 524287U 440 #define MASK_20 1048575U 441 #define MASK_21 2097151U 442 #define MASK_22 4194303U 443 #define MASK_23 8388607U 444 #define MASK_24 16777215U 445 #define MASK_25 33554431U 446 #define MASK_26 67108863U 447 #define MASK_27 134217727U 448 #define MASK_28 268435455U 449 #define MASK_29 536870911U 450 #define MASK_30 1073741823U 451 #define MASK_31 2147483647U 452 #define MASK_32 4294967295U 454 #define MASK(n) MASK_##n 456 #define IOR(x,y) ((x) | (y)) 457 #define IAND(x,y) ((x) & (y)) 459 #define ISHFTL(x,n) ((x) << (n)) 460 #define ISHFTR(x,n) ((x) >> (n)) 462 #define GET_BITS(x, pos, len) IAND(ISHFTR((int)(x), pos), MASK(len)) 464 #define PUT_BITS(to, x, pos, len) \ 465 to = IOR(IAND(to, ~(ISHFTL(MASK(len), pos))), \ 466 IAND((int)(x), ISHFTL(MASK(len), pos))) 468 #define BYTESIZE(x) (x##len * sizeof(*x)) 469 #define BYTESIZE2(x,elemsize) (x##len * (elemsize)) 530 unsigned int other_type:14;
531 unsigned int base_type:2;
532 unsigned int precision_bits:6;
533 unsigned int byte_swappable:1;
534 unsigned int signbit:1;
535 unsigned int pmethod:8;
542 #define EXTRACT_PMETHOD(x) GET_BITS(x,0,8) 543 #define EXTRACT_DATATYPE(x) GET_BITS(x,8,24) 544 #define EXTRACT_SIGNBIT(x) GET_BITS(x,8,1) 545 #define EXTRACT_SWAPPABLE(x) GET_BITS(x,9,1) 546 #define EXTRACT_PRECISION(x) GET_BITS(x,10,6) 547 #define EXTRACT_BASETYPE(x) GET_BITS(x,16,2) 548 #define EXTRACT_OTHERTYPE(x) GET_BITS(x,18,14) 553 #define DATATYPE_UNDEF 0x0 556 #define DATATYPE_BIT 0x100 559 #define DATATYPE_INT1 0x10f 562 #define DATATYPE_INT2 0x113 565 #define DATATYPE_INT4 0x117 568 #define DATATYPE_INT8 0x11b 571 #define DATATYPE_UINT1 0x10e 574 #define DATATYPE_UINT2 0x112 577 #define DATATYPE_UINT4 0x116 580 #define DATATYPE_UINT8 0x11a 583 #define DATATYPE_REAL4 0x216 586 #define DATATYPE_REAL8 0x21a 589 #define DATATYPE_REAL16 0x21e 592 #define DATATYPE_CMPLX4 0x31a 595 #define DATATYPE_CMPLX8 0x31e 598 #define DATATYPE_CMPLX16 0x322 601 #define DATATYPE_BITFIELD 0x416 604 #define DATATYPE_STRING 0x818 607 #define DATATYPE_YYYYMMDD 0x1016 610 #define DATATYPE_HHMMSS 0x2016 613 #define DATATYPE_LINKOFFSET 0x4017 616 #define DATATYPE_LINKLEN 0x8017 619 #define DATATYPE_BUFR 0x10016 622 #define DATATYPE_GRIB 0x20016 625 #define DATATYPE_BLOB 0x4004c 628 #define DATATYPE_LONGBLOB 0x80088 631 #define DATATYPE_CHAR 0x10002c 634 #define DATATYPE_VARCHAR 0x20002c
PUBLIC int get_dtsize(const char *dt)
unsigned int precision_bits
void coml_set_debug_(const int *konoff, int *kret)
unsigned short int ushort
void coml_set_lockid_(o_lock_t *mylock)
quick &counting sorts only inumt inumt name
unsigned long long int u_ll_t
void coml_init_lockid_with_name_(o_lock_t *mylock, const char *name, int name_len)
void abor1fl_(const char *filename, const int *linenum, const char *s, int filenamelen, int slen)
void coml_test_lockid_(int *is_set, o_lock_t *mylock)
void coml_unset_lockid_(o_lock_t *mylock)
void coml_test_lock_(int *is_set)
unsigned int byte_swappable
void coml_in_parallel_(int *is_parallel_region)
int ODB_fprintf(FILE *fp, const char *format,...)
PUBLIC uint get_dtnum(const char *dt)
int snprintf(char *str, size_t size, const char *format,...)
void coml_init_lockid_(o_lock_t *mylock)
unsigned long long int uinteger8
unsigned long long int ulonglong
static const char ODB_OFFSET_CHAR[]
void abor1_(const char *s, int slen)