1 /* 2 * Please do not edit this file. 3 * It was generated using rpcgen. 4 */ 5 6 #ifndef _DB_QUERY_H_RPCGEN 7 #define _DB_QUERY_H_RPCGEN 8 9 #include <rpc/rpc.h> 10 #pragma ident "%Z%%M% %I% %E% SMI" 11 #ifndef _DB_QUERY_H 12 #define _DB_QUERY_H 13 14 /* db_query is the structure that contains the components of a query. 15 It contains the values for searching the indices. */ 16 17 #include "db_item.h" 18 #include "db_entry.h" 19 #include "db_scheme.h" 20 /* A component of a query */ 21 22 struct db_qcomp { 23 int which_index; 24 item *index_value; 25 }; 26 typedef struct db_qcomp db_qcomp; 27 28 class db_query { 29 protected: 30 int num_components; 31 db_qcomp* components; 32 public: 33 /* Accessor: returns number of components */ 34 int size() { return num_components; } 35 36 /* Accessor: returns location of start of query */ 37 db_qcomp* queryloc() { return components; } 38 39 40 /* Null constructor: returns empty empty query. */ 41 db_query() { num_components = 0; components = NULL; } 42 43 /* Returns a db_query containing the index values as obtained from 44 'attrlist.' */ 45 db_query( db_scheme*, int, nis_attr* ); 46 47 /* Returns a newly db_query containing the index values as 48 obtained from the given object. The object itself, 49 along with information on the scheme given, will determine 50 which values are extracted from the object and placed into the query. 51 Returns an empty query if 'obj' is not a valid entry. 52 Note that space is allocated for the query and the index values 53 (i.e. do not share pointers with strings in 'obj'.) 54 */ 55 db_query( db_scheme*, entry_object_p ); 56 57 /* destructor (frees all components) */ 58 ~db_query(); 59 60 /* clear component structure */ 61 void clear_components( int ); 62 63 /* Print all components of this query to stdout. */ 64 void print(); 65 }; 66 typedef class db_query * db_query_p; 67 #endif /* _DB_QUERY_H */ 68 69 /* the xdr functions */ 70 extern bool_t xdr_db_qcomp(); 71 72 #endif /* !_DB_QUERY_H_RPCGEN */ 73