f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering This file is part of systemd.
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering Copyright 2012 Lennart Poettering
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering systemd is free software; you can redistribute it and/or modify it
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering under the terms of the GNU Lesser General Public License as published by
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering (at your option) any later version.
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering systemd is distributed in the hope that it will be useful, but
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering Lesser General Public License for more details.
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering You should have received a copy of the GNU Lesser General Public License
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poetteringstatic void print_border(FILE *output, unsigned width) {
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering unsigned x, y;
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering /* Four rows of border */
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering unsigned x, y;
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering for (i = 0; i < seed_size; i++) {
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering if (i > 0 && i % 3 == 0)
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering fprintf(f, "%02x", ((uint8_t*) seed)[i]);
507f22bd0172bff5e5d98145b1419bd472a2c57fZbigniew Jędrzejewski-Szmek fprintf(f, "/%"PRIx64"-%"PRIx64"?machine=" SD_ID128_FORMAT_STR,
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering qr = QRcode_encodeString(url, 0, QR_ECLEVEL_L, QR_MODE_8, 1);
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering for (y = 0; y < (unsigned) qr->width; y += 2) {
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering for (x = 0; x < 4; x++)
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering for (x = 0; x < (unsigned) qr->width; x ++) {
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering b = (y+1) < (unsigned) qr->width ? (row2[x] & 1) : false;
f6a971bc0bf1252e9614919ccca0d53db5fc53d9Lennart Poettering for (x = 0; x < 4; x++)