-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,57 @@ import std.string : split; | |
import core.stdc.string : memset; | ||
import ddhx; | ||
|
||
/// Copyright string | ||
enum COPYRIGHT = "Copyright (c) 2017-2022 dd86k <[email protected]>"; | ||
|
||
/// App version | ||
enum VERSION = "0.4.1"; | ||
|
||
/// Version line | ||
enum ABOUT = "ddhx " ~ VERSION ~ " (built: " ~ __TIMESTAMP__~")"; | ||
|
||
// | ||
// SECTION Input structure | ||
// | ||
|
||
// !SECTION | ||
|
||
/// Number type to render either for offset or data | ||
enum NumberType { | ||
hexadecimal, | ||
decimal, | ||
octal | ||
} | ||
|
||
/// Character translation | ||
enum CharType { | ||
ascii, /// 7-bit US-ASCII | ||
cp437, /// IBM PC CP-437 | ||
ebcdic, /// IBM EBCDIC Code Page 37 | ||
mac, /// Mac OS Roman | ||
// gsm, /// GSM 03.38 | ||
} | ||
|
||
//TODO: --no-header: bool | ||
//TODO: --no-offset: bool | ||
//TODO: --no-status: bool | ||
/// Global definitions and default values | ||
// Aren't all of these engine settings anyway? | ||
struct Globals { | ||
// Settings | ||
ushort rowWidth = 16; /// How many bytes are shown per row | ||
NumberType offsetType; /// Current offset view type | ||
NumberType dataType; /// Current data view type | ||
CharType charType; /// Current charset | ||
char defaultChar = '.'; /// Default character to use for non-ascii characters | ||
// int include; /// Include what panels | ||
// Internals | ||
TerminalSize termSize; /// Last known terminal size | ||
} | ||
|
||
__gshared Globals globals; /// Single-instance of globals. | ||
__gshared Io io; /// File/stream I/O instance. | ||
|
||
int printError() { | ||
stderr.write("error: "); | ||
stderr.writeln(errorMsg); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ module ddhx; | |
|
||
public import | ||
ddhx.ddhx, | ||
ddhx.common, | ||
ddhx.command, | ||
ddhx.display, | ||
ddhx.error, | ||
|