NCBI C Toolkit Cross Reference

C/tools/db_list.h


  1 
  2 /*  db_list.h
  3 * ===========================================================================
  4 *
  5 *                            PUBLIC DOMAIN NOTICE
  6 *               National Center for Biotechnology Information
  7 *
  8 *  This software/database is a "United States Government Work" under the
  9 *  terms of the United States Copyright Act.  It was written as part of
 10 *  the author's official duties as a United States Government employee and
 11 *  thus cannot be copyrighted.  This software/database is freely available
 12 *  to the public for use. The National Library of Medicine and the U.S.
 13 *  Government have not placed any restriction on its use or reproduction.
 14 *
 15 *  Although all reasonable efforts have been taken to ensure the accuracy
 16 *  and reliability of the software and data, the NLM and the U.S.
 17 *  Government do not and cannot warrant the performance or results that
 18 *  may be obtained by using this software or data. The NLM and the U.S.
 19 *  Government disclaim all warranties, express or implied, including
 20 *  warranties of performance, merchantability or fitness for any particular
 21 *  purpose.
 22 *
 23 *  Please cite the author in any work or product based on this material.
 24 *
 25 * ===========================================================================
 26 *
 27 * File Name:  db_list.h
 28 *
 29 * Author:  Jinghui Zhang and Kun-Mao Chao
 30 *
 31 * Version Creation Date: 5/25/95
 32 *
 33 * $Revision: 6.0 $
 34 *
 35 * File Description:  functions used in the sim2 algorithm
 36 *
 37 * Modifications:
 38 * --------------------------------------------------------------------------
 39 * Date     Name        Description of modification
 40 * -------  ----------  -----------------------------------------------------
 41 *
 42 *
 43 * $Log: db_list.h,v $
 44 * Revision 6.0  1997/08/25 18:53:00  madden
 45 * Revision changed to 6.0
 46 *
 47 * Revision 5.0  1996/05/28 13:43:15  ostell
 48 * Set to revision 5.0
 49 *
 50  * Revision 4.0  1995/07/26  13:50:15  ostell
 51  * force revision to 4.0
 52  *
 53  * Revision 1.2  1995/05/25  20:16:00  zjing
 54  * list.h
 55  *
 56 *
 57 *
 58 * ==========================================================================
 59 */
 60 
 61 #ifndef _DB_LIST_
 62 #define _DB_LIST_
 63 
 64 #include <ncbi.h>
 65 
 66 #ifdef __cplusplus
 67 extern "C" {
 68 #endif
 69 
 70 
 71 
 72 #define false 0
 73 #define true 1
 74 #define BitsInRandom 31
 75 
 76 #define allowDuplicates
 77 
 78 #define MaxNumberOfLevels 16
 79 #define IMaxNumberOfLevels 4
 80 #define MaxLevel (MaxNumberOfLevels-1)
 81 #define IMaxLevel (IMaxNumberOfLevels-1)
 82 #define db_newNodeOfLevel(l) (db_node)ckalloc(sizeof(struct db_nodeStructure)+(l)*sizeof(db_node *))
 83 
 84 typedef struct db_nodeStructure PNTR db_node;
 85 typedef struct db_nodeStructure {
 86         keyType key;
 87         valueType value;
 88         db_node back;
 89         db_node forward[1];
 90 } db_nodeStructure;
 91 typedef struct db_listStructure {
 92         Int4 level;
 93         db_node update[MaxNumberOfLevels];
 94         db_node header;
 95 } db_listStructure;
 96 typedef db_listStructure PNTR db_list;
 97 typedef struct idb_listStructure {
 98         Int4 level;
 99         db_node update;
100         db_node header;
101 } idb_listStructure;
102 typedef idb_listStructure PNTR idb_list;
103 
104 extern void db_init(void);
105 extern void dblist_NIL_free(void);
106 extern db_list db_newList(void);
107 extern idb_list idb_newList(void);
108 extern void db_reset_pos(db_list);
109 extern void db_sreset_pos(db_list);
110 extern void idb_reset_pos(idb_list);
111 extern void db_freeList(db_list); 
112 extern void idb_freeList(idb_list); 
113 extern Int4 db_randomLevel(Int4);
114 extern void db_insert(idb_list, keyType, valueType); 
115 extern void db_delete(idb_list, keyType); 
116 extern valueType db_rsearch(db_list, keyType);
117 extern valueType db_rsearch_next(db_list, keyType);
118 extern valueType db_lsearch(db_list, keyType);
119 extern valueType db_lsearch_next(db_list, keyType);
120 extern keyType db_cur_key(db_list);
121 extern void db_update_node(db_list, valueType);
122 extern keyType db_next_key(db_list);
123 extern valueType db_next_val(db_list);
124 extern keyType db_prev_key(db_list);
125 extern valueType db_prev_val(db_list);
126 extern keyType db_key_next(db_list);
127 extern keyType idb_key_next(idb_list);
128 extern valueType db_next(db_list);
129 extern valueType db_snext(db_list);
130 extern void db_delete_next(db_list);
131 extern void db_insert_next(db_list, keyType, valueType);
132 extern void db_print(db_list);
133 
134 
135 #ifdef __cplusplus
136 }
137 #endif
138 
139 #endif
140 
141 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.