libenigma
Enigma machine utility library
Loading...
Searching...
No Matches
io.h
Go to the documentation of this file.
1
6#ifndef ENIGMA_IO_H
7#define ENIGMA_IO_H
8
9#include "crack.h"
10#include "enigma.h"
11
15#define ENIGMA_ERROR(fmt, ...) enigma_error_message(__func__, fmt, __VA_ARGS__)
16
20static const char* enigma_invalid_argument_message = "Invalid argument provided.";
21
22int enigma_error_message(const char*, const char*, ...);
23int enigma_load_config(Enigma*, const char*);
24int enigma_load_custom_reflector(EnigmaReflector*, const char*, const char*);
25int enigma_load_custom_rotor(EnigmaRotor*, const char*, const char*, int*, int);
26int enigma_load_ngrams(EnigmaCrackParams*, const char*);
27int enigma_load_plugboard_config(Enigma*, const char*);
28int enigma_load_reflector_config(Enigma*, const char*);
30int enigma_load_rotor_positions(Enigma*, const char*);
31void enigma_print_config(const Enigma*, char*);
32
33#endif
int enigma_error_message(const char *, const char *,...)
Print an error message to stderr.
Definition: io.c:29
int enigma_load_rotor_positions(Enigma *, const char *)
Load rotor starting positions from a string.
Definition: io.c:293
int enigma_load_custom_rotor(EnigmaRotor *, const char *, const char *, int *, int)
Load a custom rotor alphabet from the given alphabet, name, and notches.
Definition: io.c:118
int enigma_load_ngrams(EnigmaCrackParams *, const char *)
Load ngrams from a file.
Definition: io.c:145
int enigma_load_config(Enigma *, const char *)
Load an Enigma machine configuration from a string.
Definition: io.c:54
int enigma_load_rotor_config(Enigma *, char *)
Load rotor configuration from a string.
Definition: io.c:259
void enigma_print_config(const Enigma *, char *)
Print the current Enigma machine configuration to out.
Definition: io.c:314
int enigma_load_reflector_config(Enigma *, const char *)
Load reflector configuration from a string.
Definition: io.c:241
int enigma_load_custom_reflector(EnigmaReflector *, const char *, const char *)
Load a custom reflector alphabet from the given alphabet and name.
Definition: io.c:95
int enigma_load_plugboard_config(Enigma *, const char *)
Load plugboard configuration from a string.
Definition: io.c:224
A structure representing a configuration for cracking an Enigma cipher.
Definition: crack.h:92
Represents a reflector configuration for the Enigma machine.
Definition: reflector.h:22
Represents a rotor configuration for the Enigma machine.
Definition: rotor.h:23
Represents the state and configuration of an Enigma machine.
Definition: enigma.h:34