1 /* zzekvmch.f -- translated by f2c (version 19980913).
2    You must link the resulting object file with the libraries:
3 	-lf2c -lm   (in that order)
4 */
5 
6 #include "f2c.h"
7 
8 /* Table of constant values */
9 
10 static integer c__24 = 24;
11 static integer c__11 = 11;
12 
13 /* $Procedure      ZZEKVMCH ( EK, vector match ) */
zzekvmch_(integer * ncnstr,logical * active,integer * lhans,integer * lsdscs,integer * lcdscs,integer * lrows,integer * lelts,integer * ops,integer * rhans,integer * rsdscs,integer * rcdscs,integer * rrows,integer * relts)14 logical zzekvmch_(integer *ncnstr, logical *active, integer *lhans, integer *
15 	lsdscs, integer *lcdscs, integer *lrows, integer *lelts, integer *ops,
16 	 integer *rhans, integer *rsdscs, integer *rcdscs, integer *rrows,
17 	integer *relts)
18 {
19     /* System generated locals */
20     integer i__1, i__2, i__3, i__4, i__5, i__6, i__7, i__8;
21     logical ret_val;
22 
23     /* Builtin functions */
24     integer s_rnge(char *, integer, char *, integer);
25 
26     /* Local variables */
27     char cval[1024*2];
28     integer hans[2], elts[2];
29     logical null[2];
30     integer rows[2];
31     extern integer zzekecmp_(integer *, integer *, integer *, integer *,
32 	    integer *);
33     integer i__, n;
34     extern /* Subroutine */ int chkin_(char *, ftnlen);
35     integer cvlen[2];
36     logical found;
37     extern /* Subroutine */ int movei_(integer *, integer *, integer *);
38     extern logical matchi_(char *, char *, char *, char *, ftnlen, ftnlen,
39 	    ftnlen, ftnlen);
40     integer cldscs[22]	/* was [11][2] */, cmplen[2], sgdscs[48]	/*
41 	    was [24][2] */;
42     extern /* Subroutine */ int setmsg_(char *, ftnlen), errhan_(char *,
43 	    integer *, ftnlen), errint_(char *, integer *, ftnlen), sigerr_(
44 	    char *, ftnlen), chkout_(char *, ftnlen);
45     integer rel;
46     extern /* Subroutine */ int zzekrsc_(integer *, integer *, integer *,
47 	    integer *, integer *, integer *, char *, logical *, logical *,
48 	    ftnlen);
49 
50 /* $ Abstract */
51 
52 /*     Determine whether a vector of constraints involving comparisons of */
53 /*     specified EK column elements is satisfied. */
54 
55 /* $ Disclaimer */
56 
57 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
58 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
59 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
60 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
61 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
62 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
63 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
64 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
65 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
66 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
67 
68 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
69 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
70 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
71 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
72 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
73 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
74 
75 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
76 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
77 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
78 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
79 
80 /* $ Required_Reading */
81 
82 /*     EK */
83 
84 /* $ Keywords */
85 
86 /*     EK */
87 /*     PRIVATE */
88 
89 /* $ Declarations */
90 /* $ Disclaimer */
91 
92 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
93 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
94 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
95 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
96 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
97 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
98 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
99 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
100 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
101 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
102 
103 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
104 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
105 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
106 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
107 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
108 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
109 
110 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
111 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
112 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
113 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
114 
115 
116 /*     Include Section:  EK Boolean Enumerated Type */
117 
118 
119 /*        ekbool.inc Version 1   21-DEC-1994 (NJB) */
120 
121 
122 /*     Within the EK system, boolean values sometimes must be */
123 /*     represented by integer or character codes.  The codes and their */
124 /*     meanings are listed below. */
125 
126 /*     Integer code indicating `true': */
127 
128 
129 /*     Integer code indicating `false': */
130 
131 
132 /*     Character code indicating `true': */
133 
134 
135 /*     Character code indicating `false': */
136 
137 
138 /*     End Include Section:  EK Boolean Enumerated Type */
139 
140 /* $ Disclaimer */
141 
142 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
143 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
144 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
145 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
146 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
147 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
148 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
149 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
150 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
151 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
152 
153 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
154 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
155 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
156 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
157 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
158 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
159 
160 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
161 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
162 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
163 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
164 
165 
166 /*     Include Section:  EK Operator Codes */
167 
168 /*        ekopcd.inc  Version 1  30-DEC-1994 (NJB) */
169 
170 
171 /*     Within the EK system, operators used in EK queries are */
172 /*     represented by integer codes.  The codes and their meanings are */
173 /*     listed below. */
174 
175 /*     Relational expressions in EK queries have the form */
176 
177 /*        <column name> <operator> <value> */
178 
179 /*     For columns containing numeric values, the operators */
180 
181 /*        EQ,  GE,  GT,  LE,  LT,  NE */
182 
183 /*     may be used; these operators have the same meanings as their */
184 /*     Fortran counterparts.  For columns containing character values, */
185 /*     the list of allowed operators includes those in the above list, */
186 /*     and in addition includes the operators */
187 
188 /*        LIKE,  UNLIKE */
189 
190 /*     which are used to compare strings to a template.  In the character */
191 /*     case, the meanings of the parameters */
192 
193 /*        GE,  GT,  LE,  LT */
194 
195 /*     match those of the Fortran lexical functions */
196 
197 /*        LGE, LGT, LLE, LLT */
198 
199 
200 /*     The additional unary operators */
201 
202 /*        ISNULL, NOTNUL */
203 
204 /*     are used to test whether a value of any type is null. */
205 
206 
207 
208 /*     End Include Section:  EK Operator Codes */
209 
210 /* $ Disclaimer */
211 
212 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
213 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
214 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
215 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
216 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
217 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
218 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
219 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
220 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
221 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
222 
223 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
224 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
225 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
226 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
227 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
228 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
229 
230 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
231 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
232 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
233 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
234 
235 
236 /*     Include Section:  EK Data Types */
237 
238 /*        ektype.inc Version 1  27-DEC-1994 (NJB) */
239 
240 
241 /*     Within the EK system, data types of EK column contents are */
242 /*     represented by integer codes.  The codes and their meanings */
243 /*     are listed below. */
244 
245 /*     Integer codes are also used within the DAS system to indicate */
246 /*     data types; the EK system makes no assumptions about compatibility */
247 /*     between the codes used here and those used in the DAS system. */
248 
249 
250 /*     Character type: */
251 
252 
253 /*     Double precision type: */
254 
255 
256 /*     Integer type: */
257 
258 
259 /*     `Time' type: */
260 
261 /*     Within the EK system, time values are represented as ephemeris */
262 /*     seconds past J2000 (TDB), and double precision numbers are used */
263 /*     to store these values.  However, since time values require special */
264 /*     treatment both on input and output, and since the `TIME' column */
265 /*     has a special role in the EK specification and code, time values */
266 /*     are identified as a type distinct from double precision numbers. */
267 
268 
269 /*     End Include Section:  EK Data Types */
270 
271 /* $ Disclaimer */
272 
273 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
274 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
275 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
276 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
277 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
278 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
279 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
280 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
281 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
282 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
283 
284 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
285 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
286 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
287 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
288 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
289 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
290 
291 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
292 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
293 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
294 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
295 
296 
297 /*     Include Section:  EK Column Descriptor Parameters */
298 
299 /*        ekcoldsc.inc Version 6    23-AUG-1995 (NJB) */
300 
301 
302 /*     Note:  The column descriptor size parameter CDSCSZ  is */
303 /*     declared separately in the include section CDSIZE$INC.FOR. */
304 
305 /*     Offset of column descriptors, relative to start of segment */
306 /*     integer address range.  This number, when added to the last */
307 /*     integer address preceding the segment, yields the DAS integer */
308 /*     base address of the first column descriptor.  Currently, this */
309 /*     offset is exactly the size of a segment descriptor.  The */
310 /*     parameter SDSCSZ, which defines the size of a segment descriptor, */
311 /*     is declared in the include file eksegdsc.inc. */
312 
313 
314 /*     Size of column descriptor */
315 
316 
317 /*     Indices of various pieces of column descriptors: */
318 
319 
320 /*     CLSIDX is the index of the column's class code.  (We use the */
321 /*     word `class' to distinguish this item from the column's data */
322 /*     type.) */
323 
324 
325 /*     TYPIDX is the index of the column's data type code (CHR, INT, DP, */
326 /*     or TIME).  The type is actually implied by the class, but it */
327 /*     will frequently be convenient to look up the type directly. */
328 
329 
330 
331 /*     LENIDX is the index of the column's string length value, if the */
332 /*     column has character type.  A value of IFALSE in this element of */
333 /*     the descriptor indicates that the strings have variable length. */
334 
335 
336 /*     SIZIDX is the index of the column's element size value.  This */
337 /*     descriptor element is meaningful for columns with fixed-size */
338 /*     entries.  For variable-sized columns, this value is IFALSE. */
339 
340 
341 /*     NAMIDX is the index of the base address of the column's name. */
342 
343 
344 /*     IXTIDX is the data type of the column's index.  IXTIDX */
345 /*     contains a type value only if the column is indexed. For columns */
346 /*     that are not indexed, the location IXTIDX contains the boolean */
347 /*     value IFALSE. */
348 
349 
350 /*     IXPIDX is a pointer to the column's index.  IXTPDX contains a */
351 /*     meaningful value only if the column is indexed.  The */
352 /*     interpretation of the pointer depends on the data type of the */
353 /*     index. */
354 
355 
356 /*     NFLIDX is the index of a flag indicating whether nulls are */
357 /*     permitted in the column.  The value at location NFLIDX is */
358 /*     ITRUE if nulls are permitted and IFALSE otherwise. */
359 
360 
361 /*     ORDIDX is the index of the column's ordinal position in the */
362 /*     list of columns belonging to the column's parent segment. */
363 
364 
365 /*     METIDX is the index of the column's integer metadata pointer. */
366 /*     This pointer is a DAS integer address. */
367 
368 
369 /*     The last position in the column descriptor is reserved.  No */
370 /*     parameter is defined to point to this location. */
371 
372 
373 /*     End Include Section:  EK Column Descriptor Parameters */
374 
375 /* $ Disclaimer */
376 
377 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
378 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
379 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
380 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
381 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
382 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
383 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
384 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
385 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
386 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
387 
388 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
389 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
390 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
391 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
392 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
393 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
394 
395 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
396 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
397 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
398 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
399 
400 
401 /*     Include Section:  EK Segment Descriptor Parameters */
402 
403 /*        eksegdsc.inc  Version 8  06-NOV-1995 (NJB) */
404 
405 
406 /*     All `base addresses' referred to below are the addresses */
407 /*     *preceding* the item the base applies to.  This convention */
408 /*     enables simplied address calculations in many cases. */
409 
410 /*     Size of segment descriptor.  Note:  the include file ekcoldsc.inc */
411 /*     must be updated if this parameter is changed.  The parameter */
412 /*     CDOFF in that file should be kept equal to SDSCSZ. */
413 
414 
415 /*     Index of the segment type code: */
416 
417 
418 /*     Index of the segment's number.  This number is the segment's */
419 /*     index in the list of segments contained in the EK to which */
420 /*     the segment belongs. */
421 
422 
423 /*     Index of the DAS integer base address of the segment's integer */
424 /*     meta-data: */
425 
426 
427 /*     Index of the DAS character base address of the table name: */
428 
429 
430 /*     Index of the segment's column count: */
431 
432 
433 /*     Index of the segment's record count: */
434 
435 
436 /*     Index of the root page number of the record tree: */
437 
438 
439 /*     Index of the root page number of the character data page tree: */
440 
441 
442 /*     Index of the root page number of the double precision data page */
443 /*     tree: */
444 
445 
446 /*     Index of the root page number of the integer data page tree: */
447 
448 
449 /*     Index of the `modified' flag: */
450 
451 
452 /*     Index of the `initialized' flag: */
453 
454 
455 /*     Index of the shadowing flag: */
456 
457 
458 /*     Index of the companion file handle: */
459 
460 
461 /*     Index of the companion segment number: */
462 
463 
464 /*     The next three items are, respectively, the page numbers of the */
465 /*     last character, d.p., and integer data pages allocated by the */
466 /*     segment: */
467 
468 
469 /*     The next three items are, respectively, the page-relative */
470 /*     indices of the last DAS word in use in the segment's */
471 /*     last character, d.p., and integer data pages: */
472 
473 
474 /*     Index of the DAS character base address of the column name list: */
475 
476 
477 /*     The last descriptor element is reserved for future use.  No */
478 /*     parameter is defined to point to this location. */
479 
480 
481 /*     End Include Section:  EK Segment Descriptor Parameters */
482 
483 /* $ Disclaimer */
484 
485 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
486 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
487 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
488 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
489 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
490 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
491 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
492 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
493 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
494 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
495 
496 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
497 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
498 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
499 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
500 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
501 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
502 
503 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
504 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
505 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
506 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
507 
508 
509 /*     Include Section:  EK Template Matching Wild Characters */
510 
511 
512 /*        ekwild.inc  Version 1   16-JAN-1995 (NJB) */
513 
514 
515 /*     Within the EK system, templates used for pattern matching */
516 /*     are those accepted by the SPICELIB routine MATCHW.  MATCHW */
517 /*     accepts two special characters:  one representing wild */
518 /*     strings and one representing wild characters.  This include */
519 /*     file defines those special characters for use within the EK */
520 /*     system. */
521 
522 
523 /*     Wild string symbol:  this character matches any string. */
524 
525 
526 /*     Wild character symbol:  this character matches any character. */
527 
528 
529 /*     End Include Section:  EK Template Matching Wild Characters */
530 
531 /* $ Disclaimer */
532 
533 /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
534 /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
535 /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
536 /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
537 /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
538 /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
539 /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
540 /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
541 /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
542 /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
543 
544 /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
545 /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
546 /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
547 /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
548 /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
549 /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
550 
551 /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
552 /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
553 /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
554 /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
555 
556 
557 /*     Include Section:  EK Query Limit Parameters */
558 
559 /*        ekqlimit.inc  Version 3    16-NOV-1995 (NJB) */
560 
561 /*           Parameter MAXCON increased to 1000. */
562 
563 /*        ekqlimit.inc  Version 2    01-AUG-1995 (NJB) */
564 
565 /*           Updated to support SELECT clause. */
566 
567 
568 /*        ekqlimit.inc  Version 1    07-FEB-1995 (NJB) */
569 
570 
571 /*     These limits apply to character string queries input to the */
572 /*     EK scanner.  This limits are part of the EK system's user */
573 /*     interface:  the values should be advertised in the EK required */
574 /*     reading document. */
575 
576 
577 /*     Maximum length of an input query:  MAXQRY.  This value is */
578 /*     currently set to twenty-five 80-character lines. */
579 
580 
581 /*     Maximum number of columns that may be listed in the */
582 /*     `order-by clause' of a query:  MAXSEL.  MAXSEL = 50. */
583 
584 
585 /*     Maximum number of tables that may be listed in the `FROM */
586 /*     clause' of a query: MAXTAB. */
587 
588 
589 /*     Maximum number of relational expressions that may be listed */
590 /*     in the `constraint clause' of a query: MAXCON. */
591 
592 /*     This limit applies to a query when it is represented in */
593 /*     `normalized form': that is, the constraints have been */
594 /*     expressed as a disjunction of conjunctions of relational */
595 /*     expressions. The number of relational expressions in a query */
596 /*     that has been expanded in this fashion may be greater than */
597 /*     the number of relations in the query as orginally written. */
598 /*     For example, the expression */
599 
600 /*             ( ( A LT 1 ) OR ( B GT 2 ) ) */
601 /*        AND */
602 /*             ( ( C NE 3 ) OR ( D EQ 4 ) ) */
603 
604 /*     which contains 4 relational expressions, expands to the */
605 /*     equivalent normalized constraint */
606 
607 /*             (  ( A LT 1 ) AND ( C NE 3 )  ) */
608 /*        OR */
609 /*             (  ( A LT 1 ) AND ( D EQ 4 )  ) */
610 /*        OR */
611 /*             (  ( B GT 2 ) AND ( C NE 3 )  ) */
612 /*        OR */
613 /*             (  ( B GT 2 ) AND ( D EQ 4 )  ) */
614 
615 /*     which contains eight relational expressions. */
616 
617 
618 
619 /*     MXJOIN is the maximum number of tables that can be joined. */
620 
621 
622 /*     MXJCON is the maximum number of join constraints allowed. */
623 
624 
625 /*     Maximum number of order-by columns that may be used in the */
626 /*     `order-by clause' of a query: MAXORD. MAXORD = 10. */
627 
628 
629 /*     Maximum number of tokens in a query: 500. Tokens are reserved */
630 /*     words, column names, parentheses, and values. Literal strings */
631 /*     and time values count as single tokens. */
632 
633 
634 /*     Maximum number of numeric tokens in a query: */
635 
636 
637 /*     Maximum total length of character tokens in a query: */
638 
639 
640 /*     Maximum length of literal string values allowed in queries: */
641 /*     MAXSTR. */
642 
643 
644 /*     End Include Section:  EK Query Limit Parameters */
645 
646 /* $ Brief_I/O */
647 
648 /*     Variable  I/O  Description */
649 /*     --------  ---  -------------------------------------------------- */
650 /*     NCNSTR     I   Number of join constraints. */
651 /*     ACTIVE     I   Array of flags indicating applicable constraints. */
652 /*     LHANS      I   Handles of EKs for columns on LHS's of constraints. */
653 /*     LSDSCS     I   Descriptors of segments on LHS's of constraints. */
654 /*     LCDSCS     I   Column descriptors for LHS's of constraints. */
655 /*     LROWS      I   Row numbers for LHS's of constraints. */
656 /*     LCOLS      I   Column names for LHS's of constraints. */
657 /*     LELTS      I   Column element indices for LHS's of constraints. */
658 /*     OPS        I   Code for relational operator in constraints. */
659 /*     RHAN       I   Handles of EKs for columns on RHS's of constraints. */
660 /*     RSDSCS     I   Descriptors of segments on RHS's of constraints. */
661 /*     RCDSCS     I   Column descriptors for RHS's of constraints. */
662 /*     RROWS      I   Row numbers for RHS's of constraints. */
663 /*     RCOLS      I   Column names for RHS's of constraints. */
664 /*     RELTS      I   Column element indices for RHS's of constraints. */
665 
666 /*     The function returns .TRUE. if and only if all of the relational */
667 /*     constraints specified by the input arguments are satisfied. */
668 
669 /* $ Detailed_Input */
670 
671 /*     NCNSTR         is the number of input join constraints.   Each */
672 /*                    input constraint relates two EK column entries; */
673 /*                    abstractly, the form of the constraints is: */
674 
675 /*                       <col entry 1> <relational op> <col entry 2> */
676 
677 /*                    The compared entries are defined by handles, */
678 /*                    segment base addresses, column descriptors, and row */
679 /*                    numbers. */
680 
681 /*     ACTIVE         is an array of logical flags indicating which */
682 /*                    constraints are currently applicable.  The Nth */
683 /*                    element of ACTIVE indicates whether or not to apply */
684 /*                    the Nth constraint:  if ACTIVE(N) is .TRUE., the */
685 /*                    constraint is applicable, otherwise it isn't. */
686 
687 /*                    The elements of the other input arguments that */
688 /*                    define constraints are defined when the */
689 /*                    corresponding element of ACTIVE is .TRUE.  For */
690 /*                    example, when the second constraint is not active, */
691 /*                    the second column descriptor in LDSCRS may not be */
692 /*                    defined. */
693 
694 /*     LHANS          is an array of EK file handles for the left-hand- */
695 /*                    sides of the constraints. */
696 
697 /*     LSDSCS         is an array of segment descriptors for the */
698 /*                    left-hand-sides of the constraints. */
699 
700 /*     LDSCRS         is an array of column descriptors for the */
701 /*                    left-hand-sides of the constraints. */
702 
703 /*     LROWS          is an array of row numbers for the left-hand-sides */
704 /*                    of the constraints. */
705 
706 /*     LELTS          is an array of column entry element indices for the */
707 /*                    left-hand-sides of the constraints.  These */
708 /*                    indices are ignored unless the columns they apply */
709 /*                    to are array-valued. */
710 
711 /*     OPS            is an array of relational operators used in the */
712 /*                    input constraints.  The elements of OPS are any of */
713 /*                    the integer parameters */
714 
715 /*                       EQ, GE, GT, LE, LT, NE, LIKE, ISNULL, NOTNUL */
716 
717 /*                    The Ith element of OPS corresponds to the Ith */
718 /*                    constraint. */
719 
720 /*     RHANS          is an array of EK file handles for the right-hand- */
721 /*                    sides of the constraints. */
722 
723 /*     RSDSCS         is an array of segment descriptors for the */
724 /*                    right-hand-sides of the constraints. */
725 
726 /*     RDSCRS         is an array of column descriptors for the */
727 /*                    right-hand-sides of the constraints. */
728 
729 /*     RROWS          is an array of row numbers for the right-hand-sides */
730 /*                    of the constraints. */
731 
732 /*     RELTS          is an array of column entry element indices for the */
733 /*                    right-hand-sides of the constraints.  These */
734 /*                    indices are ignored unless the columns they apply */
735 /*                    to are array-valued. */
736 
737 
738 /* $ Detailed_Output */
739 
740 /*     The function returns .TRUE. if and only if all of the relational */
741 /*     constraints specified by the input arguments are satisfied. */
742 
743 /* $ Parameters */
744 
745 /*     Within the EK system, operators used in EK queries are */
746 /*     represented by integer codes.  The codes and their meanings are */
747 /*     listed below. */
748 
749 /*     Relational expressions in EK queries have the form */
750 
751 /*        <column name> <operator> <value> */
752 
753 /*     For columns containing numeric values, the operators */
754 
755 /*        EQ,  GE,  GT,  LE,  LT,  NE */
756 
757 /*     may be used; these operators have the same meanings as their */
758 /*     Fortran counterparts.  For columns containing character values, */
759 /*     the list of allowed operators includes those in the above list, */
760 /*     and in addition includes the operator */
761 
762 /*        LIKE */
763 
764 /*     which is used to compare strings to a template.  In the character */
765 /*     case, the meanings of the parameters */
766 
767 /*        GE,  GT,  LE,  LT */
768 
769 /*     match those of the Fortran lexical functions */
770 
771 /*        LGE, LGT, LLE, LLT */
772 
773 
774 /*     The additional unary operators */
775 
776 /*        ISNULL, NOTNUL */
777 
778 /*     are used to test whether a value of any type is null. */
779 
780 
781 /* $ Exceptions */
782 
783 /*     1)  If any of the input file handles is invalid, the error */
784 /*         will be diagnosed by routines called by this routine. */
785 /*         The function value is .FALSE. in this case. */
786 
787 /*     2)  If an I/O error occurs while attempting to find the address */
788 /*         range of a column entry element, the error will */
789 /*         be diagnosed by routines called by this routine.  The */
790 /*         function value is .FALSE. in this case. */
791 
792 /*     3)  If any of the input segment descriptors, column descriptors, */
793 /*         or row numbers are invalid, this routine may fail in */
794 /*         unpredictable, but possibly spectacular, ways.  Except */
795 /*         as described in this header section, no attempt is made to */
796 /*         handle these errors. */
797 
798 /*     4)  If the data type code in an input column descriptor is not */
799 /*         recognized, the error SPICE(INVALIDDATATYPE) is signaled. */
800 /*         The function value is .FALSE. in this case. */
801 
802 /*     5)  If a relational operator code is not recognized, the */
803 /*         error SPICE(UNNATURALRELATION) is signaled. */
804 /*         The function value is .FALSE. in this case. */
805 
806 /* $ Files */
807 
808 /*     See the descriptions of the arguments LHAN and RHAN in */
809 /*     $Detailed_Input. */
810 
811 /* $ Particulars */
812 
813 /*     This routine is an EK utility intended to centralize a frequently */
814 /*     performed comparison operation. */
815 
816 /* $ Examples */
817 
818 /*     See EKSRCH. */
819 
820 /* $ Restrictions */
821 
822 /*     1)  This routine must execute quickly.  Therefore, it checks in */
823 /*         only if it detects an error.  If an error is signaled by a */
824 /*         routine called by this routine, this routine will not appear */
825 /*         in the SPICELIB traceback display.  Also, in the interest */
826 /*         of speed, this routine does not test the value of the SPICELIB */
827 /*         function RETURN upon entry. */
828 
829 /*     2)  This routine depends on the requested comparison to have */
830 /*         been semantically checked. Semantically invalid comparisons */
831 /*         are treated as bugs. */
832 
833 /*     3)  Only the first MAXSTR characters of character strings are */
834 /*         used in comparisons. */
835 /* C */
836 /* $ Literature_References */
837 
838 /*     None. */
839 
840 /* $ Author_and_Institution */
841 
842 /*     N.J. Bachman   (JPL) */
843 
844 /* $ Version */
845 
846 /* -    SPICELIB Version 1.2.0, 05-FEB-2015 (NJB) */
847 
848 /*        Updated to use ERRHAN. */
849 
850 /* -    SPICELIB Version 1.1.0, 01-JUN-2010 (NJB) */
851 
852 /*        Bug fix: subscript out of range error caused by */
853 /*        column entry strings longer than MAXLEN has been */
854 /*        corrected. Also updated Restrictions header section. */
855 
856 /* -    Beta Version 1.0.0, 11-OCT-1995 (NJB) */
857 
858 /* -& */
859 
860 /*     SPICELIB functions */
861 
862 
863 /*     Non-SPICELIB functions */
864 
865 
866 /*     Local variables */
867 
868 
869 /*     Use discovery check-in for speed.  Don't check RETURN. */
870 
871 /*     The function value defaults to .TRUE.  As we test the constraints, */
872 /*     we may find one that the input row vector doesn't satisfy, at */
873 /*     which point we can terminate the comparison. */
874 
875     ret_val = TRUE_;
876     n = 1;
877     while(n <= *ncnstr && ret_val) {
878 	if (active[n - 1]) {
879 
880 /*           Apply the Nth join constraint to the input row vector. */
881 
882 /*           Compare the entries in the two rows in the columns indicated */
883 /*           by the Nth column descriptor pair.  To do this, find the */
884 /*           address ranges for each column entry.  We don't check the */
885 /*           found flag because every column entry has at least one */
886 /*           element. */
887 
888 
889 /*           We'll start out setting REL to EQ.  If we find out */
890 /*           otherwise, we'll change it. */
891 
892 	    hans[0] = lhans[n - 1];
893 	    hans[1] = rhans[n - 1];
894 	    movei_(&lsdscs[n * 24 - 24], &c__24, sgdscs);
895 	    movei_(&rsdscs[n * 24 - 24], &c__24, &sgdscs[24]);
896 	    rows[0] = lrows[n - 1];
897 	    rows[1] = rrows[n - 1];
898 	    elts[0] = lelts[n - 1];
899 	    elts[1] = relts[n - 1];
900 	    movei_(&lcdscs[n * 11 - 11], &c__11, cldscs);
901 	    movei_(&rcdscs[n * 11 - 11], &c__11, &cldscs[11]);
902 	    rel = zzekecmp_(hans, sgdscs, cldscs, rows, elts);
903 
904 /*           Determine the truth of the Nth input relational expression, */
905 /*           and set ZZEKVMCH accordingly. */
906 
907 	    if (ops[n - 1] == 1) {
908 		ret_val = rel == 1;
909 	    } else if (ops[n - 1] == 5) {
910 		ret_val = rel == 5;
911 	    } else if (ops[n - 1] == 4) {
912 		ret_val = rel != 3;
913 	    } else if (ops[n - 1] == 3) {
914 		ret_val = rel == 3;
915 	    } else if (ops[n - 1] == 2) {
916 		ret_val = rel != 5;
917 	    } else if (ops[n - 1] == 6) {
918 		ret_val = rel != 1;
919 	    } else if (ops[n - 1] == 7 && cldscs[1] == 1) {
920 		for (i__ = 1; i__ <= 2; ++i__) {
921 		    zzekrsc_(&hans[(i__1 = i__ - 1) < 2 && 0 <= i__1 ? i__1 :
922 			    s_rnge("hans", i__1, "zzekvmch_", (ftnlen)402)], &
923 			    sgdscs[(i__2 = i__ * 24 - 24) < 48 && 0 <= i__2 ?
924 			    i__2 : s_rnge("sgdscs", i__2, "zzekvmch_", (
925 			    ftnlen)402)], &cldscs[(i__3 = i__ * 11 - 11) < 22
926 			    && 0 <= i__3 ? i__3 : s_rnge("cldscs", i__3,
927 			    "zzekvmch_", (ftnlen)402)], &rows[(i__4 = i__ - 1)
928 			     < 2 && 0 <= i__4 ? i__4 : s_rnge("rows", i__4,
929 			    "zzekvmch_", (ftnlen)402)], &elts[(i__5 = i__ - 1)
930 			     < 2 && 0 <= i__5 ? i__5 : s_rnge("elts", i__5,
931 			    "zzekvmch_", (ftnlen)402)], &cvlen[(i__6 = i__ -
932 			    1) < 2 && 0 <= i__6 ? i__6 : s_rnge("cvlen", i__6,
933 			     "zzekvmch_", (ftnlen)402)], cval + (((i__7 = i__
934 			    - 1) < 2 && 0 <= i__7 ? i__7 : s_rnge("cval",
935 			    i__7, "zzekvmch_", (ftnlen)402)) << 10), &null[(
936 			    i__8 = i__ - 1) < 2 && 0 <= i__8 ? i__8 : s_rnge(
937 			    "null", i__8, "zzekvmch_", (ftnlen)402)], &found,
938 			    (ftnlen)1024);
939 		    if (! found) {
940 			chkin_("ZZEKVMCH", (ftnlen)8);
941 			setmsg_("EK = #; COLIDX = #; ROW = #; ELTIDX  = #.  "
942 				"Column entry  element was not found.", (
943 				ftnlen)79);
944 			errhan_("#", &hans[(i__1 = i__ - 1) < 2 && 0 <= i__1 ?
945 				 i__1 : s_rnge("hans", i__1, "zzekvmch_", (
946 				ftnlen)419)], (ftnlen)1);
947 			errint_("#", &cldscs[(i__1 = i__ * 11 - 3) < 22 && 0
948 				<= i__1 ? i__1 : s_rnge("cldscs", i__1, "zze"
949 				"kvmch_", (ftnlen)420)], (ftnlen)1);
950 			errint_("#", &rows[(i__1 = i__ - 1) < 2 && 0 <= i__1 ?
951 				 i__1 : s_rnge("rows", i__1, "zzekvmch_", (
952 				ftnlen)421)], (ftnlen)1);
953 			errint_("#", &elts[(i__1 = i__ - 1) < 2 && 0 <= i__1 ?
954 				 i__1 : s_rnge("elts", i__1, "zzekvmch_", (
955 				ftnlen)422)], (ftnlen)1);
956 			sigerr_("SPICE(INVALIDINDEX)", (ftnlen)19);
957 			chkout_("ZZEKVMCH", (ftnlen)8);
958 			return ret_val;
959 		    }
960 		    if (found && ! null[(i__1 = i__ - 1) < 2 && 0 <= i__1 ?
961 			    i__1 : s_rnge("null", i__1, "zzekvmch_", (ftnlen)
962 			    429)]) {
963 /* Computing MIN */
964 			i__3 = cvlen[(i__2 = i__ - 1) < 2 && 0 <= i__2 ? i__2
965 				: s_rnge("cvlen", i__2, "zzekvmch_", (ftnlen)
966 				431)];
967 			cmplen[(i__1 = i__ - 1) < 2 && 0 <= i__1 ? i__1 :
968 				s_rnge("cmplen", i__1, "zzekvmch_", (ftnlen)
969 				431)] = min(i__3,1024);
970 		    } else {
971 			cmplen[(i__1 = i__ - 1) < 2 && 0 <= i__1 ? i__1 :
972 				s_rnge("cmplen", i__1, "zzekvmch_", (ftnlen)
973 				433)] = 0;
974 		    }
975 		}
976 		ret_val = matchi_(cval, cval + 1024, "*", "%", cmplen[0],
977 			cmplen[1], (ftnlen)1, (ftnlen)1);
978 	    } else if (ops[n - 1] == 8 && cldscs[1] == 1) {
979 		for (i__ = 1; i__ <= 2; ++i__) {
980 		    zzekrsc_(&hans[(i__1 = i__ - 1) < 2 && 0 <= i__1 ? i__1 :
981 			    s_rnge("hans", i__1, "zzekvmch_", (ftnlen)451)], &
982 			    sgdscs[(i__2 = i__ * 24 - 24) < 48 && 0 <= i__2 ?
983 			    i__2 : s_rnge("sgdscs", i__2, "zzekvmch_", (
984 			    ftnlen)451)], &cldscs[(i__3 = i__ * 11 - 11) < 22
985 			    && 0 <= i__3 ? i__3 : s_rnge("cldscs", i__3,
986 			    "zzekvmch_", (ftnlen)451)], &rows[(i__4 = i__ - 1)
987 			     < 2 && 0 <= i__4 ? i__4 : s_rnge("rows", i__4,
988 			    "zzekvmch_", (ftnlen)451)], &elts[(i__5 = i__ - 1)
989 			     < 2 && 0 <= i__5 ? i__5 : s_rnge("elts", i__5,
990 			    "zzekvmch_", (ftnlen)451)], &cvlen[(i__6 = i__ -
991 			    1) < 2 && 0 <= i__6 ? i__6 : s_rnge("cvlen", i__6,
992 			     "zzekvmch_", (ftnlen)451)], cval + (((i__7 = i__
993 			    - 1) < 2 && 0 <= i__7 ? i__7 : s_rnge("cval",
994 			    i__7, "zzekvmch_", (ftnlen)451)) << 10), &null[(
995 			    i__8 = i__ - 1) < 2 && 0 <= i__8 ? i__8 : s_rnge(
996 			    "null", i__8, "zzekvmch_", (ftnlen)451)], &found,
997 			    (ftnlen)1024);
998 		    if (! found) {
999 			chkin_("ZZEKVMCH", (ftnlen)8);
1000 			setmsg_("EK = #; COLIDX = #; ROW = #; ELTIDX  = #.  "
1001 				"Column entry  element was not found.", (
1002 				ftnlen)79);
1003 			errhan_("#", &hans[(i__1 = i__ - 1) < 2 && 0 <= i__1 ?
1004 				 i__1 : s_rnge("hans", i__1, "zzekvmch_", (
1005 				ftnlen)468)], (ftnlen)1);
1006 			errint_("#", &cldscs[(i__1 = i__ * 11 - 3) < 22 && 0
1007 				<= i__1 ? i__1 : s_rnge("cldscs", i__1, "zze"
1008 				"kvmch_", (ftnlen)469)], (ftnlen)1);
1009 			errint_("#", &rows[(i__1 = i__ - 1) < 2 && 0 <= i__1 ?
1010 				 i__1 : s_rnge("rows", i__1, "zzekvmch_", (
1011 				ftnlen)470)], (ftnlen)1);
1012 			errint_("#", &elts[(i__1 = i__ - 1) < 2 && 0 <= i__1 ?
1013 				 i__1 : s_rnge("elts", i__1, "zzekvmch_", (
1014 				ftnlen)471)], (ftnlen)1);
1015 			sigerr_("SPICE(INVALIDINDEX)", (ftnlen)19);
1016 			chkout_("ZZEKVMCH", (ftnlen)8);
1017 			return ret_val;
1018 		    }
1019 		    if (found && ! null[(i__1 = i__ - 1) < 2 && 0 <= i__1 ?
1020 			    i__1 : s_rnge("null", i__1, "zzekvmch_", (ftnlen)
1021 			    479)]) {
1022 /* Computing MIN */
1023 			i__3 = cvlen[(i__2 = i__ - 1) < 2 && 0 <= i__2 ? i__2
1024 				: s_rnge("cvlen", i__2, "zzekvmch_", (ftnlen)
1025 				481)];
1026 			cmplen[(i__1 = i__ - 1) < 2 && 0 <= i__1 ? i__1 :
1027 				s_rnge("cmplen", i__1, "zzekvmch_", (ftnlen)
1028 				481)] = min(i__3,1024);
1029 		    } else {
1030 			cmplen[(i__1 = i__ - 1) < 2 && 0 <= i__1 ? i__1 :
1031 				s_rnge("cmplen", i__1, "zzekvmch_", (ftnlen)
1032 				483)] = 0;
1033 		    }
1034 		}
1035 		ret_val = ! matchi_(cval, cval + 1024, "*", "%", cmplen[0],
1036 			cmplen[1], (ftnlen)1, (ftnlen)1);
1037 	    } else {
1038 
1039 /*              Sorry, we couldn't resist. */
1040 
1041 		ret_val = FALSE_;
1042 		chkin_("ZZEKVMCH", (ftnlen)8);
1043 		setmsg_("The relational operator # was not recognized.", (
1044 			ftnlen)45);
1045 		errint_("#", &ops[n - 1], (ftnlen)1);
1046 		sigerr_("SPICE(UNNATURALRELATION)", (ftnlen)24);
1047 		chkout_("ZZEKVMCH", (ftnlen)8);
1048 		return ret_val;
1049 	    }
1050 	}
1051 
1052 /*        We've completed the test for the Nth constraint, if that */
1053 /*        constraint was active. */
1054 
1055 	++n;
1056     }
1057     return ret_val;
1058 } /* zzekvmch_ */
1059 
1060