NCBI C Toolkit Cross Reference

C/tools/list.h


  1 /*  list.h
  2 * ===========================================================================
  3 *
  4 *                            PUBLIC DOMAIN NOTICE
  5 *               National Center for Biotechnology Information
  6 *
  7 *  This software/database is a "United States Government Work" under the
  8 *  terms of the United States Copyright Act.  It was written as part of
  9 *  the author's official duties as a United States Government employee and
 10 *  thus cannot be copyrighted.  This software/database is freely available
 11 *  to the public for use. The National Library of Medicine and the U.S.
 12 *  Government have not placed any restriction on its use or reproduction.
 13 *
 14 *  Although all reasonable efforts have been taken to ensure the accuracy
 15 *  and reliability of the software and data, the NLM and the U.S.
 16 *  Government do not and cannot warrant the performance or results that
 17 *  may be obtained by using this software or data. The NLM and the U.S.
 18 *  Government disclaim all warranties, express or implied, including
 19 *  warranties of performance, merchantability or fitness for any particular
 20 *  purpose.
 21 *
 22 *  Please cite the author in any work or product based on this material.
 23 *
 24 * ===========================================================================
 25 *
 26 * File Name:  list.h
 27 *
 28 * Author:  Jinghui Zhang and Kun-Mao Chao
 29 *
 30 * Version Creation Date: 5/25/95
 31 *
 32 * $Revision: 6.1 $
 33 *
 34 * File Description:  functions used in the sim2 algorithm
 35 *
 36 * Modifications:
 37 * --------------------------------------------------------------------------
 38 * $Log: list.h,v $
 39 * Revision 6.1  2000/07/08 20:44:11  vakatov
 40 * Get all "#include" out of the 'extern "C" { }' scope;  other cleanup...
 41 *
 42 * Revision 6.0  1997/08/25 18:53:22  madden
 43 * Revision changed to 6.0
 44 *
 45 * Revision 5.0  1996/05/28 13:43:15  ostell
 46 * Set to revision 5.0
 47 *
 48 * Revision 4.1  1996/05/21  13:43:46  epstein
 49 * change function-name 'delete' because it conflicts with VMS
 50 * ==========================================================================
 51 */
 52 
 53 #ifndef _LIST_
 54 #define _LIST_
 55 
 56 #include <ncbi.h>
 57 
 58 #ifdef __cplusplus
 59 extern "C" {
 60 #endif
 61 
 62 typedef struct fragment {
 63         Int4 i, j, k;
 64         Int4 ref;
 65         Int4 score;
 66         struct fragment PNTR bgf;
 67         } fragment;
 68 
 69 #define false 0
 70 #define true 1
 71 typedef Char boolean;
 72 #define BitsInRandom 31
 73 
 74 #define allowDuplicates
 75 
 76 #define MaxNumberOfLevels 16
 77 #define UMaxNumberOfLevels 2
 78 #define MaxLevel (MaxNumberOfLevels-1)
 79 #define UMaxLevel (UMaxNumberOfLevels-1)
 80 #define newNodeOfLevel(l) (node)ckalloc(sizeof(struct nodeStructure)+(l)*sizeof(node *))
 81 
 82 typedef Int4 keyType;
 83 typedef fragment PNTR valueType;
 84 typedef struct nodeStructure PNTR node;
 85 typedef struct nodeStructure {
 86         keyType key;
 87         valueType value;
 88         node forward[1];
 89 } nodeStructure;
 90 typedef struct listStructure {
 91         Int4 level;
 92         node update[MaxNumberOfLevels];
 93         node header;
 94 } listStructure;
 95 typedef listStructure PNTR list;
 96 typedef struct unodeStructure PNTR unode;
 97 typedef struct unodeStructure {
 98         Int4 key;
 99         unode link;
100 } unodeStructure;
101 typedef struct ulistStructure {
102         unode header;
103 } ulistStructure;
104 typedef ulistStructure PNTR ulist;
105 
106 
107 extern void init(void);
108 extern void list_NIL_free(void);
109 extern list newList(void);
110 extern ulist unewList(void);
111 extern void reset_pos(list);
112 extern void sreset_pos(list);
113 extern void freeList(list); 
114 extern void ufreeList(ulist); 
115 extern Int4 randomLevel(Int4);
116 extern void uinsert(ulist, keyType); 
117 extern Int4 delete_by_key(list, keyType); 
118 extern Boolean usearch(ulist, keyType); 
119 extern valueType rsearch(list, keyType);
120 extern valueType rsearch_next(list, keyType);
121 extern keyType cur_key(list);
122 extern void update_node(list, valueType);
123 extern keyType next_key(list);
124 extern valueType next_val(list);
125 extern void next(list);
126 extern valueType snext(list);
127 extern void delete_next(list);
128 extern void insert_next(list, keyType, valueType);
129 
130 extern void active_print(list,Int4, Int4, Int4, Int4);
131 extern void fatal(CharPtr);
132 extern void fatalf(CharPtr, CharPtr);
133 extern FILE *ckopen(CharPtr, CharPtr);
134 extern CharPtr ckalloc(Int4);
135 
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #endif
142 
143 

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.