text: /* zzekrmch.f -- translated by f2c (version 19980913).
     You must link the resulting object file with the libraries:
  	-lf2c -lm   (in that order)
  */
  
  #include "f2c.h"
  
  /* Table of constant values */
  
  static logical c_false = FALSE_;
  
  /* $Procedure      ZZEKRMCH ( EK, row match ) */
  logical zzekrmch_(integer *ncnstr, logical *active, integer *handle, integer *
  	segdsc, integer *cdscrs, integer *row, integer *elts, integer *ops, 
  	integer *vtypes, char *chrbuf, integer *cbegs, integer *cends, 
  	doublereal *dvals, integer *ivals, ftnlen chrbuf_len)
  {
      /* System generated locals */
      integer i__1;
      logical ret_val;
  
      /* Local variables */
      extern logical zzekscmp_(integer *, integer *, integer *, integer *, 
  	    integer *, integer *, integer *, char *, doublereal *, integer *, 
  	    logical *, ftnlen);
      integer i__;
  
  /* $ Abstract */
  
  /*     Determine whether a specified row in an EK file satisfies */
  /*     a specified set of constraints. */
  
  /* $ Disclaimer */
  
  /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
  /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
  /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
  /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
  /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
  /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
  /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
  /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
  /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
  /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
  
  /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
  /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
  /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
  /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
  /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
  /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
  
  /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
  /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
  /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
  /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
  
  /* $ Required_Reading */
  
  /*     EK */
  
  /* $ Keywords */
  
  /*     EK */
  /*     PRIVATE */
  
  /* $ Declarations */
  /* $ Disclaimer */
  
  /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
  /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
  /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
  /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
  /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
  /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
  /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
  /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
  /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
  /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
  
  /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
  /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
  /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
  /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
  /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
  /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
  
  /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
  /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
  /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
  /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
  
  
  /*     Include Section:  EK Column Name Size */
  
  /*        ekcnamsz.inc Version 1    17-JAN-1995 (NJB) */
  
  
  /*     Size of column name, in characters. */
  
  
  /*     End Include Section:  EK Column Name Size */
  
  /* $ Disclaimer */
  
  /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
  /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
  /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
  /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
  /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
  /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
  /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
  /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
  /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
  /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
  
  /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
  /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
  /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
  /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
  /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
  /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
  
  /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
  /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
  /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
  /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
  
  
  /*     Include Section:  EK Column Descriptor Parameters */
  
  /*        ekcoldsc.inc Version 6    23-AUG-1995 (NJB) */
  
  
  /*     Note:  The column descriptor size parameter CDSCSZ  is */
  /*     declared separately in the include section CDSIZE$INC.FOR. */
  
  /*     Offset of column descriptors, relative to start of segment */
  /*     integer address range.  This number, when added to the last */
  /*     integer address preceding the segment, yields the DAS integer */
  /*     base address of the first column descriptor.  Currently, this */
  /*     offset is exactly the size of a segment descriptor.  The */
  /*     parameter SDSCSZ, which defines the size of a segment descriptor, */
  /*     is declared in the include file eksegdsc.inc. */
  
  
  /*     Size of column descriptor */
  
  
  /*     Indices of various pieces of column descriptors: */
  
  
  /*     CLSIDX is the index of the column's class code.  (We use the */
  /*     word `class' to distinguish this item from the column's data */
  /*     type.) */
  
  
  /*     TYPIDX is the index of the column's data type code (CHR, INT, DP, */
  /*     or TIME).  The type is actually implied by the class, but it */
  /*     will frequently be convenient to look up the type directly. */
  
  
  
  /*     LENIDX is the index of the column's string length value, if the */
  /*     column has character type.  A value of IFALSE in this element of */
  /*     the descriptor indicates that the strings have variable length. */
  
  
  /*     SIZIDX is the index of the column's element size value.  This */
  /*     descriptor element is meaningful for columns with fixed-size */
  /*     entries.  For variable-sized columns, this value is IFALSE. */
  
  
  /*     NAMIDX is the index of the base address of the column's name. */
  
  
  /*     IXTIDX is the data type of the column's index.  IXTIDX */
  /*     contains a type value only if the column is indexed. For columns */
  /*     that are not indexed, the location IXTIDX contains the boolean */
  /*     value IFALSE. */
  
  
  /*     IXPIDX is a pointer to the column's index.  IXTPDX contains a */
  /*     meaningful value only if the column is indexed.  The */
  /*     interpretation of the pointer depends on the data type of the */
  /*     index. */
  
  
  /*     NFLIDX is the index of a flag indicating whether nulls are */
  /*     permitted in the column.  The value at location NFLIDX is */
  /*     ITRUE if nulls are permitted and IFALSE otherwise. */
  
  
  /*     ORDIDX is the index of the column's ordinal position in the */
  /*     list of columns belonging to the column's parent segment. */
  
  
  /*     METIDX is the index of the column's integer metadata pointer. */
  /*     This pointer is a DAS integer address. */
  
  
  /*     The last position in the column descriptor is reserved.  No */
  /*     parameter is defined to point to this location. */
  
  
  /*     End Include Section:  EK Column Descriptor Parameters */
  
  /* $ Disclaimer */
  
  /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
  /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
  /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
  /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
  /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
  /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
  /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
  /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
  /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
  /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
  
  /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
  /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
  /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
  /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
  /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
  /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
  
  /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
  /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
  /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
  /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
  
  
  /*     Include Section:  EK Data Types */
  
  /*        ektype.inc Version 1  27-DEC-1994 (NJB) */
  
  
  /*     Within the EK system, data types of EK column contents are */
  /*     represented by integer codes.  The codes and their meanings */
  /*     are listed below. */
  
  /*     Integer codes are also used within the DAS system to indicate */
  /*     data types; the EK system makes no assumptions about compatibility */
  /*     between the codes used here and those used in the DAS system. */
  
  
  /*     Character type: */
  
  
  /*     Double precision type: */
  
  
  /*     Integer type: */
  
  
  /*     `Time' type: */
  
  /*     Within the EK system, time values are represented as ephemeris */
  /*     seconds past J2000 (TDB), and double precision numbers are used */
  /*     to store these values.  However, since time values require special */
  /*     treatment both on input and output, and since the `TIME' column */
  /*     has a special role in the EK specification and code, time values */
  /*     are identified as a type distinct from double precision numbers. */
  
  
  /*     End Include Section:  EK Data Types */
  
  /* $ Disclaimer */
  
  /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
  /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
  /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
  /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
  /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
  /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
  /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
  /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
  /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
  /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
  
  /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
  /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
  /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
  /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
  /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
  /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
  
  /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
  /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
  /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
  /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
  
  
  /*     Include Section:  EK Operator Codes */
  
  /*        ekopcd.inc  Version 1  30-DEC-1994 (NJB) */
  
  
  /*     Within the EK system, operators used in EK queries are */
  /*     represented by integer codes.  The codes and their meanings are */
  /*     listed below. */
  
  /*     Relational expressions in EK queries have the form */
  
  /*        <column name> <operator> <value> */
  
  /*     For columns containing numeric values, the operators */
  
  /*        EQ,  GE,  GT,  LE,  LT,  NE */
  
  /*     may be used; these operators have the same meanings as their */
  /*     Fortran counterparts.  For columns containing character values, */
  /*     the list of allowed operators includes those in the above list, */
  /*     and in addition includes the operators */
  
  /*        LIKE,  UNLIKE */
  
  /*     which are used to compare strings to a template.  In the character */
  /*     case, the meanings of the parameters */
  
  /*        GE,  GT,  LE,  LT */
  
  /*     match those of the Fortran lexical functions */
  
  /*        LGE, LGT, LLE, LLT */
  
  
  /*     The additional unary operators */
  
  /*        ISNULL, NOTNUL */
  
  /*     are used to test whether a value of any type is null. */
  
  
  
  /*     End Include Section:  EK Operator Codes */
  
  /* $ Disclaimer */
  
  /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
  /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
  /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
  /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
  /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
  /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
  /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
  /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
  /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
  /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
  
  /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
  /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
  /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
  /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
  /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
  /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
  
  /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
  /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
  /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
  /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
  
  
  /*     Include Section:  EK Template Matching Wild Characters */
  
  
  /*        ekwild.inc  Version 1   16-JAN-1995 (NJB) */
  
  
  /*     Within the EK system, templates used for pattern matching */
  /*     are those accepted by the SPICELIB routine MATCHW.  MATCHW */
  /*     accepts two special characters:  one representing wild */
  /*     strings and one representing wild characters.  This include */
  /*     file defines those special characters for use within the EK */
  /*     system. */
  
  
  /*     Wild string symbol:  this character matches any string. */
  
  
  /*     Wild character symbol:  this character matches any character. */
  
  
  /*     End Include Section:  EK Template Matching Wild Characters */
  
  /* $ Disclaimer */
  
  /*     THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE */
  /*     CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. */
  /*     GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE */
  /*     ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE */
  /*     PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" */
  /*     TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY */
  /*     WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A */
  /*     PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC */
  /*     SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE */
  /*     SOFTWARE AND RELATED MATERIALS, HOWEVER USED. */
  
  /*     IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA */
  /*     BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT */
  /*     LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, */
  /*     INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, */
  /*     REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE */
  /*     REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. */
  
  /*     RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF */
  /*     THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY */
  /*     CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE */
  /*     ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. */
  
  
  /*     Include Section:  EK Query Limit Parameters */
  
  /*        ekqlimit.inc  Version 3    16-NOV-1995 (NJB) */
  
  /*           Parameter MAXCON increased to 1000. */
  
  /*        ekqlimit.inc  Version 2    01-AUG-1995 (NJB) */
  
  /*           Updated to support SELECT clause. */
  
  
  /*        ekqlimit.inc  Version 1    07-FEB-1995 (NJB) */
  
  
  /*     These limits apply to character string queries input to the */
  /*     EK scanner.  This limits are part of the EK system's user */
  /*     interface:  the values should be advertised in the EK required */
  /*     reading document. */
  
  
  /*     Maximum length of an input query:  MAXQRY.  This value is */
  /*     currently set to twenty-five 80-character lines. */
  
  
  /*     Maximum number of columns that may be listed in the */
  /*     `order-by clause' of a query:  MAXSEL.  MAXSEL = 50. */
  
  
  /*     Maximum number of tables that may be listed in the `FROM */
  /*     clause' of a query: MAXTAB. */
  
  
  /*     Maximum number of relational expressions that may be listed */
  /*     in the `constraint clause' of a query: MAXCON. */
  
  /*     This limit applies to a query when it is represented in */
  /*     `normalized form': that is, the constraints have been */
  /*     expressed as a disjunction of conjunctions of relational */
  /*     expressions. The number of relational expressions in a query */
  /*     that has been expanded in this fashion may be greater than */
  /*     the number of relations in the query as orginally written. */
  /*     For example, the expression */
  
  /*             ( ( A LT 1 ) OR ( B GT 2 ) ) */
  /*        AND */
  /*             ( ( C NE 3 ) OR ( D EQ 4 ) ) */
  
  /*     which contains 4 relational expressions, expands to the */
  /*     equivalent normalized constraint */
  
  /*             (  ( A LT 1 ) AND ( C NE 3 )  ) */
  /*        OR */
  /*             (  ( A LT 1 ) AND ( D EQ 4 )  ) */
  /*        OR */
  /*             (  ( B GT 2 ) AND ( C NE 3 )  ) */
  /*        OR */
  /*             (  ( B GT 2 ) AND ( D EQ 4 )  ) */
  
  /*     which contains eight relational expressions. */
  
  
  
  /*     MXJOIN is the maximum number of tables that can be joined. */
  
  
  /*     MXJCON is the maximum number of join constraints allowed. */
  
  
  /*     Maximum number of order-by columns that may be used in the */
  /*     `order-by clause' of a query: MAXORD. MAXORD = 10. */
  
  
  /*     Maximum number of tokens in a query: 500. Tokens are reserved */
  /*     words, column names, parentheses, and values. Literal strings */
  /*     and time values count as single tokens. */
  
  
  /*     Maximum number of numeric tokens in a query: */
  
  
  /*     Maximum total length of character tokens in a query: */
  
  
  /*     Maximum length of literal string values allowed in queries: */
  /*     MAXSTR. */
  
  
  /*     End Include Section:  EK Query Limit Parameters */
  
  /* $ Brief_I/O */
  
  /*     Variable  I/O  Description */
  /*     --------  ---  -------------------------------------------------- */
  /*     NCNSTR     I   Number of constraints present in query. */
  /*     ACTIVE     I   Array of flags indicating applicable constraints. */
  /*     HANDLE     I   Handle of EK file containing row. */
  /*     SEGDSC     I   Segment descriptor. */
  /*     CDSCRS     I   Descriptors of columns referenced in query. */
  /*     ROW        I   Index of row to match. */
  /*     ELTS       I   Indices of column entry elements to match. */
  /*     OPS        I   Operators used in query constraints. */
  /*     VTYPES     I   Data types of values on RHS of constraints. */
  /*     CHRBUF     I   Buffer containting query tokens. */
  /*     CBEGS      I   Begin indices of character query tokens. */
  /*     CENDS      I   End indices of character query tokens. */
  /*     DVALS      I   D.p. values used in query constraints. */
  /*     IVALS      I   Integer values used in query constraints. */
  /*     MAXCOL     P   Maximum number of columns per segment. */
  
  /*     The function returns .TRUE. if and only if the specified */
  /*     EK row satisfies the input constraints. */
  
  /* $ Detailed_Input */
  
  /*     NCNSTR         is the number of input constraints against which */
  /*                    the input row is to be compared. */
  
  /*     ACTIVE         is an array of logical flags indicating which */
  /*                    constraints are currently applicable.  The Nth */
  /*                    element of ACTIVE indicates whether or not to apply */
  /*                    the Nth constraint:  if ACTIVE(N) is .TRUE., the */
  /*                    constraint is applicable, otherwise it isn't. */
  
  /*                    The elements of the other input arguments that */
  /*                    define constraints are defined when the */
  /*                    corresponding element of ACTIVE is .TRUE.  For */
  /*                    example, when the second constraint is not active, */
  /*                    the second column descriptor in LDSCRS may not be */
  /*                    defined. */
  
  /*     HANDLE         is an EK file handle.  The file may be open for */
  /*                    reading or writing. */
  
  /*     SEGDSC         is the descriptor of the EK segment containing the */
  /*                    column entry to be compared. */
  
  /*     CDSCRS         is an array of column descriptors for the columns */
  /*                    referenced in the input constraints.  The Ith */
  /*                    descriptor corresponds to the Ith constraint. */
  
  /*     ROW            is the index of the row to compare against the */
  /*                    input constraints. */
  
  /*     ELTS           is an array of column entry elements to match. */
  
  
  /*     OPS            are relational operators used in the input */
  /*                    constraints.  The elements of OPS are any of the */
  /*                    integer parameters */
  
  /*                       EQ, GE, GT, LE, LT, NE, LIKE, ISNULL, NOTNUL */
  
  /*                    The Ith element of OPS corresponds to the Ith */
  /*                    constraint. */
  
  /*     VTYPES         is an array of data type codes which indicate the */
  /*                    types of the values on the right hand sides of the */
  /*                    input constraints.  The Ith element of VTYPES */
  /*                    applies to the Ith constraint. */
  
  /*     CHRBUF, */
  /*     CBEGS, */
  /*     CENDS          are, respectively, a string containing character */
  /*                    tokens representing values on the right hand sides */
  /*                    of query constraints, and arrays of begin and end */
  /*                    indices of these tokens within CHRBUF.  If the Nth */
  /*                    constraint has a character value on the right hand */
  /*                    side, that value is CHRBUF( CBEGS(N) : CENDS(N) ). */
  /*                    For constraints whose right hand sides do not */
  /*                    specify character values, the corresponding */
  /*                    elements of CBEGS and CENDS are not used. */
  
  /*     DVALS, */
  /*     IVALS          are, respectively, arrays of double precision and */
  /*                    integer values appearing on the right hand sides of */
  /*                    input constraints.  The contents of DVALS and IVALS */
  /*                    are meaningful only for those constraints whose */
  /*                    right hand sides specify values having these data */
  /*                    types. */
  
  /*                    Constraints involving unary operators can be either */
  
  /*                       COLUMN_ENTRY(I)  ISNULL */
  /*                       COLUMN_ENTRY(I)  NOTNUL */
  
  /*                    For constraints of this form, the corresponding */
  /*                    elements of the value arrays are ignored. */
  
  /* $ Detailed_Output */
  
  /*     The function returns .TRUE. if and only if the specified */
  /*     EK row satisfies the input constraints. */
  
  /* $ Parameters */
  
  /*     Within the EK system, operators used in EK queries are */
  /*     represented by integer codes.  The codes and their meanings are */
  /*     listed below. */
  
  /*     Relational expressions in EK queries have the form */
  
  /*        <column name> <operator> <value> */
  
  /*     For columns containing numeric values, the operators */
  
  /*        EQ,  GE,  GT,  LE,  LT,  NE */
  
  /*     may be used; these operators have the same meanings as their */
  /*     Fortran counterparts.  For columns containing character values, */
  /*     the list of allowed operators includes those in the above list, */
  /*     and in addition includes the operator */
  
  /*        LIKE */
  
  /*     which is used to compare strings to a template.  In the character */
  /*     case, the meanings of the parameters */
  
  /*        GE,  GT,  LE,  LT */
  
  /*     match those of the Fortran lexical functions */
  
  /*        LGE, LGT, LLE, LLT */
  
  
  /*     The additional unary operators */
  
  /*        ISNULL, NOTNUL */
  
  /*     are used to test whether a value of any type is null. */
  
  /* $ Exceptions */
  
  /*     1)  If an error is detected, the function will return the value */
  /*         .FALSE. */
  
  /* $ Files */
  
  /*     None. */
  
  /* $ Particulars */
  
  /*     This routine is a utility intended primarily for use by EKSRCH. */
  
  /* $ Examples */
  
  /*     See EKSRCH. */
  
  /* $ Restrictions */
  
  /*     1)  Constraints must apply to scalar columns only. */
  
  /* $ Literature_References */
  
  /*     None. */
  
  /* $ Author_and_Institution */
  
  /*     N.J. Bachman   (JPL) */
  
  /* $ Version */
  
  /* -    Beta Version 1.0.0, 17-OCT-1995 (NJB) */
  
  
  /* -& */
  
  /*     Non-SPICELIB functions */
  
  
  /*     Local variables */
  
  
  /*     Use discovery check-in. */
  
  /*     For each active constraint in the list, see whether the specified */
  /*     row satisfies the constraint.  If any constraint is not satisfied, */
  /*     return immediately. */
  
      i__ = 1;
      ret_val = TRUE_;
      while(i__ <= *ncnstr && ret_val) {
  	if (active[i__ - 1]) {
  
  /*           See whether the row satisfies the Ith constraint. */
  
  	    i__1 = cbegs[i__ - 1] - 1;
  	    ret_val = zzekscmp_(&ops[i__ - 1], handle, segdsc, &cdscrs[i__ * 
  		    11 - 11], row, &elts[i__ - 1], &vtypes[i__ - 1], chrbuf + 
  		    i__1, &dvals[i__ - 1], &ivals[i__ - 1], &c_false, cends[
  		    i__ - 1] - i__1);
  	}
  
  /*        Take a look at the next constraint. */
  
  	++i__;
      }
  
  /*     It's a match if we got this far. */
  
      return ret_val;
  } /* zzekrmch_ */
  
  