4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 %#pragma ident "%Z%%M% %I% %E% SMI"
36 %/* db_query is the structure that contains the components of a query.
37 % It contains the values for searching the indices. */
41 %#include "db_item_c.h"
42 %#include "db_entry_c.h"
43 %#include "db_scheme_c.h"
46 %#include "db_entry.h"
47 %#include "db_scheme.h"
51 %/* A component of a query */
53 int which_index; /* identifies which index is being used */
54 item* index_value; /* value to be used in search */
57 #if RPC_HDR || RPC_XDR
60 db_qcomp components<>;
71 % db_qcomp* components;
73 %/* Accessor: returns number of components */
74 % int size() { return num_components; }
76 %/* Accessor: returns location of start of query */
77 % db_qcomp* queryloc() { return components; }
80 %/* Null constructor: returns empty empty query. */
81 % db_query() { num_components = 0; components = NULL; }
83 %/* Returns a db_query containing the index values as obtained from
85 % db_query( db_scheme*, int, nis_attr* );
87 %/* Returns a newly db_query containing the index values as
88 % obtained from the given object. The object itself,
89 % along with information on the scheme given, will determine
90 % which values are extracted from the object and placed into the query.
91 % Returns an empty query if 'obj' is not a valid entry.
92 % Note that space is allocated for the query and the index values
93 % (i.e. do not share pointers with strings in 'obj'.)
95 % db_query( db_scheme*, entry_object_p );
97 % /* destructor (frees all components) */
100 % /* clear component structure */
101 % void clear_components( int );
103 %/* Print all components of this query to stdout. */
106 %typedef class db_query * db_query_p;
111 %#endif /* _DB_QUERY_H */