ScummVM API documentation
words_dictionary.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 AGS_SHARED_AC_WORDS_DICTIONARY_H
23
#define AGS_SHARED_AC_WORDS_DICTIONARY_H
24
25
#include "common/std/vector.h"
26
#include "ags/shared/core/types.h"
27
#include "ags/shared/util/string.h"
28
29
namespace
AGS3
{
30
31
namespace
AGS
{
32
namespace
Shared {
33
class
Stream;
34
}
// namespace Shared
35
}
// namespace AGS
36
37
using namespace
AGS
;
// FIXME later
38
39
#define MAX_PARSER_WORD_LENGTH 30
40
#define ANYWORD 29999
41
#define RESTOFLINE 30000
42
43
struct
WordsDictionary
{
44
int
num_words;
45
char
**word;
46
short
*wordnum;
47
48
WordsDictionary
();
49
~
WordsDictionary
();
50
void
allocate_memory(
int
wordCount);
51
void
free_memory();
52
void
sort
();
53
int
find_index(
const
char
*);
54
};
55
56
// Decrypts text found in the given buffer, writes back to the same buffer
57
extern
void
decrypt_text(
char
*buf,
size_t
buf_sz);
58
// Reads an encrypted string from the stream and decrypts into the provided buffer
59
extern
void
read_string_decrypt(
Shared::Stream
*in,
char
*buf,
size_t
buf_sz);
60
// Reads an encrypted string from the stream and returns as a string;
61
// uses provided vector as a temporary decryption buffer (avoid extra allocs)
62
extern
Shared::String
read_string_decrypt(
Shared::Stream
*in,
std::vector<char>
&dec_buf);
63
extern
void
read_dictionary(
WordsDictionary
*dict,
Shared::Stream
*in);
64
65
#if defined (OBSOLETE)
66
// TODO: not a part of wordsdictionary, move to obsoletes
67
extern
void
freadmissout(
short
*pptr,
Shared::Stream
*in);
68
#endif
69
70
extern
void
encrypt_text(
char
*toenc);
71
extern
void
write_string_encrypt(
Shared::Stream
*out,
const
char
*s);
72
extern
void
write_dictionary(
WordsDictionary
*dict,
Shared::Stream
*out);
73
74
}
// namespace AGS3
75
76
#endif
AGS
Definition:
achievements_tables.h:27
Std::vector< char >
AGS3::WordsDictionary
Definition:
words_dictionary.h:43
AGS3::AGS::Shared::String
Definition:
string.h:62
AGS3::AGS::Shared::Stream
Definition:
stream.h:52
Common::sort
void sort(T first, T last, StrictWeakOrdering comp)
Definition:
algorithm.h:349
AGS3
Definition:
ags.h:40
engines
ags
shared
ac
words_dictionary.h
Generated on Wed Sep 3 2025 09:07:27 for ScummVM API documentation by
1.8.13