libenigma
Enigma machine utility library
Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
1
6#ifndef ENIGMA_COMMON_H
7#define ENIGMA_COMMON_H
8
9#ifdef TEST
10#define ENIGMA_STATIC
11#else
12#define ENIGMA_STATIC static
13#endif
14
18#define ENIGMA_ALPHA_SIZE 26
19
23#define ENIGMA_MAX_ROTOR_COUNT 4
24
28#define ENIGMA_SUCCESS 0
29
33#define ENIGMA_FAILURE -1
34
35/* --- DEFAULTS --- */
36
40#define ENIGMA_MAX_PLUGBOARD_SETTINGS 10
41
47#define ENIGMA_DEFAULT_NGRAM_COUNT (26 * 26 * 26 * 26)
48
49/* --- LANGUAGES --- */
50
54#define ENIGMA_LANG_ENGLISH 0
55
59#define ENIGMA_LANG_GERMAN 1
60
61#ifndef ENIGMA_VERSION
65#define ENIGMA_VERSION "unknown"
66#endif
67
68#ifdef TEST
69#define ENIGMA_ALWAYS_INLINE
70#else
71#ifdef __GNUC__
72#define ENIGMA_ALWAYS_INLINE inline __attribute__((always_inline))
73#else
74#define ENIGMA_ALWAYS_INLINE inline
75#endif
76#endif
77
78#ifdef EMSCRIPTEN
79#include <emscripten.h>
80#else
81#ifndef EMSCRIPTEN_KEEPALIVE
82#define EMSCRIPTEN_KEEPALIVE
83#endif
84#endif
85
86#endif