Public function - see documentation comment in header file.
| 856 | |
| 857 | // Public function - see documentation comment in header file. |
| 858 | struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]) { |
| 859 | struct qrcodegen_Segment result; |
| 860 | result.mode = qrcodegen_Mode_ECI; |
| 861 | result.numChars = 0; |
| 862 | result.bitLength = 0; |
| 863 | if (0 <= assignVal && assignVal < (1 << 7)) { |
| 864 | memset(buf, 0, 1 * sizeof(buf[0])); |
| 865 | appendBitsToBuffer(assignVal, 8, buf, &result.bitLength); |
| 866 | } else if ((1 << 7) <= assignVal && assignVal < (1 << 14)) { |
| 867 | memset(buf, 0, 2 * sizeof(buf[0])); |
| 868 | appendBitsToBuffer(2, 2, buf, &result.bitLength); |
| 869 | appendBitsToBuffer(assignVal, 14, buf, &result.bitLength); |
| 870 | } else if ((1 << 14) <= assignVal && assignVal < 1000000L) { |
| 871 | memset(buf, 0, 3 * sizeof(buf[0])); |
| 872 | appendBitsToBuffer(6, 3, buf, &result.bitLength); |
| 873 | appendBitsToBuffer(assignVal >> 10, 11, buf, &result.bitLength); |
| 874 | appendBitsToBuffer(assignVal & 0x3FF, 10, buf, &result.bitLength); |
| 875 | } else |
| 876 | assert(false); |
| 877 | result.data = buf; |
| 878 | return result; |
| 879 | } |
| 880 | |
| 881 | |
| 882 | // Public function - see documentation comment in header file. |
nothing calls this directly
no test coverage detected