MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / qrcodegen_makeBytes

Function qrcodegen_makeBytes

modules/data/qrcode/qrcodegen.c:775–786  ·  view source on GitHub ↗

Public function - see documentation comment in header file.

Source from the content-addressed store, hash-verified

773
774// Public function - see documentation comment in header file.
775struct qrcodegen_Segment qrcodegen_makeBytes(const uint8_t data[], size_t len, uint8_t buf[]) {
776 assert(data != NULL || len == 0);
777 struct qrcodegen_Segment result;
778 result.mode = qrcodegen_Mode_BYTE;
779 result.bitLength = calcSegmentBitLength(result.mode, len);
780 assert(result.bitLength != -1);
781 result.numChars = (int)len;
782 if (len > 0)
783 c_memcpy(buf, data, len * sizeof(buf[0]));
784 result.data = buf;
785 return result;
786}
787
788
789// Public function - see documentation comment in header file.

Callers

nothing calls this directly

Calls 2

calcSegmentBitLengthFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected