1 /* 2 3 -Header_File SpiceEK.h ( CSPICE EK-specific definitions ) 4 5 -Abstract 6 7 Perform CSPICE EK-specific definitions, including macros and user- 8 defined types. 9 10 -Disclaimer 11 12 THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE 13 CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. 14 GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE 15 ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE 16 PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" 17 TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY 18 WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A 19 PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC 20 SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE 21 SOFTWARE AND RELATED MATERIALS, HOWEVER USED. 22 23 IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA 24 BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT 25 LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, 26 INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, 27 REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE 28 REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. 29 30 RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF 31 THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY 32 CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE 33 ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. 34 35 -Required_Reading 36 37 None. 38 39 -Particulars 40 41 This header defines macros, enumerated types, structures, and 42 typedefs that may be referenced in application code that calls CSPICE 43 EK functions. 44 45 46 Macros 47 ====== 48 49 General limits 50 -------------- 51 52 Name Description 53 ---- ---------- 54 SPICE_EK_MXCLSG Maximum number of columns per segment. 55 56 SPICE_EK_TYPLEN Maximum length of a short string 57 indicating a data type (one of 58 {"CHR", "DP", "INT", "TIME"}). Such 59 strings are returned by some of the 60 Fortran SPICELIB EK routines, hence also 61 by their f2c'd counterparts. 62 63 Sizes of EK objects 64 ------------------- 65 66 Name Description 67 ---- ---------- 68 69 SPICE_EK_CNAMSZ Maximum length of column name. 70 SPICE_EK_CSTRLN Length of string required to hold column 71 name. 72 SPICE_EK_TNAMSZ Maximum length of table name. 73 SPICE_EK_TSTRLN Length of string required to hold table 74 name. 75 76 77 Query-related limits 78 -------------------- 79 80 Name Description 81 ---- ---------- 82 83 SPICE_EK_MAXQRY Maximum length of an input query. This 84 value is currently equivalent to 85 twenty-five 80-character lines. 86 87 SPICE_EK_MAXQSEL Maximum number of columns that may be 88 listed in the `SELECT clause' of a query. 89 90 SPICE_EK_MAXQTAB Maximum number of tables that may be 91 listed in the `FROM clause' of a query. 92 93 SPICE_EK_MAXQCON Maximum number of relational expressions 94 that may be listed in the `constraint 95 clause' of a query. 96 97 This limit applies to a query when it is 98 represented in `normalized form': that 99 is, the constraints have been expressed 100 as a disjunction of conjunctions of 101 relational expressions. The number of 102 relational expressions in a query that 103 has been expanded in this fashion may be 104 greater than the number of relations in 105 the query as orginally written. For 106 example, the expression 107 108 ( ( A LT 1 ) OR ( B GT 2 ) ) 109 AND 110 ( ( C NE 3 ) OR ( D EQ 4 ) ) 111 112 which contains 4 relational expressions, 113 expands to the equivalent normalized 114 constraint 115 116 ( ( A LT 1 ) AND ( C NE 3 ) ) 117 OR 118 ( ( A LT 1 ) AND ( D EQ 4 ) ) 119 OR 120 ( ( B GT 2 ) AND ( C NE 3 ) ) 121 OR 122 ( ( B GT 2 ) AND ( D EQ 4 ) ) 123 124 which contains eight relational 125 expressions. 126 127 128 129 SPICE_EK_MAXQJOIN Maximum number of tables that can be 130 joined. 131 132 SPICE_EK_MAXQJCON Maximum number of join constraints 133 allowed. 134 135 SPICE_EK_MAXQORD Maximum number of columns that may be 136 used in the `order-by clause' of a query. 137 138 SPICE_EK_MAXQTOK Maximum number of tokens in a query. 139 Tokens 140 are reserved words, column names, 141 parentheses, and values. Literal strings 142 and time values count as single tokens. 143 144 SPICE_EK_MAXQNUM Maximum number of numeric tokens in a 145 query. 146 147 SPICE_EK_MAXQCLN Maximum total length of character tokens 148 in a query. 149 150 SPICE_EK_MAXQSTR Maximum length of literal string values 151 allowed in queries. 152 153 154 Codes 155 ----- 156 157 Name Description 158 ---- ---------- 159 160 SPICE_EK_VARSIZ Code used to indicate variable-size 161 objects. Usually this is used in a 162 context where a non-negative integer 163 indicates the size of a fixed-size object 164 and the presence of this code indicates a 165 variable-size object. 166 167 The value of this constant must match the 168 parameter IFALSE used in the Fortran 169 library SPICELIB. 170 171 172 Enumerated Types 173 ================ 174 175 Enumerated code values 176 ---------------------- 177 178 Name Description 179 ---- ---------- 180 SpiceEKDataType Codes for data types used in the EK 181 interface: character, double precision, 182 integer, and "time." 183 184 The values are: 185 186 { SPICE_CHR = 0, 187 SPICE_DP = 1, 188 SPICE_INT = 2, 189 SPICE_TIME = 3 } 190 191 192 193 SpiceEKExprClass Codes for types of expressions that may 194 appear in the SELECT clause of EK 195 queries. Values and meanings are: 196 197 198 SPICE_EK_EXP_COL Selected item was a 199 column. The column 200 may qualified by a 201 table name. 202 203 SPICE_EK_EXP_FUNC Selected item was 204 a simple function 205 invocation of the 206 form 207 208 F ( <column> ) 209 210 or else was 211 212 COUNT(*) 213 214 SPICE_EK_EXP_EXPR Selected item was a 215 more general 216 expression than 217 those shown above. 218 219 220 Numeric values are: 221 222 { SPICE_EK_EXP_COL = 0, 223 SPICE_EK_EXP_FUNC = 1, 224 SPICE_EK_EXP_EXPR = 2 } 225 226 227 Structures 228 ========== 229 230 EK API structures 231 ----------------- 232 233 Name Description 234 ---- ---------- 235 236 SpiceEKAttDsc EK column attribute descriptor. Note 237 that this object is distinct from the EK 238 column descriptors used internally in 239 the EK routines; those descriptors 240 contain pointers as well as attribute 241 information. 242 243 The members are: 244 245 cclass: Column class code. 246 247 dtype: Data type code: has type 248 SpiceEKDataType. 249 250 strlen: String length. Applies to 251 SPICE_CHR type. Value is 252 SPICE_EK_VARSIZ for 253 variable-length strings. 254 255 size: Column entry size; this is 256 the number of array 257 elements in a column 258 entry. The value is 259 SPICE_EK_VARSIZ for 260 variable-size columns. 261 262 indexd: Index flag; value is 263 SPICETRUE if the column is 264 indexed, SPICEFALSE 265 otherwise. 266 267 nullok: Null flag; value is 268 SPICETRUE if the column 269 may contain null values, 270 SPICEFALSE otherwise. 271 272 273 274 SpiceEKSegSum EK segment summary. This structure 275 contains user interface level descriptive 276 information. The structure contains the 277 following members: 278 279 tabnam The name of the table to 280 which the segment belongs. 281 282 nrows The number of rows in the 283 segment. 284 285 ncols The number of columns in 286 the segment. 287 288 cnames An array of names of 289 columns in the segment. 290 Column names may contain 291 as many as SPICE_EK_CNAMSZ 292 characters. The array 293 contains room for 294 SPICE_EK_MXCLSG column 295 names. 296 297 cdescrs An array of column 298 attribute descriptors of 299 type SpiceEKAttDsc. 300 The array contains room 301 for SPICE_EK_MXCLSG 302 descriptors. The Ith 303 descriptor corresponds to 304 the column whose name is 305 the Ith element of the 306 array cnames. 307 308 -Literature_References 309 310 None. 311 312 -Author_and_Institution 313 314 N.J. Bachman (JPL) 315 316 -Restrictions 317 318 None. 319 320 -Version 321 322 -CSPICE Version 2.0.0 27-JUL-2002 (NJB) 323 324 Defined SpiceEKDataType using SpiceDataType. Removed declaration 325 of enum _SpiceEKDataType. 326 327 -CSPICE Version 1.0.0, 05-JUL-1999 (NJB) 328 329 Renamed _SpiceEKAttDsc member "class" to "cclass." The 330 former name is a reserved word in C++. 331 332 333 -CSPICE Version 1.0.0, 24-FEB-1999 (NJB) 334 335 */ 336 337 #ifndef HAVE_SPICE_EK_H 338 339 #define HAVE_SPICE_EK_H 340 341 342 343 /* 344 Constants 345 */ 346 347 /* 348 Sizes of EK objects: 349 */ 350 351 #define SPICE_EK_CNAMSZ 32 352 #define SPICE_EK_CSTRLN ( SPICE_EK_CNAMSZ + 1 ) 353 #define SPICE_EK_TNAMSZ 64 354 #define SPICE_EK_TSTRLN ( SPICE_EK_TNAMSZ + 1 ) 355 356 357 358 /* 359 Maximum number of columns per segment: 360 */ 361 362 #define SPICE_EK_MXCLSG 100 363 364 365 /* 366 Maximum length of string indicating data type: 367 */ 368 369 #define SPICE_EK_TYPLEN 4 370 371 372 /* 373 Query-related limits (see header for details): 374 */ 375 376 #define SPICE_EK_MAXQRY 2000 377 #define SPICE_EK_MAXQSEL 50 378 #define SPICE_EK_MAXQTAB 10 379 #define SPICE_EK_MAXQCON 1000 380 #define SPICE_EK_MAXQJOIN 10 381 #define SPICE_EK_MAXQJCON 100 382 #define SPICE_EK_MAXQORD 10 383 #define SPICE_EK_MAXQTOK 500 384 #define SPICE_EK_MAXQNUM 100 385 #define SPICE_EK_MAXQCLN SPICE_EK_MAXQRY 386 #define SPICE_EK_MAXQSTR 1024 387 388 389 390 /* 391 Code indicating "variable size": 392 */ 393 #define SPICE_EK_VARSIZ (-1) 394 395 396 397 /* 398 Data type codes: 399 */ 400 typedef SpiceDataType SpiceEKDataType; 401 402 403 404 /* 405 SELECT clause expression type codes: 406 */ 407 enum _SpiceEKExprClass{ SPICE_EK_EXP_COL = 0, 408 SPICE_EK_EXP_FUNC = 1, 409 SPICE_EK_EXP_EXPR = 2 }; 410 411 typedef enum _SpiceEKExprClass SpiceEKExprClass; 412 413 414 415 /* 416 EK column attribute descriptor: 417 */ 418 419 struct _SpiceEKAttDsc 420 421 { SpiceInt cclass; 422 SpiceEKDataType dtype; 423 SpiceInt strlen; 424 SpiceInt size; 425 SpiceBoolean indexd; 426 SpiceBoolean nullok; }; 427 428 typedef struct _SpiceEKAttDsc SpiceEKAttDsc; 429 430 431 432 /* 433 EK segment summary: 434 */ 435 436 struct _SpiceEKSegSum 437 438 { SpiceChar tabnam [SPICE_EK_TSTRLN]; 439 SpiceInt nrows; 440 SpiceInt ncols; 441 SpiceChar cnames [SPICE_EK_MXCLSG][SPICE_EK_CSTRLN]; 442 SpiceEKAttDsc cdescrs[SPICE_EK_MXCLSG]; }; 443 444 typedef struct _SpiceEKSegSum SpiceEKSegSum; 445 446 447 #endif 448 449