1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
# libqrencode `libqrencode/`
> **Type**: QR Code Generation Library
> **License**: LGPL-2.1-or-later
> **Fork Origin**: [GitHub](https://github.com/fukuchi/libqrencode)
> **Status**: Detached Fork (independently maintained)
> **Standards**: ISO/IEC 18004:2015
> **Latest Version**: 0.0.5-1
---
## Overview
libqrencode is a fast and compact library for encoding data into a QR Code symbol. It supports the full range of QR Code functionality as defined by the ISO standard.
ProjT Launcher maintains a fork of libqrencode for controlled integration and monorepo CI compatibility.
---
## Usage in ProjT Launcher
libqrencode is used for:
- **Account linking** — Microsoft account QR authentication
- **Share URLs** — Quick sharing of instance/mod links
- **Export/Import** — Instance configuration sharing
---
## Features
| Feature | Status |
|---------|--------|
| QR Code Model 1 & 2 | ✅ |
| Micro QR Code | ✅ |
| All error correction levels | ✅ |
| Structured append | ✅ |
| 8-bit byte mode | ✅ |
| Kanji mode | ✅ |
| ECI mode | ✅ |
### Error Correction Levels
| Level | Recovery | Use Case |
|-------|----------|----------|
| L | ~7% | High density |
| M | ~15% | Standard (default) |
| Q | ~25% | Industrial |
| H | ~30% | Critical data |
---
## Build Instructions
### Prerequisites
- **CMake 3.10+** or **Autotools**
- **C99 compiler** (GCC, Clang, MSVC)
- **libpng** (optional, for PNG output)
### CMake Build
```bash
cd libqrencode
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
ctest -V
```
### Autotools Build
```bash
cd libqrencode
./autogen.sh
./configure
make
make check
```
### CMake Options
| Option | Description | Default |
|--------|-------------|---------|
| `WITH_TOOLS` | Build qrencode CLI tool | `ON` |
| `WITH_PNG` | Enable PNG support | `ON` |
| `WITH_TESTS` | Build test suite | `ON` |
| `BUILD_SHARED_LIBS` | Build shared library | `ON` |
---
## API Usage
### Basic Example
```c
#include <qrencode.h>
#include <stdio.h>
int main() {
QRcode *qr = QRcode_encodeString("https://projecttick.org",
0, // Version (0 = auto)
QR_ECLEVEL_M, // Error correction
QR_MODE_8, // Encoding mode
1); // Case sensitive
if (qr == NULL) {
fprintf(stderr, "Failed to encode\n");
return 1;
}
// Access the QR code data
printf("Version: %d\n", qr->version);
printf("Width: %d\n", qr->width);
// qr->data contains the QR code matrix
// Each byte: bit 0 = module (1=black, 0=white)
QRcode_free(qr);
return 0;
}
```
### Structured Append (Large Data)
```c
// Split data across multiple QR codes
QRcode_List *list = QRcode_encodeStringStructured(
large_data, 0, QR_ECLEVEL_M, QR_MODE_8, 1);
for (QRcode_List *entry = list; entry != NULL; entry = entry->next) {
// Process each QR code in sequence
process_qrcode(entry->code);
}
QRcode_List_free(list);
```
---
## Command Line Tool
The `qrencode` CLI tool creates QR code images:
```bash
# Generate PNG
qrencode -o output.png "Hello World"
# Generate SVG
qrencode -t SVG -o output.svg "https://projecttick.org"
# Generate ASCII art
qrencode -t ASCII "Hello World"
# Specify error correction level
qrencode -l H -o secure.png "Sensitive Data"
```
### Output Formats
- PNG (requires libpng)
- EPS
- SVG
- ANSI terminal
- ASCII art
- UTF-8 terminal
---
## Documentation
| Resource | Location |
|----------|----------|
| API Reference | `libqrencode/qrencode.h` |
| Man Page | `libqrencode/qrencode.1.in` |
| [Original README](../../libqrencode/README.md) | Upstream library documentation |
---
## Testing
```bash
cd libqrencode/build
ctest -V
# Or with autotools
cd libqrencode
make check
```
See [ci-libqrencode.yml](../../.github/workflows/ci-libqrencode.yml) for CI configuration.
---
## Copyright & Licensing
```
Copyright (C) 2006-2017 Kentaro Fukuchi <kentaro@fukuchi.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
```
Full license: `libqrencode/COPYING`
---
## Related Documentation
- [Third-party Libraries](./third-party.md) — All dependencies
---
## External Links
- [libqrencode GitHub](https://github.com/fukuchi/libqrencode)
- [ISO/IEC 18004](https://www.iso.org/standard/62021.html) — QR Code standard
- [QR Code Wikipedia](https://en.wikipedia.org/wiki/QR_code)
- [ZXing](https://github.com/zxing/zxing) — QR Code reading library
|