/usr/lib/emboss/include/embdbi.h is in emboss-lib 6.6.0+dfsg-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | /* @include embdbi ************************************************************
**
** General routines for alignment.
**
** @author Copyright (c) 2000 Peter Rice
** @version $Revision: 1.24 $
** @modified $Date: 2011/10/18 14:24:24 $ by $Author: rice $
** @@
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
** MA 02110-1301, USA.
**
******************************************************************************/
#ifndef EMBDBI_H
#define EMBDBI_H
/* ========================================================================= */
/* ============================= include files ============================= */
/* ========================================================================= */
#include "ajdefine.h"
#include "ajstr.h"
#include "ajfile.h"
#include "ajlist.h"
AJ_BEGIN_DECLS
/* ========================================================================= */
/* =============================== constants =============================== */
/* ========================================================================= */
/* ========================================================================= */
/* ============================== public data ============================== */
/* ========================================================================= */
/* @data EmbPField ************************************************************
**
** NUCLEUS internal structure for database indexing applications
** to store field tokens with links to the entry index number.
**
** @attr field [char*] field token
** @attr entry [char*] entry name
** @attr nid [ajuint] entry number
** @attr Padding [char[4]] Padding to alignment boundary
** @@
******************************************************************************/
typedef struct EmbSField {
char* field;
char* entry;
ajuint nid;
char Padding[4];
} EmbOField;
#define EmbPField EmbOField*
/* @data EmbPEntry ************************************************************
**
** NUCLEUS internal structure for database indexing applications
** to store an entry id with a list of field tokens and file
** positions for writing to the index files.
**
** @attr entry [char*] entry name
** @attr filenum [ajuint] record in division file
** @attr rpos [ajuint] entry offset in data file
** @attr spos [ajuint] entry offset in sequence file
** @attr nfields [ajuint] number of fields
** @attr nfield [ajuint*] number of tokens for each field
** @attr field [char***] array of tokens for each field
** @@
******************************************************************************/
typedef struct EmbSEntry {
char* entry;
ajuint filenum;
ajuint rpos;
ajuint spos;
ajuint nfields;
ajuint* nfield;
char*** field;
} EmbOEntry;
#define EmbPEntry EmbOEntry*
/* ========================================================================= */
/* =========================== public functions ============================ */
/* ========================================================================= */
/*
** Prototype definitions
*/
ajint embDbiCmpId (const void* a, const void* b);
ajint embDbiCmpFieldId (const void* a, const void* b);
ajint embDbiCmpFieldField (const void* a, const void* b);
void embDbiDateSet (const AjPStr datestr, char date[4]);
void embDbiEntryDel(EmbPEntry* Pentry);
void embDbiEntryDelMap(void** pthys, void* cl);
EmbPEntry embDbiEntryNew (ajuint nfields);
void embDbiExit(void);
void embDbiFieldDel(EmbPField* pthys);
void embDbiFieldDelMap(void** pthys, void* cl);
EmbPField embDbiFieldNew (void);
AjPFile embDbiFileIn (const AjPStr dbname, const char* extension);
AjPFile embDbiFileIndex (const AjPStr indexdir, const AjPStr field,
const char* extension);
AjPList embDbiFileList (const AjPStr dir, const AjPStr wildfile,
AjBool trim);
AjPList embDbiFileListExc (const AjPStr dir, const AjPStr wildfile,
const AjPStr exclude);
AjPFile embDbiFileOut (const AjPStr dbname, const char* extension);
AjPFile embDbiFileSingle (const AjPStr dbname, const char* extension,
ajuint num);
AjBool embDbiFlatOpenlib(const AjPStr lname, AjPFile* libr);
void embDbiHeader (AjPFile file, ajuint filesize,
ajuint recordcnt, short recordlen,
const AjPStr dbname, const AjPStr release,
const char date[4]);
void embDbiHeaderSize (AjPFile file, ajuint filesize, ajuint recordcnt);
void embDbiLogCmdline(AjPFile logfile);
void embDbiLogFields(AjPFile logfile, AjPStr const * fields,
ajuint nfields);
void embDbiLogFile(AjPFile logfile, const AjPStr curfilename,
ajuint idCountFile, AjPStr const * fields,
const ajuint* countField,
ajuint nfields);
void embDbiLogFinal(AjPFile logfile, ajuint maxlen,
const ajint* maxFieldLen,
AjPStr const * fields, const ajuint* fieldTot,
ajuint nfields, ajuint nfiles,
ajuint idDone, ajuint idCount);
void embDbiLogHeader(AjPFile logfile, const AjPStr dbname,
const AjPStr release, const AjPStr datestr,
const AjPStr indexdir,
ajuint maxindex);
void embDbiLogSource(AjPFile logfile, const AjPStr directory,
const AjPStr filename, const AjPStr exclude,
AjPStr const * inputFiles, ajuint nfiles);
void embDbiMaxlen (AjPStr* token, ajint* maxlen);
void embDbiMemEntry (AjPList idlist,
AjPList* fieldList, ajuint nfields,
EmbPEntry entry, ajuint ifile);
ajuint embDbiMemWriteEntry (AjPFile entFile, ajuint maxidlen,
const AjPList idlist, void ***ids);
ajuint embDbiMemWriteFields (const AjPStr dbname, const AjPStr release,
const char date[4], const AjPStr indexdir,
const AjPStr field, ajuint maxFieldLen,
const AjPList fieldList,
void** ids);
void embDbiRmEntryFile (const AjPStr dbname, AjBool cleanup);
void embDbiRmFile (const AjPStr dbname, const char* ext, ajuint nfiles,
AjBool cleanup);
void embDbiRmFileI (const AjPStr dbname, const char* ext, ajuint ifile,
AjBool cleanup);
void embDbiSortClose (AjPFile* elistfile, AjPFile* alistfile,
ajuint nfields);
void embDbiSortFile (const AjPStr dbname,
const char* ext1, const char* ext2,
ajuint nfiles, AjBool cleanup, const AjPStr sortopt);
AjPFile embDbiSortOpen (AjPFile* alistfile, ajuint ifile,
const AjPStr dbname, AjPStr const * fields,
ajuint nfields);
ajuint embDbiSortWriteEntry (AjPFile entFile, ajuint maxidlen,
const AjPStr dbname, ajuint nfiles,
AjBool cleanup, const AjPStr sortopt);
ajuint embDbiSortWriteFields (const AjPStr dbname, const AjPStr release,
const char date[4], const AjPStr indexdir,
const AjPStr field, ajuint maxFieldLen,
ajuint nfiles, ajuint nentries,
AjBool cleanup, const AjPStr sortopt);
void embDbiWriteDivision (const AjPStr indexdir,
const AjPStr dbname, const AjPStr release,
const char date[4],
ajuint maxfilelen, ajuint nfiles,
AjPStr const * divfiles,
AjPStr const * seqfiles);
void embDbiWriteDivisionRecord (AjPFile file,
ajuint maxnamlen, short recnum,
const AjPStr datfile,
const AjPStr seqfile);
void embDbiWriteEntryRecord (AjPFile file, ajuint maxidlen,
const AjPStr id,
ajuint rpos, ajuint spos, ajushort filenum);
void embDbiWriteHit (AjPFile file, ajuint idnum);
void embDbiWriteTrg (AjPFile file, ajuint maxfieldlen,
ajuint idnum, ajuint idcnt, const AjPStr hitstr);
/*
** End of prototype definitions
*/
AJ_END_DECLS
#endif /* !EMBDBI_H */
|