MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Convert_TryCodepointToCP437

Function Convert_TryCodepointToCP437

src/String.c:552–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550}
551
552cc_bool Convert_TryCodepointToCP437(cc_codepoint cp, char* c) {
553 int i;
554 if (cp >= 0x20 && cp < 0x7F) { *c = (char)cp; return true; }
555 if (cp >= 0x1F000) cp = ReduceEmoji(cp);
556
557 for (i = 0; i < Array_Elems(controlChars); i++) {
558 if (controlChars[i] == cp) { *c = i; return true; }
559 }
560 for (i = 0; i < Array_Elems(extendedChars); i++) {
561 if (extendedChars[i] == cp) { *c = i + 0x7F; return true; }
562 }
563
564 *c = '?'; return false;
565}
566
567int Convert_Utf8ToCodepoint(cc_codepoint* cp, const cc_uint8* data, cc_uint32 len) {
568 *cp = '\0';

Callers 8

MapKeysFunction · 0.85
OnKeyPressFunction · 0.85
String_DecodeCP1252Function · 0.85
OnKeyPressFunction · 0.85
Convert_CodepointToCP437Function · 0.85
String_AppendUtf16Function · 0.85
String_AppendUtf8Function · 0.85
String_AppendCP1252Function · 0.85

Calls 1

ReduceEmojiFunction · 0.85

Tested by

no test coverage detected