-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashFile.h
More file actions
49 lines (36 loc) · 1.26 KB
/
HashFile.h
File metadata and controls
49 lines (36 loc) · 1.26 KB
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
#ifndef HASH_INDEX_H
#define HASH_INDEX_H
#include "BF.h"
typedef struct Record {
int id;
char name[15];
char surname[25];
char address[50];
} Record;
typedef struct {
int file_descriptor;
char attrType;
char* attrName;
int attrLength;
int flag;
// number of records that our hash index has
char hash;
int record_num;
int bucket_num;
} HT_info;
int HT_CreateIndex( char *indexname, /* όνομα αρχείου */
char attrType, /* τύπος πεδίου-κλειδιού: 'c', 'i' */
char* attrName, /* όνομα πεδίου-κλειδιού */
int attrLength, /* μήκος πεδίου-κλειδιού */
int bucketnum
);
HT_info* HT_OpenIndex( char *indexName /* όνομα αρχείου */ );
int HT_CloseIndex( HT_info* header_info );
int HT_InsertEntry( HT_info header_info, /* επικεφαλίδα του αρχείου*/ Record record /* δομή που
//προσδιορίζει την εγγραφή */ );
void HT_GetAllEntries(HT_info header_info, void* value);
unsigned int hash(unsigned char *str);
int HashStatistics( char* filename /* όνομα του αρχείου που ενδιαφέρει */ );
int HT_DeleteEntry( HT_info header_info,void *value);
void Print_AllEntries(HT_info *header_info);
#endif // HASH_INDEX_H