This file is indexed.

/usr/lib/emboss/include/ajtable.h is in emboss-lib 6.6.0+dfsg-6build1.

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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
/* @include ajtable ***********************************************************
**
** AJAX table functions
**
** Hash table functions.
**
** @author Copyright (C) 1998 Ian Longden
** @version $Revision: 1.40 $
** @modified 2011 pmr Auto-resizing, destructors, table merges
** @modified $Date: 2013/02/17 13:39:55 $ by $Author: mks $
** @@
**
** 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 AJTABLE_H
#define AJTABLE_H

/* ========================================================================= */
/* ============================= include files ============================= */
/* ========================================================================= */

#include "ajdefine.h"
#include "ajstr.h"

AJ_BEGIN_DECLS




/* ========================================================================= */
/* =============================== constants =============================== */
/* ========================================================================= */




/* @enum AjETableType *********************************************************
**
** AJAX Table Type enumeration
**
** @value ajETableTypeUnknown no type set
** @value ajETableTypeChar    char* type
** @value ajETableTypeStr     AJAX String (AjPStr) type
** @value ajETableTypeInt     AJAX integer (ajint) type
** @value ajETableTypeUint    AJAX unsigned integer (ajuint) type
** @value ajETableTypeLong    AJAX long integer (ajlong) type
** @value ajETableTypeUlong   AJAX unsigned long integer (ajulong) type
** @value ajETableTypeUser    user-defined type
** @value ajETableTypeMax     beyond last defined value
**
******************************************************************************/

typedef enum AjOTableType
{
    ajETableTypeUnknown,
    ajETableTypeChar,
    ajETableTypeStr,
    ajETableTypeInt,
    ajETableTypeUint,
    ajETableTypeLong,
    ajETableTypeUlong,
    ajETableTypeUser,
    ajETableTypeMax
} AjETableType;




/* ========================================================================= */
/* ============================== public data ============================== */
/* ========================================================================= */




/* @data AjPTableNode *********************************************************
**
** AJAX Table Node object.
**
** @attr Link [struct AjSTableNode*] Link top next AJAX Table Node
** @attr Key [void*] Key data
** @attr Value [void*] Value data
** @@
******************************************************************************/

typedef struct AjSTableNode {
    struct AjSTableNode* Link;
    void* Key;
    void* Value;
} AjOTableNode;

#define AjPTableNode AjOTableNode*




/* @data AjPTable *************************************************************
**
** Hash table object. Tables are key/value pairs with a simple hash function
** to provide rapid searching for keys.
**
** Tables can hold any data type. Special functions are available for
** tables of AjPStr values, but these are in the ajstr library,
** and start with ajStrTable...
**
** In general, these functions are the same
** but with different hash and comparison functions used. Alternative
** function names are provided in all cases to save remembering which
** calls need special cases.
**
** @new ajTableNew Creates a table.
** @delete ajTableFree Deallocates and clears a table.
** @modify ajTablePut Adds or updates a value for a given key.
** @modify ajTableMap Calls a function for each key/value in a table.
** @modify ajTableRemove Removes a key/value pair from a table, and returns
**                    the value.
** @cast ajTableToarray Creates an array to hold each key value pair
**                     in pairs of array elements. The last element is null.
** @cast ajTableGet Returns the value for a given key.
** @cast ajTableLength Returns the number of keys in a table.
** @output ajTableTrace Writes debug messages to trace the contents of a table.
**
** @attr Fcmp [ajint function] Key compare function
**                       (0 for match, -1 or +1 if not matched)
** @attr Fhash [ajulong function] Hash function
** @attr Fkeydel [void function] Key destructor, or NULL if not an object
** @attr Fvaldel [void function] Value destructor, or NULL if not an object
** @attr Buckets [AjPTableNode*] Buckets of AJAX Table Node objects
** @attr Size [ajulong] Size - number of hash buckets
** @attr Length [ajulong] Number of entries
** @attr Timestamp [ajuint] Time stamp
** @attr Use [ajuint] Reference count
** @attr Padding [ajuint] Padding to alignment boundary
** @attr Type [AjETableType] AJAX Table Type enumeration
** @@
******************************************************************************/

