Global Namespace

// namespaces

namespace doc;
namespace ias;
namespace io;
namespace iox;
namespace log;
namespace ui;
    namespace ui.ComboBoxHistory;

// enums

enum FpgaUploaderLogRecordCode;
enum SocketLogPartCode;
enum SocketLogRecordCode;
enum SshLogRecordCode;
bitflag enum TcpDisconnectLogRecordFlags;
enum WebSocketLogRecordCode;

// structs

struct IcmpActions;
struct Ip6Actions;
struct IpActions;
struct TcpActions;
struct TcpDisconnectLogRecordParams;
struct TcpUdpActionsBase;
struct UdpActions;

// classes

class LogDocument;

// global variables

log.Writer* const g_logWriter;

// global functions

void trace(string_t text);
void sendKeepAlive();
size_t getTransmitData(std.Buffer* buffer);
void clearLog();
bool errorcode connect();
void disconnect();

size_t errorcode transmit(
    void const* p,
    size_t size
);

size_t errorcode transmit(string_t text);

size_t errorcode receive(
    void* p,
    size_t size,
    uint_t timeout = -1
);

bool errorcode unreceive(
    void const* p,
    size_t size
);

size_t errorcode transmitAll(
    void const* p,
    size_t size
);

size_t errorcode transmitAll(string_t text);

size_t errorcode receiveAll(
    void* p,
    size_t size
);

size_t errorcode receiveAll(
    void* p,
    size_t size,
    uint_t timeout
);

bool errorcode dispatch(
    uint_t code,
    variant_t in = null,
    variant_t* out = null
);

variant_t dispatchGet(
    uint_t code,
    variant_t in = null
);

void main();

void pretransmit(
    void const* p,
    size_t size
);

void onLogRecord(
    uint64_t timestamp,
    uint64_t recordCode,
    void const* p,
    size_t size
);

uint16_t crc16_ansi(
    void const* p,
    size_t size,
    uint16_t seed = 0
);

uint16_t crc16_ccitt(
    void const* p,
    size_t size,
    uint16_t seed = 0
);

uint32_t crc32(
    void const* p,
    size_t size,
    uint32_t seed = 0
);

uint8_t crc8_ccitt(
    void const* p,
    size_t size,
    uint8_t seed = 0
);

uint8_t lrc(
    void const* p,
    size_t size
);

char findEscapeReplaceChar(char x);

size_t decodeEscapeString(
    std.StringBuilder* string,
    string_t source
);

string_t formatIntegerWithThousandSep(
    uint64_t value,
    char sep = ','
);

string_t formatFileSize(uint64_t size);
bool isspace(char c);

size_t decodeHexString(
    std.Buffer* buffer,
    string_t source
);

uint16_t calcIp4Checksum(
    void const* p0,
    size_t size,
    uint16_t seed = 0,
    bool isOddSeed = false
);

uint16_t finalizeIp4Checksum(uint16_t checksum);

size_t errorcode loadFile(
    std.Buffer* buffer,
    string_t fileName
);

uint64_t sum8(
    void const* p,
    size_t size,
    uint64_t seed = 0
);

uint8_t xor8(
    void const* p,
    size_t size,
    uint8_t seed = 0
);

uint_t parseVersion(string_t string);

bool wildcardCompareStringLowerCase(
    char const thin* string0,
    char const thin* wildcard
);

void layoutEthernetFrame(jnc.DynamicLayout* layout);

uint_t calcChecksum16(
    void const* p0,
    size_t size
);

uint16_t adjustIpChecksum(uint_t checksum);
uint16_t calcIpHdrChecksum(io.IpHdr const* ipHdr);

uint16_t calcTcpUdpChecksum(
    io.IpHdr const* ipHdr,
    void const* p,
    size_t size
);

void async layoutModbusRtuRequest(jnc.DynamicLayout* layout);
void async layoutModbusRtuReply(jnc.DynamicLayout* layout);
void async layoutModbusTcpRequest(jnc.DynamicLayout* layout);
void async layoutModbusTcpReply(jnc.DynamicLayout* layout);
char const* detectJLinkLibPath();