MCPcopy Create free account
hub / github.com/defold/defold / DecodeEscapedChar

Function DecodeEscapedChar

engine/dlib/src/test/test_mdns.cpp:310–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308 }
309
310 static bool DecodeEscapedChar(const char** cursor, char* out)
311 {
312 if (**cursor != '\\')
313 {
314 *out = **cursor;
315 ++(*cursor);
316 return true;
317 }
318
319 ++(*cursor);
320 if (**cursor == 0)
321 return false;
322
323 if (IsDigit((*cursor)[0]) && IsDigit((*cursor)[1]) && IsDigit((*cursor)[2]))
324 {
325 *out = (char) ((((*cursor)[0] - '0') * 100) + (((*cursor)[1] - '0') * 10) + ((*cursor)[2] - '0'));
326 *cursor += 3;
327 return true;
328 }
329
330 *out = **cursor;
331 ++(*cursor);
332 return true;
333 }
334
335 static void EscapeDnsText(const char* value, char* out, uint32_t out_size)
336 {

Callers 3

NameWireLengthFunction · 0.70
WriteNameFunction · 0.70
WriteNameCompressedFunction · 0.70

Calls 1

IsDigitFunction · 0.70

Tested by

no test coverage detected