ScummVM API documentation
vocab.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef MADS_CORE_VOCAB_H
23#define MADS_CORE_VOCAB_H
24
25#include "mads/core/general.h"
26
27namespace MADS {
28
29#define vocab_version "1.01"
30#define vocab_date "13-Jun-91"
31
32#define VOCAB_MAX_ACTIVE 200
33
34
35#define VC_MAXWORDS 1200 /* Maximum words in vocabulary */
36
37#define VC_MAXWORDLEN 20 /* Maximum word length */
38
39#define VC_FUDGEFACTOR 50 /* Number of words slack space */
40
41#define VC_MAINFILENAME "*VOCAB.DB"
42#define VC_HARDFILENAME "*VOCABH.DB"
43
44#define VC_ERR_OPENMAINFILE -1 /* Failed to open main file */
45#define VC_ERR_OPENHARDFILE -2 /* Failed to open hard file */
46#define VC_ERR_READMAINFILE -3 /* Read error on main file */
47#define VC_ERR_READHARDFILE -4 /* Read error on hard file */
48#define VC_ERR_WORDTOOLONG -5 /* Max. word length exceeded */
49#define VC_ERR_SYNTAXHARDFILE -6 /* Improper format hard file */
50#define VC_ERR_NOMOREMEMORY -7 /* Failed to allocate memory */
51#define VC_ERR_MEMORYOVERFLOW -8 /* No memory to add a word */
52#define VC_ERR_WORDALREADYEXISTS -9 /* Word alread in vocab list */
53#define VC_ERR_WRITEMAINFILE -10 /* Failed to write main file */
54#define VC_ERR_RENAMEOUTFILE -11 /* Failed to rename out file */
55#define VC_ERR_TOOMANYWORDS -12 /* VC_MAXWORDS exceeded */
56#define VC_ERR_NOSUCHWORD -13 /* Word not in list */
57
58
59extern int vocab_allocation;
60extern char *vocab;
61extern int vocab_emergency;
62
63extern char *vocab_text;
64extern bool vocab_active;
65extern word vocab_list_id[VOCAB_MAX_ACTIVE];
66extern word vocab_list_pointer[VOCAB_MAX_ACTIVE];
67
68extern int vocab_destroy();
69extern int vocab_load(int allocation_flag);
70extern int vocab_get_code(char *inp);
71extern char *vocab_get_word(char *out, int inp);
72
73extern void vocab_report_error(int number);
74extern char *vocab_select_word(char *out, const char *prompt, const char *default_word);
75extern void vocab_unload_active();
76extern void vocab_clear_active();
77extern int vocab_make_active(int id);
78extern int vocab_load_active();
79extern char *vocab_string(int vocab_id);
80
81extern void init_vocab();
82
83} // namespace MADS
84
85#endif