typedef struct AjSTable
{
    ajint (*Fcmp)(const void* key1, const void* key2);
    ajulong (*Fhash)(const void* key, ajulong hashsize);
    void (*Fkeydel)(void** Pkey);
    void (*Fvaldel)(void** Pvalue);
    AjPTableNode* Buckets;
    ajulong Size;
    ajulong Length;
    ajuint Timestamp;
    ajuint Use;
    ajuint Padding;
    AjETableType Type;
} AjOTable;

#define AjPTable AjOTable*




/* ========================================================================= */
/* =========================== public functions ============================ */
/* ========================================================================= */




/*
** Prototype definitions
*/

void           ajTableExit(void);
void           ajTableClear(AjPTable table);
void           ajTableClearDelete(AjPTable table);
void           ajTableDel(AjPTable* table);
void           ajTableDelKeydelValdel(AjPTable* table,
                                      void (*keydel)(void** Pvalue),
                                      void (*valdel)(void** Pvalue));
void           ajTableDelValdel(AjPTable* table,
                                void (*valdel)(void** Pvalue));
void           ajTableFree(AjPTable* table);

const void*    ajTableFetchV(const AjPTable table, const void* key);
void*          ajTableFetchmodV(const AjPTable table, const void* key);
void*          ajTableFetchmodTraceV(const AjPTable table, const void* key);

const ajint*   ajTableintFetch(const AjPTable table, const ajint* intkey);
ajint*         ajTableintFetchmod(AjPTable table, const ajint* key);

const ajlong*  ajTablelongFetch(const AjPTable table, const ajlong* longkey);
ajlong*        ajTablelongFetchmod(AjPTable table, const ajlong* key);

const ajuint*  ajTableuintFetch(const AjPTable table, const ajuint* uintkey);
ajuint*        ajTableuintFetchmod(AjPTable table, const ajuint* key);

const ajulong* ajTableulongFetch(const AjPTable table,
                                 const ajulong* ulongkey);
ajulong*       ajTableulongFetchmod(AjPTable table, const ajulong* key);

const void*    ajTableFetchC(const AjPTable table, const char* txtkey);
const void*    ajTableFetchS(const AjPTable table, const AjPStr key);
void*          ajTableFetchmodC(const AjPTable table, const char* txtkey);
void*          ajTableFetchmodS(const AjPTable table, const AjPStr key);

ajulong        ajTableGetLength(const AjPTable table);
ajulong        ajTableGetSize(const AjPTable table);
void           ajTableMap(AjPTable table,
                          void (*apply)(const void* key,
                                        void** Pvalue,
                                        void* cl),
                          void* cl);
void           ajTableMapDel(AjPTable table,
                             void (*apply)(void** Pkey,
                                           void** Pvalue,
                                           void* cl),
                             void* cl);
AjBool         ajTableMergeAnd(AjPTable thys, AjPTable table);
AjBool         ajTableMergeEor(AjPTable thys, AjPTable table);
AjBool         ajTableMergeNot(AjPTable thys, AjPTable table);
AjBool         ajTableMergeOr(AjPTable thys, AjPTable table);
void*          ajTablePut(AjPTable table, void* key, void* value);
AjBool         ajTablePutClean(AjPTable table, void* key, void* value,
                               void (*keydel)(void** Pkey),
                               void (*valdel)(void** Pvalue));
void*          ajTablePutTrace(AjPTable table, void* key,
                               void* value);

void*          ajTableRemove(AjPTable table, const void* key);
void*          ajTableRemoveKey(AjPTable table, const void* key,
                                void** truekey);
void           ajTableResizeCount(AjPTable table, ajulong size);

void           ajTableResizeHashsize(AjPTable table, ajulong hashsize);

ajulong        ajTableToarrayKeys(const AjPTable table,
                                  void*** keyarray);
ajulong        ajTableToarrayKeysValues(const AjPTable table,
                                        void*** keyarray, void*** valarray);
