-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdictutil.h
116 lines (97 loc) · 3.5 KB
/
dictutil.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
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
/*
dictutil.h
UltraRogue: The Ultimate Adventure in the Dungeons of Doom
Copyright (C) 1995 Herb Chong
All rights reserved.
See the file LICENSE.TXT for full copyright and licensing information.
*/
/****************************************************************/
/* HEADERS FOR DICTIONARY MAINTENENCE ROUTINE UTILITIES */
/****************************************************************/
#ifndef dictutil_h_included
#define dictutil_h_included
static char dictutil_sccsid[] = "%W% %G%";
#include <stdio.h>
#include "dict.h"
/*-------------------------------
Binary read of a block of bytes
-------------------------------*/
extern int block_read(
FILE *fi,
char *buffer,
size_t count,
long offset );
/*--------------------------------
Binary write of a block of bytes
--------------------------------*/
extern int block_write(
FILE *fo,
char *buffer,
size_t count );
/*--------------------------------------
Compute a checksum of a block of bytes
--------------------------------------*/
extern unsigned long compute_checksum(
size_t size,
char *block );
/*-----------------------------------------------------------------
Load a block of bytes from a compiled dictionary file into memory
-----------------------------------------------------------------*/
extern void *dict_load_block(
DICTIONARY *dict,
char *toc_id,
FILE *fi,
void *block );
/*-----------------------------------
Create a dictionary parameter entry
-----------------------------------*/
extern DICT_PARM_ENTRY *dict_make_parm_entry(
char *id,
unsigned long value );
/*------------------------------------
Look up an id in the parameter array
------------------------------------*/
extern int dict_parm_index(
DICTIONARY *dict,
char *parm_id );
/*-------------------------------
Reset table of contents offsets
-------------------------------*/
extern BOOLEANC dict_reset_toc_offsets(
DICTIONARY *dict );
/*-----------------------------------------------------------------
Save a block of bytes from memory into a compiled dictionary file
-----------------------------------------------------------------*/
extern BOOLEANC dict_save_block(
DICTIONARY *dict,
char *toc_id,
FILE *fo );
/*--------------------------------------------------------------------
Set the dictionary parm values from the values in the dict structure
--------------------------------------------------------------------*/
extern BOOLEANC dict_set_parm_values(
DICTIONARY *dict );
/*--------------------------------------------------------------------
Set the values in the dict structure from the dictionary parm values
--------------------------------------------------------------------*/
extern BOOLEANC dict_set_parm_variables(
DICTIONARY *dict );
/*---------------------------
Set the dictionary parm ids
---------------------------*/
extern BOOLEANC dict_set_parm_ids(
DICTIONARY *dict );
/*--------------------------------------
Look up an id in the table of contents
--------------------------------------*/
extern int dict_toc_index(
DICTIONARY *dict,
char *toc_id );
/*------------------------------------
Record and error and abort if needed
------------------------------------*/
extern void signal_error(
char *header,
char *message,
int severity );
#endif