1 /*===========================================================================
2 *
3 *                            PUBLIC DOMAIN NOTICE
4 *               National Center for Biotechnology Information
5 *
6 *  This software/database is a "United States Government Work" under the
7 *  terms of the United States Copyright Act.  It was written as part of
8 *  the author's official duties as a United States Government employee and
9 *  thus cannot be copyrighted.  This software/database is freely available
10 *  to the public for use. The National Library of Medicine and the U.S.
11 *  Government have not placed any restriction on its use or reproduction.
12 *
13 *  Although all reasonable efforts have been taken to ensure the accuracy
14 *  and reliability of the software and data, the NLM and the U.S.
15 *  Government do not and cannot warrant the performance or results that
16 *  may be obtained by using this software or data. The NLM and the U.S.
17 *  Government disclaim all warranties, express or implied, including
18 *  warranties of performance, merchantability or fitness for any particular
19 *  purpose.
20 *
21 *  Please cite the author in any work or product based on this material.
22 *
23 * ===========================================================================
24 *
25 */
26 
27 #ifndef _h_dbmgr_priv_
28 #define _h_dbmgr_priv_
29 
30 #ifndef _h_vdb_extern_
31 #include <vdb/extern.h>
32 #endif
33 
34 #ifndef _h_vdb_quality_
35 #include <vdb/quality.h> /* VQuality */
36 #endif
37 
38 #ifndef _h_vdb_manager_
39 #include <vdb/manager.h>
40 #endif
41 
42 #ifndef _h_klib_container_
43 #include <klib/container.h>
44 #endif
45 
46 #ifndef _h_klib_refcount_
47 #include <klib/refcount.h>
48 #endif
49 
50 #ifndef KONST
51 #define KONST
52 #endif
53 
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 
60 /*--------------------------------------------------------------------------
61  * forwards
62  */
63 struct KDBManager;
64 struct VSchema;
65 struct VLinker;
66 
67 
68 /*--------------------------------------------------------------------------
69  * VDBManager
70  *  handle to library
71  */
72 struct VDBManager
73 {
74     /* underlying physical layer manager */
75     struct KDBManager KONST *kmgr;
76 
77     /* intrinsic schema elements */
78     struct VSchema *schema;
79 
80     /* intrinsic functions */
81     struct VLinker *linker;
82 
83     /* user data */
84     void *user;
85     void ( CC * user_whack ) ( void *data );
86 
87     /* open references */
88     KRefcount refcount;
89 
90     /* requested quality */
91     VQuality quality;
92 };
93 
94 /* Attach
95  * Sever
96  *  internal reference management
97  */
98 VDBManager *VDBManagerAttach ( const VDBManager *self );
99 rc_t VDBManagerSever ( const VDBManager *self );
100 
101 
102 /* ConfigPaths
103  *  looks for configuration information to set
104  *  include paths for schema parser and
105  *  load paths for linker
106  */
107 rc_t VDBManagerConfigPaths ( VDBManager *self, bool update );
108 
109 
110 /*--------------------------------------------------------------------------
111  * generic whackers
112  */
113 void CC VectMbrWhack ( void *item, void *ignore );
114 void CC BSTreeMbrWhack ( BSTNode *n, void *ignore );
115 
116 
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif /* _h_dbmgr_priv_ */
123