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

Function WriteName

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

Source from the content-addressed store, hash-verified

419 }
420
421 static void WriteName(std::vector<uint8_t>* buffer, const char* name)
422 {
423 const char* cursor = name;
424 while (*cursor)
425 {
426 char label[63];
427 uint32_t label_len = 0;
428 while (*cursor && *cursor != '.')
429 {
430 ASSERT_TRUE(label_len < sizeof(label));
431 ASSERT_TRUE(DecodeEscapedChar(&cursor, &label[label_len]));
432 ++label_len;
433 }
434 buffer->push_back((uint8_t) label_len);
435 buffer->insert(buffer->end(), label, label + label_len);
436 if (*cursor == '.')
437 ++cursor;
438 }
439 buffer->push_back(0);
440 }
441
442 static bool ReadU16(const uint8_t* data, uint32_t size, uint32_t* offset, uint16_t* out)
443 {

Callers 1

BuildQueryPacketFunction · 0.70

Calls 4

DecodeEscapedCharFunction · 0.70
push_backMethod · 0.45
insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected