]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/qrcode-util.h
cryptenroll: allow to use a public key on a token
[thirdparty/systemd.git] / src / shared / qrcode-util.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2
3 #pragma once
4 #include <stdio.h>
5 #include <errno.h>
6 #include <limits.h>
7
8 #if HAVE_QRENCODE
9 int dlopen_qrencode(void);
10
11 int print_qrcode_full(FILE *out, const char *header, const char *string, unsigned row, unsigned column, unsigned tty_width, unsigned tty_height);
12 static inline int print_qrcode(FILE *out, const char *header, const char *string) {
13 return print_qrcode_full(out, header, string, UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX);
14 }
15 #else
16 static inline int print_qrcode_full(FILE *out, const char *header, const char *string, unsigned row, unsigned column, unsigned tty_width, unsigned tty_height) {
17 return -EOPNOTSUPP;
18 }
19 static inline int print_qrcode(FILE *out, const char *header, const char *string) {
20 return -EOPNOTSUPP;
21 }
22 #endif