-
Notifications
You must be signed in to change notification settings - Fork 1
/
dict.h
38 lines (32 loc) · 1.16 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
/* 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: Nov 6 12:43 2018 (rd109)
* Created: Sat Dec 20 09:34:14 2008 (rd)
*-------------------------------------------------------------------
*/
#ifndef DICT_DEFINED
#define DICT_DEFINED
typedef struct {
char* *names ;
int *table ;
int max ; /* current number of entries */
int dim ;
int size ; /* 2^dim = size of tables */
} DICT ;
DICT *dictCreate (int size) ;
void dictDestroy (DICT *dict) ;
BOOL dictWrite (DICT *dict, FILE *f) ; /* return success or failure */
DICT *dictRead (FILE *f) ; /* return 0 on failure */
int dictAdd (DICT *dict, char* string, int *index) ;
int dictFind (DICT *dict, char *string, int *index) ;
char* dictName (DICT *dict, int i) ;
#define dictMax(dict) ((dict)->max)
#endif
/*********** end of file ***********/