Public function - see documentation comment in header file.
| 773 | |
| 774 | // Public function - see documentation comment in header file. |
| 775 | struct 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. |
nothing calls this directly
no test coverage detected