NCBI C Toolkit Cross Reference

C/cdromlib/cdnewlib.h


  1 /* cdnewlib.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 * RCS $Id: cdnewlib.h,v 6.0 1997/08/25 18:13:05 madden Exp $
 27 *
 28 * Author:  Gregory Schuler
 29 *
 30 * Version Creation Date: 08-22-94
 31 *
 32 * File Description:  Entrez low-level interface to CD-ROMs
 33 *
 34 * Modifications:  
 35 * --------------------------------------------------------------------------
 36 * Rev   Date      Name      Description of modification
 37 * ----  --------  --------  ------------------------------------------------
 38 * 1.1   08-22-94  Schuler   Initial revision
 39 * 1.2   08-25-94  Schuler   Defined some more error codes
 40 * 1.3   08-31-94  Schuler   Defined one more error code
 41 * 1.4   09-01-94  Schuler   Added defines for directory names
 42 * 1.5   11-22-94  Schuler   Changed arg in cd3_CdLinkUidGet fom long to DocUid
 43 * 1.6   11-22-94  Schuler   Added rcs Id directive
 44 * 1.7   11-22-94  Schuler   A few more tweaks for NT compiler warnings
 45 * 1.8   11-20-94  Schuler   Added CdMountEntrezVolume and CdUnmountEntrezVolume
 46 * 1.9   05-16-94  Schuler   Added RCS Log directive.  Comments will henceforth
 47 *                           be inserted automatically into the source at the
 48 *                           time it is checked into the system.
 49 
 50 $Log: cdnewlib.h,v $
 51 Revision 6.0  1997/08/25 18:13:05  madden
 52 Revision changed to 6.0
 53 
 54 Revision 5.1  1997/06/26 21:55:42  vakatov
 55 [PC] DLL'd "ncbicdr.lib", "ncbiacc.lib", "ncbinacc.lib" and "ncbicacc.lib"
 56 
 57 Revision 5.0  1996/05/28 13:55:34  ostell
 58 Set to revision 5.0
 59 
 60  * Revision 4.1  1995/08/24  20:44:27  epstein
 61  * add more stuff for genomes
 62  *
 63  * Revision 4.0  1995/07/26  13:50:32  ostell
 64  * force revision to 4.0
 65  *
 66  * Revision 1.9  1995/05/16  14:12:46  schuler
 67  * Automatic comment insertion enabled
 68  *
 69 
 70 
 71 
 72 * ==========================================================================
 73 */
 74 
 75 
 76 
 77 #ifndef __cd3_CdEntrez__
 78 #define __cd3_CdEntrez__
 79 
 80 #ifdef _NEW_CdEntrez_
 81 
 82 
 83 /******* ERROR CODES ******/
 84 #define ERR_NotDefined  0    /* Some error for which I have not yet defined a code... */
 85 #define ERR_DeepDooDoo  1    /* Catastrophic error -- unknown cause */
 86 #define ERR_NotInited   2    /* The library has not beed initialized */
 87 #define ERR_ConfigFile  3    /* Something wrong with configuration settings in .ncbirc */
 88 #define    SUB_DevCount    1    /* [CdEntrez].DeviceCount zero or missing */
 89 #define ERR_BadParam    4    /* Invalid parameter passed to library function */
 90 #define    SUB_DocType     1    /* Invalid DocType value */
 91 #define    SUB_DocField    2    /* Invalid DocField value */
 92 #define ERR_BadFile     5    /* Something wrong with some Entrez file */
 93 #define    SUB_BadVersion  1    /* Version number mismatch */
 94 #define    SUB_Corrupt     2    /* File is corrupt or not recognized */
 95 #define    SUB_NeedUpdate  3    /* File is from a future version -- need software upgrade */
 96 
 97 
 98 
 99 /*
100 Note about DocTypes:  None of the functions in this module 
101 recognize TYP_SEQ as valid document type; you must use 
102 either TYP_AA, TYP_NT, or TYP_CH.
103 */
104 
105 
106 /******* FUNCTIONS ******/
107 
108 #undef NLM_EXTERN
109 #ifdef NLM_IMPORT
110 #define NLM_EXTERN NLM_IMPORT
111 #else
112 #define NLM_EXTERN extern
113 #endif
114 
115 #ifdef __cplusplus
116 extern "C" {
117 #endif
118 
119 NLM_EXTERN Boolean cd3_CdInit (void);
120 NLM_EXTERN Boolean cd3_CdFini (void);
121 NLM_EXTERN AsnIo*  cd3_EntrezInfoOpen (const char *dirname);
122 NLM_EXTERN EntrezInfo*  cd3_CdGetInfo (void);
123 NLM_EXTERN char* cd3_CdDetailedInfo (void);
124 NLM_EXTERN int   cd3_CdTrmPageCt (DocType type, DocField field);
125 NLM_EXTERN int   cd3_CdTrmLookup (DocType type, DocField field, const char *term);
126 NLM_EXTERN int   cd3_CdLinkUidGet (LinkSetPtr *result, DocType type,
127                         DocType link_to_type, int numuid, DocUid *uids, 
128                         Boolean mark_missing, long maxlink);
129 NLM_EXTERN long  cd3_CdTrmUidsFil (DocType type, DocField field, long offset,
130                                    long count, const char *filename, Boolean append);
131 NLM_EXTERN long  cd3_CdTrmUidsMem (DocType type, DocField field, long offset,
132                                    long count, DocUid *mem);
133 NLM_EXTERN CdTerm* cd3_CdTrmFind (DocType type, DocField field, const char *term);
134 NLM_EXTERN AsnIo* cd3_CdDocAsnOpen (DocType type, DocUid uid);
135 NLM_EXTERN AsnIo* cd3_CdDocAsnClose (AsnIo* aio);
136 NLM_EXTERN int   cd3_CdTermScan (DocType type, DocField field, int page, int numpage, 
137                         CdTermProc proc);
138 NLM_EXTERN DocSum* cd3_CdGetDocSum (DocType type, DocUid uid);
139 
140 
141 typedef struct CdRomInfo
142 {
143         short rel_major;     /* e.g. 13 for release 13.0     */
144         short rel_minor;     /* e.g.  0 for release 13.0     */
145         short cd_num;        /* CD-ROM number: 1, 2, or 3    */
146         short cd_count;      /* Number of CDs in this set    */
147         unsigned upper_case    :1; /* (primarily for internal use) */
148         unsigned semicolon_one :1; /* (primarily for internal use) */
149 }
150 CdRomInfo;
151 
152 NLM_EXTERN Boolean LIBCALL cd3_CdTestPath (const char *path, CdRomInfo *info);
153 
154 
155 typedef enum CdEntrezDir 
156         { CdDir_sys, CdDir_idx, CdDir_sum, CdDir_trm, CdDir_lnk, CdDir_rec }
157 CdEntrezDir;
158 
159 #define CdDir_FIRST   CdDir_sys
160 #define CdDir_LAST    CdDir_rec
161 
162 typedef Boolean (LIBCALLBACK *EntrezEnumFileProc)(int cdnum, const char *fdir,
163                 const char *fname, long fsize, void *opaque_data);
164 
165 NLM_EXTERN long LIBCALL cd3_CdEnumFiles (CdEntrezDir dir, DocType type, const char *div, EntrezEnumFileProc proc, void *opaque_data);
166                         
167 
168 NLM_EXTERN Boolean LIBCALL CdMountEntrezVolume (int cdnum, char *root, size_t buflen);
169 NLM_EXTERN Boolean LIBCALL CdUnmountEntrezVolume (int cdnum);
170 
171 typedef struct CdDevInfo
172 {
173         char *root;
174         char *formal_name;
175         char *device_name;
176         char *raw_device_name;
177         char *mount_point;
178         char *mount_cmd;
179 }
180 CdDevInfo;
181 
182 typedef int (LIBCALLBACK *CdDevHook)(const char *volname, const CdDevInfo *info);
183 NLM_EXTERN CdDevHook LIBCALL CdSetInsertHook (CdDevHook hook);
184 NLM_EXTERN CdDevHook LIBCALL CdSetEjectHook (CdDevHook hook);
185 
186 #ifdef __cplusplus
187 }
188 #endif
189 
190 #undef NLM_EXTERN
191 #ifdef NLM_EXPORT
192 #define NLM_EXTERN NLM_EXPORT
193 #else
194 #define NLM_EXTERN
195 #endif
196 
197 
198 #define SYS_KEYNAME "SYS"
199 #define IDX_KEYNAME "IDX"
200 #define SUM_KEYNAME "SUM"
201 #define TRM_KEYNAME "TRM"
202 #define LNK_KEYNAME "LNK"
203 #define REC_KEYNAME "REC"
204 
205 #define SYS_DIRNAME "sysinfo"
206 #define IDX_DIRNAME "index"
207 #define SUM_DIRNAME "summary"
208 #define TRM_DIRNAME "terms"
209 #define LNK_DIRNAME "links"
210 #define REC_DIRNAME "asndata"
211 
212 
213 
214 /******** ALIASES ********/
215 #define CdTestPath   cd3_CdTestPath
216 #define CdEnumFiles  cd3_CdEnumFiles
217 #define CdGetDocSum  cd3_CdGetDocSum
218 
219 #endif
220 #endif
221 

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.