UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Types.h
1 /* $Id: Types.h,v 1.57 2007/05/28 19:02:18 ibadm Exp $ */
2 
3 /*********************************************************************
4  *
5  * UNIVERS
6  * (C) ООО "ГЕОВЕРС", 2001
7  *
8  * Все права защищены * * Использование, копирование или передача регулируются законами * Российской Федерации "Об авторском праве и смежных правах", "О * правовой охране программ для электронных вычислительных машин и баз * данных" * * Encoding: ISO-8859-5 (GOST) * *********************************************************************/ #ifndef __Types_h #define __Types_h #include <unistd.h> //#include <sys/types.h> #include <stddef.h> #include "portability.h" /* We are sure a compiler is 64-bit compatible */ #define CompilerIs64bitReady /************************************************************* * General purpose types, constants, macros. *************************************************************/ /* NULL everywhere */ #if !defined(NULL) # define NULL ((void*)0) #endif /* Boolean type and values */ /*#ifndef __cplusplus*/ /* C-compatible definition */ typedef int Logic; /* 0 - FALSE; 1 - TRUE */ #if !defined(FALSE) || (FALSE != 0) # define FALSE 0 #endif #if !defined(TRUE) || (TRUE != 1) # define TRUE 1 #endif #if 0 /* C++ only */ /* C++ `bool' type usage */ typedef bool Logic; #ifdef FALSE # undef FALSE #endif #define FALSE false #ifdef TRUE # undef TRUE #endif #define TRUE true #endif /* __cplusplus `Logic' */ /* For last item of a vector designatiuon */ #ifndef _last_ /* A'la Perl :-) */ #define _last_ ((unsigned)(-1)) #endif /* _last_ */ /* Comparation method's type and values */ typedef int Compar; /* -1 - LESS; 0 - EQUAL; 1 - GREATER */ #define LESS (-1) #define EQUAL 0 #define GREATER 1 /* NOT-operation for COMPAR type */ #define OPPOSITE(x) ((x)==EQUAL?EQUAL:((x)==GREATER)?LESS:GREATER) /* Arithmetical comparation */ #define COMPAR0(x) ((x)==0?EQUAL:((x)<0)?LESS:GREATER) #define COMPAR(x,y) ((x)==(y)?EQUAL:((x)<(y))?LESS:GREATER) /* Aliases for Compar values: useful with SortedAr::sort() */ #define ASCENT_ORDER LESS #define DESCENT_ORDER GREATER #define NO_ORDER EQUAL /* Macro like XtNumber */ #define NUMBER(x) (sizeof(x)/sizeof(x[0])) /* Return TRUE if internal representation of float number is not * a number (NaN) for SPARC and IBM POWER. Not for INTEL x86!!! * Conforms to ANSI/IEEE 754-1985. * More reliable and machine undependent approach see in <mix/misc.h> */ #define IS_NAN(x) (((*(long *)&(x) & 0x7f800000L) == 0x7f800000L) && \ ((*(long *)&(x) & 0x007fffffL) != 0x00000000L)) #ifndef _ErrCode_ typedef int ErrCode; #define _ErrCode_ #endif /* Machine dependent types */ typedef float Real; typedef int Int; typedef unsigned UnsInt; /* Machine independent types with fixed length */ typedef double Real8; typedef float Real4; #ifdef CompilerIs64bitReady typedef long long Int8; #endif /* CompilerIs64bitReady */ typedef int Int4; typedef short Int2; typedef char Int1; typedef char Char; typedef unsigned short Char2; /* Machine independent types for special applications */ #ifdef CompilerIs64bitReady typedef unsigned long long UnsInt8; #endif /* CompilerIs64bitReady */ typedef unsigned int UnsInt4; typedef unsigned short UnsInt2; typedef unsigned char UnsInt1; typedef UnsInt4 BlobRef; /* Enumerator for machine independent types */ typedef enum { REAL_4 = 0, /* float */ REAL_8 = 1, /* double */ INT_4 = 2, /* int */ INT_2 = 3, /* short */ INT_1 = 4, /* char-number */ CHAR_1 = 5, /* char in ascii */ CHAR_EBCDIC = 6, /* char in ebcdic */ DBTPTR = 7, /* data base table pointer -- chars */ CHAR_2 = 8, /* char for asian language texts */ INT_8 = 9, /* long long */ BLOBREF = 10, /* binary large object reference */ __NO_TYPE__ = 99 /* for type validity control */ } AtomType; /* DBTPTR is a char[] of pointed length (with EOS) */ #define DBTPTR_LEN 46 /* UC_ISODATE is a string of defined length (with final EOS) */ #define ISODATE_LEN 20 /* UdbKey has a UDBKEY type id */ #define UDBKEY INT_8 /* Index for data base lines */ typedef UnsInt4 DbIndex; /* Trace index */ typedef UnsInt4 TraceIndex; /* Trace key */ typedef Real4 TraceKey; /* For X-graphics */ typedef unsigned long ColorPixel; typedef int ScreenNo; /* AtomType subclasses: */ #define AT_INTEGER(x) (INT_1==(x)||INT_2==(x)||INT_4==(x)||INT_8==(x)) #define AT_REAL(x) (REAL_4==(x)||REAL_8==(x)) #define AT_NUMERIC(x) (AT_INTEGER(x)||AT_REAL(x)) #define AT_LATINCHAR(x) (CHAR_1==(x)||CHAR_EBCDIC==(x)) #define AT_TEXT(x) (AT_LATINCHAR(x)||CHAR_2==(x)) /* Useful macros */ #ifndef MIN # define MIN(a,b) ((a)>(b)?(b):(a)) #endif #ifndef MAX # define MAX(a,b) ((a)<(b)?(b):(a)) #endif #ifndef SIGN # define SIGN(x) COMPAR0(x) #endif #ifndef ABS # define ABS(a) ((a)>=0?(a):-(a)) #endif /* Align size to 4-bytes */ #define ALIGN4(x) ((3&(unsigned)(x))?(1+(3|(unsigned)(x))):(unsigned)(x)) /* Align size to 2-bytes */ #define ALIGN2(x) ((1&(unsigned)(x))?(1+(1|(unsigned)(x))):(unsigned)(x)) /* Fortran subroutine ASUBR must be called from C/C++ as Fortran(asubr) */ #if (defined(_AIX) && !defined(__GNUC__)) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* AIX XL FORTRAN default calling convension is name without trailing underscore */ /* Disabled underscores on SUN Workshop Pro due to ## is not recognized on version 4. FF="f77 -ext_names=plain" */ #define Fortran(x) x #else /* Usual convension (__GNUC__ on AIX too) */ #define Fortran(x) x##_ #endif #include <mix/type_services.h> #ifndef __variabledefs /* Translate AtomType to string */ extern char* AtomTypeToString[12]; /* Translate AtomType to size (in bytes) */ extern size_t AtomTypeToSize[12]; #endif /* __variabledefs */ #endif /* Types.h */
9  *
10  * Использование, копирование или передача регулируются законами
11  * Российской Федерации "Об авторском праве и смежных правах", "О * правовой охране программ для электронных вычислительных машин и баз * данных" * * Encoding: ISO-8859-5 (GOST) * *********************************************************************/ #ifndef __Types_h #define __Types_h #include <unistd.h> //#include <sys/types.h> #include <stddef.h> #include "portability.h" /* We are sure a compiler is 64-bit compatible */ #define CompilerIs64bitReady /************************************************************* * General purpose types, constants, macros. *************************************************************/ /* NULL everywhere */ #if !defined(NULL) # define NULL ((void*)0) #endif /* Boolean type and values */ /*#ifndef __cplusplus*/ /* C-compatible definition */ typedef int Logic; /* 0 - FALSE; 1 - TRUE */ #if !defined(FALSE) || (FALSE != 0) # define FALSE 0 #endif #if !defined(TRUE) || (TRUE != 1) # define TRUE 1 #endif #if 0 /* C++ only */ /* C++ `bool' type usage */ typedef bool Logic; #ifdef FALSE # undef FALSE #endif #define FALSE false #ifdef TRUE # undef TRUE #endif #define TRUE true #endif /* __cplusplus `Logic' */ /* For last item of a vector designatiuon */ #ifndef _last_ /* A'la Perl :-) */ #define _last_ ((unsigned)(-1)) #endif /* _last_ */ /* Comparation method's type and values */ typedef int Compar; /* -1 - LESS; 0 - EQUAL; 1 - GREATER */ #define LESS (-1) #define EQUAL 0 #define GREATER 1 /* NOT-operation for COMPAR type */ #define OPPOSITE(x) ((x)==EQUAL?EQUAL:((x)==GREATER)?LESS:GREATER) /* Arithmetical comparation */ #define COMPAR0(x) ((x)==0?EQUAL:((x)<0)?LESS:GREATER) #define COMPAR(x,y) ((x)==(y)?EQUAL:((x)<(y))?LESS:GREATER) /* Aliases for Compar values: useful with SortedAr::sort() */ #define ASCENT_ORDER LESS #define DESCENT_ORDER GREATER #define NO_ORDER EQUAL /* Macro like XtNumber */ #define NUMBER(x) (sizeof(x)/sizeof(x[0])) /* Return TRUE if internal representation of float number is not * a number (NaN) for SPARC and IBM POWER. Not for INTEL x86!!! * Conforms to ANSI/IEEE 754-1985. * More reliable and machine undependent approach see in <mix/misc.h> */ #define IS_NAN(x) (((*(long *)&(x) & 0x7f800000L) == 0x7f800000L) && \ ((*(long *)&(x) & 0x007fffffL) != 0x00000000L)) #ifndef _ErrCode_ typedef int ErrCode; #define _ErrCode_ #endif /* Machine dependent types */ typedef float Real; typedef int Int; typedef unsigned UnsInt; /* Machine independent types with fixed length */ typedef double Real8; typedef float Real4; #ifdef CompilerIs64bitReady typedef long long Int8; #endif /* CompilerIs64bitReady */ typedef int Int4; typedef short Int2; typedef char Int1; typedef char Char; typedef unsigned short Char2; /* Machine independent types for special applications */ #ifdef CompilerIs64bitReady typedef unsigned long long UnsInt8; #endif /* CompilerIs64bitReady */ typedef unsigned int UnsInt4; typedef unsigned short UnsInt2; typedef unsigned char UnsInt1; typedef UnsInt4 BlobRef; /* Enumerator for machine independent types */ typedef enum { REAL_4 = 0, /* float */ REAL_8 = 1, /* double */ INT_4 = 2, /* int */ INT_2 = 3, /* short */ INT_1 = 4, /* char-number */ CHAR_1 = 5, /* char in ascii */ CHAR_EBCDIC = 6, /* char in ebcdic */ DBTPTR = 7, /* data base table pointer -- chars */ CHAR_2 = 8, /* char for asian language texts */ INT_8 = 9, /* long long */ BLOBREF = 10, /* binary large object reference */ __NO_TYPE__ = 99 /* for type validity control */ } AtomType; /* DBTPTR is a char[] of pointed length (with EOS) */ #define DBTPTR_LEN 46 /* UC_ISODATE is a string of defined length (with final EOS) */ #define ISODATE_LEN 20 /* UdbKey has a UDBKEY type id */ #define UDBKEY INT_8 /* Index for data base lines */ typedef UnsInt4 DbIndex; /* Trace index */ typedef UnsInt4 TraceIndex; /* Trace key */ typedef Real4 TraceKey; /* For X-graphics */ typedef unsigned long ColorPixel; typedef int ScreenNo; /* AtomType subclasses: */ #define AT_INTEGER(x) (INT_1==(x)||INT_2==(x)||INT_4==(x)||INT_8==(x)) #define AT_REAL(x) (REAL_4==(x)||REAL_8==(x)) #define AT_NUMERIC(x) (AT_INTEGER(x)||AT_REAL(x)) #define AT_LATINCHAR(x) (CHAR_1==(x)||CHAR_EBCDIC==(x)) #define AT_TEXT(x) (AT_LATINCHAR(x)||CHAR_2==(x)) /* Useful macros */ #ifndef MIN # define MIN(a,b) ((a)>(b)?(b):(a)) #endif #ifndef MAX # define MAX(a,b) ((a)<(b)?(b):(a)) #endif #ifndef SIGN # define SIGN(x) COMPAR0(x) #endif #ifndef ABS # define ABS(a) ((a)>=0?(a):-(a)) #endif /* Align size to 4-bytes */ #define ALIGN4(x) ((3&(unsigned)(x))?(1+(3|(unsigned)(x))):(unsigned)(x)) /* Align size to 2-bytes */ #define ALIGN2(x) ((1&(unsigned)(x))?(1+(1|(unsigned)(x))):(unsigned)(x)) /* Fortran subroutine ASUBR must be called from C/C++ as Fortran(asubr) */ #if (defined(_AIX) && !defined(__GNUC__)) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* AIX XL FORTRAN default calling convension is name without trailing underscore */ /* Disabled underscores on SUN Workshop Pro due to ## is not recognized on version 4. FF="f77 -ext_names=plain" */ #define Fortran(x) x #else /* Usual convension (__GNUC__ on AIX too) */ #define Fortran(x) x##_ #endif #include <mix/type_services.h> #ifndef __variabledefs /* Translate AtomType to string */ extern char* AtomTypeToString[12]; /* Translate AtomType to size (in bytes) */ extern size_t AtomTypeToSize[12]; #endif /* __variabledefs */ #endif /* Types.h */
12  * правовой охране программ для электронных вычислительных машин и баз * данных" * * Encoding: ISO-8859-5 (GOST) * *********************************************************************/ #ifndef __Types_h #define __Types_h #include <unistd.h> //#include <sys/types.h> #include <stddef.h> #include "portability.h" /* We are sure a compiler is 64-bit compatible */ #define CompilerIs64bitReady /************************************************************* * General purpose types, constants, macros. *************************************************************/ /* NULL everywhere */ #if !defined(NULL) # define NULL ((void*)0) #endif /* Boolean type and values */ /*#ifndef __cplusplus*/ /* C-compatible definition */ typedef int Logic; /* 0 - FALSE; 1 - TRUE */ #if !defined(FALSE) || (FALSE != 0) # define FALSE 0 #endif #if !defined(TRUE) || (TRUE != 1) # define TRUE 1 #endif #if 0 /* C++ only */ /* C++ `bool' type usage */ typedef bool Logic; #ifdef FALSE # undef FALSE #endif #define FALSE false #ifdef TRUE # undef TRUE #endif #define TRUE true #endif /* __cplusplus `Logic' */ /* For last item of a vector designatiuon */ #ifndef _last_ /* A'la Perl :-) */ #define _last_ ((unsigned)(-1)) #endif /* _last_ */ /* Comparation method's type and values */ typedef int Compar; /* -1 - LESS; 0 - EQUAL; 1 - GREATER */ #define LESS (-1) #define EQUAL 0 #define GREATER 1 /* NOT-operation for COMPAR type */ #define OPPOSITE(x) ((x)==EQUAL?EQUAL:((x)==GREATER)?LESS:GREATER) /* Arithmetical comparation */ #define COMPAR0(x) ((x)==0?EQUAL:((x)<0)?LESS:GREATER) #define COMPAR(x,y) ((x)==(y)?EQUAL:((x)<(y))?LESS:GREATER) /* Aliases for Compar values: useful with SortedAr::sort() */ #define ASCENT_ORDER LESS #define DESCENT_ORDER GREATER #define NO_ORDER EQUAL /* Macro like XtNumber */ #define NUMBER(x) (sizeof(x)/sizeof(x[0])) /* Return TRUE if internal representation of float number is not * a number (NaN) for SPARC and IBM POWER. Not for INTEL x86!!! * Conforms to ANSI/IEEE 754-1985. * More reliable and machine undependent approach see in <mix/misc.h> */ #define IS_NAN(x) (((*(long *)&(x) & 0x7f800000L) == 0x7f800000L) && \ ((*(long *)&(x) & 0x007fffffL) != 0x00000000L)) #ifndef _ErrCode_ typedef int ErrCode; #define _ErrCode_ #endif /* Machine dependent types */ typedef float Real; typedef int Int; typedef unsigned UnsInt; /* Machine independent types with fixed length */ typedef double Real8; typedef float Real4; #ifdef CompilerIs64bitReady typedef long long Int8; #endif /* CompilerIs64bitReady */ typedef int Int4; typedef short Int2; typedef char Int1; typedef char Char; typedef unsigned short Char2; /* Machine independent types for special applications */ #ifdef CompilerIs64bitReady typedef unsigned long long UnsInt8; #endif /* CompilerIs64bitReady */ typedef unsigned int UnsInt4; typedef unsigned short UnsInt2; typedef unsigned char UnsInt1; typedef UnsInt4 BlobRef; /* Enumerator for machine independent types */ typedef enum { REAL_4 = 0, /* float */ REAL_8 = 1, /* double */ INT_4 = 2, /* int */ INT_2 = 3, /* short */ INT_1 = 4, /* char-number */ CHAR_1 = 5, /* char in ascii */ CHAR_EBCDIC = 6, /* char in ebcdic */ DBTPTR = 7, /* data base table pointer -- chars */ CHAR_2 = 8, /* char for asian language texts */ INT_8 = 9, /* long long */ BLOBREF = 10, /* binary large object reference */ __NO_TYPE__ = 99 /* for type validity control */ } AtomType; /* DBTPTR is a char[] of pointed length (with EOS) */ #define DBTPTR_LEN 46 /* UC_ISODATE is a string of defined length (with final EOS) */ #define ISODATE_LEN 20 /* UdbKey has a UDBKEY type id */ #define UDBKEY INT_8 /* Index for data base lines */ typedef UnsInt4 DbIndex; /* Trace index */ typedef UnsInt4 TraceIndex; /* Trace key */ typedef Real4 TraceKey; /* For X-graphics */ typedef unsigned long ColorPixel; typedef int ScreenNo; /* AtomType subclasses: */ #define AT_INTEGER(x) (INT_1==(x)||INT_2==(x)||INT_4==(x)||INT_8==(x)) #define AT_REAL(x) (REAL_4==(x)||REAL_8==(x)) #define AT_NUMERIC(x) (AT_INTEGER(x)||AT_REAL(x)) #define AT_LATINCHAR(x) (CHAR_1==(x)||CHAR_EBCDIC==(x)) #define AT_TEXT(x) (AT_LATINCHAR(x)||CHAR_2==(x)) /* Useful macros */ #ifndef MIN # define MIN(a,b) ((a)>(b)?(b):(a)) #endif #ifndef MAX # define MAX(a,b) ((a)<(b)?(b):(a)) #endif #ifndef SIGN # define SIGN(x) COMPAR0(x) #endif #ifndef ABS # define ABS(a) ((a)>=0?(a):-(a)) #endif /* Align size to 4-bytes */ #define ALIGN4(x) ((3&(unsigned)(x))?(1+(3|(unsigned)(x))):(unsigned)(x)) /* Align size to 2-bytes */ #define ALIGN2(x) ((1&(unsigned)(x))?(1+(1|(unsigned)(x))):(unsigned)(x)) /* Fortran subroutine ASUBR must be called from C/C++ as Fortran(asubr) */ #if (defined(_AIX) && !defined(__GNUC__)) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* AIX XL FORTRAN default calling convension is name without trailing underscore */ /* Disabled underscores on SUN Workshop Pro due to ## is not recognized on version 4. FF="f77 -ext_names=plain" */ #define Fortran(x) x #else /* Usual convension (__GNUC__ on AIX too) */ #define Fortran(x) x##_ #endif #include <mix/type_services.h> #ifndef __variabledefs /* Translate AtomType to string */ extern char* AtomTypeToString[12]; /* Translate AtomType to size (in bytes) */ extern size_t AtomTypeToSize[12]; #endif /* __variabledefs */ #endif /* Types.h */
13  * данных"
14  *
15  * Encoding: ISO-8859-5 (GOST)
16  *
17  *********************************************************************/
18 
19 #ifndef __Types_h
20 
21 #define __Types_h
22 
23 #include <unistd.h>
24 //#include <sys/types.h>
25 #include <stddef.h>
26 
27 #include "portability.h"
28 
29 
30 /* We are sure a compiler is 64-bit compatible */
31 #define CompilerIs64bitReady
32 
33 
34 /*************************************************************
35  * General purpose types, constants, macros.
36  *************************************************************/
37 
38 /* NULL everywhere */
39 #if !defined(NULL)
40 # define NULL ((void*)0)
41 #endif
42 
43 /* Boolean type and values */
44 /*#ifndef __cplusplus*/
45 
46 /* C-compatible definition */
47 
48 typedef int Logic; /* 0 - FALSE; 1 - TRUE */
49 #if !defined(FALSE) || (FALSE != 0)
50 # define FALSE 0
51 #endif
52 #if !defined(TRUE) || (TRUE != 1)
53 # define TRUE 1
54 #endif
55 
56 #if 0 /* C++ only */
57 
58 /* C++ `bool' type usage */
59 
60 typedef bool Logic;
61 
62 #ifdef FALSE
63 # undef FALSE
64 #endif
65 #define FALSE false
66 
67 #ifdef TRUE
68 # undef TRUE
69 #endif
70 #define TRUE true
71 
72 #endif /* __cplusplus `Logic' */
73 
74 
75 /* For last item of a vector designatiuon */
76 #ifndef _last_
77 /* A'la Perl :-) */
78 #define _last_ ((unsigned)(-1))
79 #endif /* _last_ */
80 
81 /* Comparation method's type and values */
82 typedef int Compar; /* -1 - LESS; 0 - EQUAL; 1 - GREATER */
83 #define LESS (-1)
84 #define EQUAL 0
85 #define GREATER 1
86 
87 /* NOT-operation for COMPAR type */
88 #define OPPOSITE(x) ((x)==EQUAL?EQUAL:((x)==GREATER)?LESS:GREATER)
89 
90 /* Arithmetical comparation */
91 #define COMPAR0(x) ((x)==0?EQUAL:((x)<0)?LESS:GREATER)
92 #define COMPAR(x,y) ((x)==(y)?EQUAL:((x)<(y))?LESS:GREATER)
93 
94 /* Aliases for Compar values: useful with SortedAr::sort() */
95 #define ASCENT_ORDER LESS
96 #define DESCENT_ORDER GREATER
97 #define NO_ORDER EQUAL
98 
99 /* Macro like XtNumber */
100 #define NUMBER(x) (sizeof(x)/sizeof(x[0]))
101 
102 /* Return TRUE if internal representation of float number is not
103  * a number (NaN) for SPARC and IBM POWER. Not for INTEL x86!!!
104  * Conforms to ANSI/IEEE 754-1985.
105  * More reliable and machine undependent approach see in <mix/misc.h> */
106 #define IS_NAN(x) (((*(long *)&(x) & 0x7f800000L) == 0x7f800000L) && \
107  ((*(long *)&(x) & 0x007fffffL) != 0x00000000L))
108 
109 #ifndef _ErrCode_
110 typedef int ErrCode;
111 #define _ErrCode_
112 #endif
113 
114 /* Machine dependent types */
115 typedef float Real;
116 typedef int Int;
117 typedef unsigned UnsInt;
118 
119 /* Machine independent types with fixed length */
120 typedef double Real8;
121 typedef float Real4;
122 #ifdef CompilerIs64bitReady
123 typedef long long Int8;
124 #endif /* CompilerIs64bitReady */
125 typedef int Int4;
126 typedef short Int2;
127 typedef char Int1;
128 typedef char Char;
129 typedef unsigned short Char2;
130 
131 /* Machine independent types for special applications */
132 #ifdef CompilerIs64bitReady
133 typedef unsigned long long UnsInt8;
134 #endif /* CompilerIs64bitReady */
135 typedef unsigned int UnsInt4;
136 typedef unsigned short UnsInt2;
137 typedef unsigned char UnsInt1;
138 typedef UnsInt4 BlobRef;
139 
140 
141 /* Enumerator for machine independent types */
142 typedef enum
143 {
144  REAL_4 = 0, /* float */
145  REAL_8 = 1, /* double */
146  INT_4 = 2, /* int */
147  INT_2 = 3, /* short */
148  INT_1 = 4, /* char-number */
149  CHAR_1 = 5, /* char in ascii */
150  CHAR_EBCDIC = 6, /* char in ebcdic */
151  DBTPTR = 7, /* data base table pointer -- chars */
152  CHAR_2 = 8, /* char for asian language texts */
153  INT_8 = 9, /* long long */
154  BLOBREF = 10, /* binary large object reference */
155  __NO_TYPE__ = 99 /* for type validity control */
156 
157 } AtomType;
158 
159 /* DBTPTR is a char[] of pointed length (with EOS) */
160 #define DBTPTR_LEN 46
161 
162 /* UC_ISODATE is a string of defined length (with final EOS) */
163 #define ISODATE_LEN 20
164 
165 /* UdbKey has a UDBKEY type id */
166 #define UDBKEY INT_8
167 
168 /* Index for data base lines */
169 typedef UnsInt4 DbIndex;
170 
171 /* Trace index */
172 typedef UnsInt4 TraceIndex;
173 
174 /* Trace key */
175 typedef Real4 TraceKey;
176 
177 /* For X-graphics */
178 typedef unsigned long ColorPixel;
179 typedef int ScreenNo;
180 
181 /* AtomType subclasses: */
182 #define AT_INTEGER(x) (INT_1==(x)||INT_2==(x)||INT_4==(x)||INT_8==(x))
183 #define AT_REAL(x) (REAL_4==(x)||REAL_8==(x))
184 #define AT_NUMERIC(x) (AT_INTEGER(x)||AT_REAL(x))
185 #define AT_LATINCHAR(x) (CHAR_1==(x)||CHAR_EBCDIC==(x))
186 #define AT_TEXT(x) (AT_LATINCHAR(x)||CHAR_2==(x))
187 
188 
189 /* Useful macros */
190 #ifndef MIN
191 # define MIN(a,b) ((a)>(b)?(b):(a))
192 #endif
193 #ifndef MAX
194 # define MAX(a,b) ((a)<(b)?(b):(a))
195 #endif
196 #ifndef SIGN
197 # define SIGN(x) COMPAR0(x)
198 #endif
199 #ifndef ABS
200 # define ABS(a) ((a)>=0?(a):-(a))
201 #endif
202 
203 /* Align size to 4-bytes */
204 #define ALIGN4(x) ((3&(unsigned)(x))?(1+(3|(unsigned)(x))):(unsigned)(x))
205 
206 /* Align size to 2-bytes */
207 #define ALIGN2(x) ((1&(unsigned)(x))?(1+(1|(unsigned)(x))):(unsigned)(x))
208 
209 /* Fortran subroutine ASUBR must be called from C/C++ as Fortran(asubr) */
210 #if (defined(_AIX) && !defined(__GNUC__)) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
211 /* AIX XL FORTRAN default calling convension is name without trailing
212  underscore */
213 /* Disabled underscores on SUN Workshop Pro due to ## is not
214  recognized on version 4. FF="f77 -ext_names=plain" */
215 #define Fortran(x) x
216 
217 #else
218 /* Usual convension (__GNUC__ on AIX too) */
219 #define Fortran(x) x##_
220 #endif
221 
222 
223 #include <mix/type_services.h>
224 
225 
226 #ifndef __variabledefs
227 
228 /* Translate AtomType to string */
229 extern char* AtomTypeToString[12];
230 
231 /* Translate AtomType to size (in bytes) */
232 extern size_t AtomTypeToSize[12];
233 
234 #endif /* __variabledefs */
235 
236 #endif /* Types.h */