-
Notifications
You must be signed in to change notification settings - Fork 2
/
dict.h
40 lines (33 loc) · 1.25 KB
/
dict.h
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
/* File: dict.h
* Author: Richard Durbin ([email protected])
* Copyright (C) Genome Research Limited, 2003-2008
*-------------------------------------------------------------------
* Description: header file for DICT package, string hash tables
developed from the corresponding functions in acedb
Jean Thierry-Mieg and Richard Durbin 1989-
* Exported functions:
* HISTORY:
* Last edited: May 29 12:50 2023 (rd109)
* Created: Sat Dec 20 09:34:14 2008 (rd)
*-------------------------------------------------------------------
*/
#ifndef DICT_DEFINED
#define DICT_DEFINED
#include "utils.h"
typedef struct {
char* *names ;
U64 *table ;
U64 max ; /* current number of entries */
U64 dim ;
U64 size ; /* 2^dim = size of tables */
} DICT ;
DICT *dictCreate (U64 size) ;
void dictDestroy (DICT *dict) ;
bool dictWrite (DICT *dict, FILE *f) ; /* return success or failure */
DICT *dictRead (FILE *f) ; /* return 0 on failure */
bool dictAdd (DICT *dict, char* string, U64 *index) ; /* return TRUE if added, always fill index */
bool dictFind (DICT *dict, char *string, U64 *index) ; /* return TRUE if found */
char* dictName (DICT *dict, U64 i) ;
#define dictMax(dict) ((dict)->max)
#endif
/*********** end of file ***********/