ajulong        ajTableToarrayValues(const AjPTable table,
                                    void*** valarray);


AjPTable       ajTablecharNew(ajulong hint);
AjPTable       ajTablecharNewCase(ajulong hint);
AjPTable       ajTablecharNewConst(ajulong hint);
AjPTable       ajTablecharNewCaseConst(ajulong hint);

void           ajTableTrace(const AjPTable table);
void           ajTablecharPrint(const AjPTable table);
void           ajTablestrPrint(const AjPTable table);
void           ajTablestrTrace(const AjPTable table);
void           ajTablestrTracekeys(const AjPTable table);

ajint          ajTablecharCmp(const void* key1, const void* key2);
ajint          ajTablecharCmpCase(const void* key1, const void* key2);
ajint          ajTableintCmp(const void* key1, const void* key2);
ajint          ajTableuintCmp(const void* key1, const void* key2);
ajint          ajTablelongCmp(const void* key1, const void* key2);
ajint          ajTableulongCmp(const void* key1, const void* key2);
ajint          ajTablestrCmp(const void* key1, const void* key2);
ajint          ajTablestrCmpCase(const void* key1, const void* key2);

ajulong        ajTablecharHash(const void* key, ajulong hashsize);
ajulong        ajTablecharHashCase(const void* key, ajulong hashsize);
ajulong        ajTableintHash(const void* key, ajulong hashsize);
ajulong        ajTablelongHash(const void* key, ajulong hashsize);
ajulong        ajTableuintHash(const void* key, ajulong hashsize);
ajulong        ajTableulongHash(const void* key, ajulong hashsize);
ajulong        ajTablestrHash(const void* key, ajulong hashsize);
ajulong        ajTablestrHashCase(const void* key, ajulong hashsize);

AjPTable       ajTableintNew(ajulong size);
AjPTable       ajTableintNewConst(ajulong size);
AjPTable       ajTablelongNew(ajulong size);
AjPTable       ajTablelongNewConst(ajulong size);
AjPTable       ajTableuintNew(ajulong size);
AjPTable       ajTableuintNewConst(ajulong size);
AjPTable       ajTableulongNew(ajulong size);
AjPTable       ajTableulongNewConst(ajulong size);
void           ajTableintFree(AjPTable* ptable);
void           ajTableintFreeKey(AjPTable* ptable);
void           ajTablelongFree(AjPTable* ptable);
void           ajTablelongFreeKey(AjPTable* ptable);
void           ajTableuintFree(AjPTable* ptable);
void           ajTableuintFreeKey(AjPTable* ptable);
void           ajTableulongFree(AjPTable* ptable);
void           ajTableulongFreeKey(AjPTable* ptable);
AjPTable       ajTablestrNew(ajulong size);
AjPTable       ajTablestrNewCase(ajulong size);
AjPTable       ajTablestrNewConst(ajulong size);
AjPTable       ajTablestrNewCaseConst(ajulong size);

void           ajTablestrFree(AjPTable* ptable);
void           ajTablestrFreeKey(AjPTable* ptable);

AjPTable       ajTableNew(ajulong size);
AjPTable       ajTableNewFunctionLen(ajulong size,
                                     ajint (*cmp)(const void* key1,
                                                  const void* key2),
                                     ajulong (*hash)(const void* key,
                                                    ajulong hashsize),
                                     void (*keydel)(void** Pkey),
                                     void (*valdel)(void** Pvalue));
const AjPStr   ajTablestrFetchkeyC(const AjPTable table, const char* key);
const AjPStr   ajTablestrFetchkeyS(const AjPTable table, const AjPStr key);

void           ajTableSetDestroy(AjPTable table,
                                 void (*keydel)(void** Pkey),
                                 void (*valdel)(void** Pvalue));
void           ajTableSetDestroyboth(AjPTable table);
void           ajTableSetDestroykey(AjPTable table,
                                    void (*keydel)(void** Pkey));
void           ajTableSetDestroyvalue(AjPTable table,
                                      void (*valdel)(void** Pvalue));

