Files
utun2/tools/chatgui/zxing-cpp/core/src/ECI.h
T
evgeny 38c9f229bc stcp: ed25519 pubkey exchange in handshake, fix instance destroy segfault, fix chat_tcp_test
- u_async.c: process immediate_queue BEFORE epoll_wait in uasync_poll
- stcp_link.c: defensive NULL etcp_conn/etcp_link in stcp_link_close
- utun_instance.c: move stcp_server_list_destroy_all to Phase J (before ETCP),
  add deferred drain in both Phase J and L
- stcp.h/c: STCP_HS_ENC_CLIENT 6→38, STCP_HS_ENC_SERVER 7→39,
  exchange ed25519_pubkey in both handshake directions
- etcp_connections.c: copy peer_ed25519 from STCP to ETCP_CONN in
  etcp_link_enter_ready_tcp; guard link->etcp in tcp_link_close_cb
- chat_sync.c: fix lk->conn NULL dereference for TCP links
- test_stcp.c: update stcp_server_create/stcp_client_connect callsites
- tools/chat_tcp_test: change transport udp→tcp
2026-08-07 00:48:27 +03:00

79 lines
1.4 KiB
C++

/*
* Copyright 2022 Axel Waggershauser
*/
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "CharacterSet.h"
#include <string>
namespace ZXing {
enum class ECI : int
{
Unknown = -1,
Cp437 = 2, // obsolete
ISO8859_1 = 3,
ISO8859_2 = 4,
ISO8859_3 = 5,
ISO8859_4 = 6,
ISO8859_5 = 7,
ISO8859_6 = 8,
ISO8859_7 = 9,
ISO8859_8 = 10,
ISO8859_9 = 11,
ISO8859_10 = 12,
ISO8859_11 = 13,
ISO8859_13 = 15,
ISO8859_14 = 16,
ISO8859_15 = 17,
ISO8859_16 = 18,
Shift_JIS = 20,
Cp1250 = 21,
Cp1251 = 22,
Cp1252 = 23,
Cp1256 = 24,
UTF16BE = 25,
UTF8 = 26,
ASCII = 27,
Big5 = 28,
GB2312 = 29,
EUC_KR = 30,
GB18030 = 32,
UTF16LE = 33,
UTF32BE = 34,
UTF32LE = 35,
ISO646_Inv = 170,
Binary = 899
};
inline constexpr int ToInt(ECI eci)
{
return static_cast<int>(eci);
}
inline constexpr bool IsText(ECI eci)
{
return ToInt(eci) >= 0 && ToInt(eci) <= 170;
}
inline constexpr bool CanProcess(ECI eci)
{
// see https://github.com/zxing-cpp/zxing-cpp/commit/d8587545434d533c4e568181e1c12ef04a8e42d9#r74864359
return ToInt(eci) <= 899;
}
/**
* @brief ToString converts the numerical ECI value to a 7 character string as used in the ECI protocol
* @return e.g. "\000020"
*/
std::string ToString(ECI eci);
CharacterSet ToCharacterSet(ECI eci);
ECI ToECI(CharacterSet cs);
} // namespace ZXing