2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A%
// db_index * indices; /* indices[num_indices] */ 2N/A%
/* Return a list of index_entries that satsify the given query 'q'. 2N/A% Return the size of the list in 'count'. Return NULL if list is empty. 2N/A% Return in 'valid' FALSE if query is not well formed. */ 2N/A%
/* Returns a newly db_query containing the index values as 2N/A% obtained from the given object. The object itself, 2N/A% along with information on the scheme given, will determine 2N/A% which values are extracted from the object and placed into the query. 2N/A% Returns an empty query if 'obj' is not a valid entry. 2N/A% Note that space is allocated for the query and the index values 2N/A% (i.e. do not share pointers with strings in 'obj'.) */ 2N/A%
/* Returns a newly created db_query structure containing the index values 2N/A% as obtained from the record named by 'recnum'. The record itself, along 2N/A% with information on the schema definition of this table, will determine 2N/A% which values are extracted from the record and placed into the result. 2N/A% Returns NULL if recnum is not a valid entry. 2N/A% Note that space is allocated for the query and the index values 2N/A% (i.e. do not share pointers with strings in 'obj'.) */ 2N/A%
/* Returns an array of size 'count' of 'entry_object_p's, pointing to 2N/A% copies of entry_objects named by the result list of db_index_entries 'res'. 2N/A%
/* Remove the entry identified by 'recloc' from: 2N/A% 1. all indices, as obtained by extracting the index values from the entry 2N/A% 2. table where entry is stored. */ 2N/A%
/* entry_object * get_record( entryp );*/ 2N/A%
/* Constructor: Create empty table (no scheme, no table or indices). */ 2N/A%
/* Constructor: Create new table using scheme defintion supplied. 2N/A% (Make copy of scheme and keep it with table.) */ 2N/A%
/* Returns whether there table is valid (i.e. has scheme). */ 2N/A%
/* Change the version of the table to the one given. */ 2N/A%
/* Return the current version of the table. */ 2N/A%
/* Reset contents of tables by: deleting indice entries, table entries */ 2N/A%
/* Reset the table by: deleting all the indices, table of entries, and its 2N/A% scheme. Reset version to 0 */ 2N/A%
/* Initialize table using information from specified file. 2N/A% The table is first 'reset', then the attempt to load from the file 2N/A% is made. If the load failed, the table is again reset. 2N/A% Therefore, the table will be modified regardless of the success of the 2N/A% load. Returns TRUE if successful, FALSE otherwise. */ 2N/A%
/* Initialize table using information given in scheme 'how'. 2N/A% Record the scheme for later use (make copy of it); 2N/A% create the required number of indices; and create table for storing 2N/A% The 'tablePath' is passed on to db_table in order to obtain the 2N/A% NIS+/LDAP mapping information (if any). */ 2N/A%
/* Write this structure (table, indices, scheme) into the specified file. */ 2N/A%
/* Removes the entry in the table named by given query 'q'. 2N/A% If a NULL query is supplied, all entries in table are removed. 2N/A% Returns DB_NOTFOUND if no entry is found. 2N/A% Returns DB_SUCCESS if one entry is found; this entry is removed from 2N/A% its record storage, and it is also removed from all the indices of the 2N/A% table. If more than one entry satisfying 'q' is found, all are removed. */ 2N/A%
/* Add copy of given entry to table. Entry is identified by query 'q'. 2N/A% The entry (if any) satisfying the query is first deleted, then 2N/A% added to the indices (using index values extracted form the given entry) 2N/A% Returns DB_NOTUNIQUE if more than one entry satisfies the query. 2N/A% Returns DB_NOTFOUND if query is not well-formed. 2N/A% Returns DB_SUCCESS if entry can be added. */ 2N/A%
/* Finds entry that satisfy the query 'q'. Returns the answer by 2N/A% setting the pointer 'rp' to point to the list of answers. 2N/A% Note that the answers are pointers to copies of the entries. 2N/A% Returns the number of answers find in 'count'. 2N/A% Returns DB_SUCCESS if search found at least one answer; 2N/A% returns DB_NOTFOUND if none is found. */ 2N/A%
/* Returns the next entry in the table after 'previous' by setting 'answer' to 2N/A% point to a copy of the entry_object. Returns DB_SUCCESS if 'previous' 2N/A% is valid and next entry is found; DB_NOTFOUND otherwise. Sets 'where' 2N/A% to location of where entry is found for input as subsequent 'next' 2N/A%
/* Returns the next entry in the table after 'previous' by setting 'answer' to 2N/A% point to a copy of the entry_object. Returns DB_SUCCESS if 'previous' 2N/A% is valid and next entry is found; DB_NOTFOUND otherwise. Sets 'where' 2N/A% to location of where entry is found for input as subsequent 'next' 2N/A%
/* Returns the first entry found in the table by setting 'answer' to 2N/A% a copy of the entry_object. Returns DB_SUCCESS if found; 2N/A% DB_NOTFOUND otherwise. */ 2N/A%
/* Returns the first entry that satisfies query by setting 'answer' to 2N/A% a copy of the entry_object. Returns DB_SUCCESS if found; 2N/A% DB_NOTFOUND otherwise. */ 2N/A%
/* Delete the given list of results; used when no longer interested in 2N/A% the results of the first/next query that returned this list. */ 2N/A%
/* Return all entries within table. Returns the answer by 2N/A% setting the pointer 'rp' to point to the list of answers. 2N/A% Note that the answers are pointers to copies of the entries. 2N/A% Returns the number of answers find in 'count'. 2N/A% Returns DB_SUCCESS if search found at least one answer; 2N/A% returns DB_NOTFOUND if none is found. */ 2N/A%
/* for debugging */ 2N/A%
/* Prints statistics of the table. This includes the size of the table, 2N/A% the number of entries, and the index sizes. */ 2N/A%
/* Prints statistics about all indices of table. */ 2N/A%
/* Prints statistics about indices identified by 'n'. */ 2N/A%
/* Configure LDAP mapping */ 2N/A%
/* Mark this instance deferred */ 2N/A%
/* Remove deferred mark */ 2N/A%
/* Get pointer to private 'table' field */ 2N/A% * Update table entry per the (entry_object *). If 'replace' is set, 2N/A% * the entry is replaced or added; otherwise, it is removed. 2N/A%
/* Touch the indicated entry */ 2N/A%
/* Return the 'scheme' pointer */ 2N/A%
/* RW lock functions */ 2N/A%#
endif /* _DB_MINDEX_H */