void           ajTableSettypeDefault(AjPTable table);
void           ajTableSettypeChar(AjPTable table);
void           ajTableSettypeCharCase(AjPTable table);
void           ajTableSettypeInt(AjPTable table);
void           ajTableSettypeLong(AjPTable table);
void           ajTableSettypeUint(AjPTable table);
void           ajTableSettypeUlong(AjPTable table);
void           ajTableSettypeString(AjPTable table);
void           ajTableSettypeStringCase(AjPTable table);
void           ajTableSettypeUser(AjPTable table,
                                  ajint (*cmp)(const void* key1,
                                               const void* key2),
                                  ajulong (*hash)(const void* key,
                                                  ajulong hashsize));

AjBool         ajTableMatchC(const AjPTable table, const char* key);
AjBool         ajTableMatchS(const AjPTable table, const AjPStr key);
AjBool         ajTableMatchV(const AjPTable table, const void* key);

void*          ajTablestrFetchC(const AjPTable table, const char* txtkey);
void*          ajTablestrFetchS(const AjPTable table, const AjPStr key);
AjPStr*        ajTablestrFetchmod(AjPTable table, const AjPStr key);

/*
** End of prototype definitions
*/




#ifdef AJ_COMPILE_DEPRECATED_BOOK
#endif /* AJ_COMPILE_DEPRECATED_BOOK */

#ifdef AJ_COMPILE_DEPRECATED

__deprecated AjPTable   ajTableNewLen(ajuint size);
__deprecated AjPTable   ajTablestrNewCaseLen(ajuint size);
__deprecated AjPTable   ajTablestrNewLen(ajuint size);
__deprecated void*      ajTableFetch(const AjPTable table, const void* key);
__deprecated const void* ajTableFetchKey(const AjPTable table,
                                         const void* key);
__deprecated AjPTable   ajTablecharNewCaseLen(ajuint hint);
__deprecated const AjPStr ajTablestrFetch(const AjPTable table,
                                          const AjPStr key);
__deprecated ajuint     ajTableToarray(const AjPTable table,
                                       void*** keyarray, void*** valarray);
__deprecated ajint      ajTableLength(const AjPTable table);
__deprecated void*      ajTableGet(const AjPTable table, const void* key);
__deprecated ajint      ajStrTableCmp(const void* key1, const void* key2);
__deprecated ajint      ajStrTableCmpC(const void* key1, const void* key2);
__deprecated ajint      ajStrTableCmpCase(const void* key1, const void* key2);
__deprecated ajint      ajStrTableCmpCaseC(const void* key1, const void* key2);
__deprecated ajuint     ajStrTableHash(const void* key, ajuint hashsize);
__deprecated ajuint     ajStrTableHashC(const void* key, ajuint hashsize);
__deprecated ajuint     ajStrTableHashCase(const void* key, ajuint hashsize);
__deprecated ajuint     ajStrTableHashCaseC(const void* key, ajuint hashsize);
__deprecated AjPTable   ajStrTableNewC(ajuint hint);
__deprecated AjPTable   ajStrTableNewCase(ajuint hint);
__deprecated AjPTable   ajStrTableNewCaseC(ajuint hint);
__deprecated void       ajStrTablePrint(const AjPTable table);
__deprecated void       ajStrTablePrintC(const AjPTable table);
__deprecated void       ajStrTableTrace(const AjPTable table);

__deprecated AjPTable   ajTableNewL(ajuint size,
                                    ajint (*cmp)(const void* key1,
                                                 const void* key2),
                                    ajuint (*hash)(const void* key,
                                                   ajuint hashsize));
__deprecated const void* ajTableKey(const AjPTable table, const void* key);
__deprecated void       ajStrTableFree(AjPTable* table);
__deprecated AjPTable   ajStrTableNew(ajuint hint);
__deprecated void       ajStrTableFreeKey(AjPTable* table);

#endif /* AJ_COMPILE_DEPRECATED */




AJ_END_DECLS

#endif /* !AJTABLE_H */