]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/qrcode-util.h
7c9bb498931cacb52862cdec9a7d2b10775eaac2
[thirdparty/systemd.git] / src / shared / qrcode-util.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include "forward.h"
5
6 #if HAVE_QRENCODE
7 int dlopen_qrencode(void);
8
9 int print_qrcode_full(
10 FILE *out,
11 const char *header,
12 const char *string,
13 unsigned row,
14 unsigned column,
15 unsigned tty_width,
16 unsigned tty_height,
17 bool check_tty);
18 #else
19 static inline int print_qrcode_full(
20 FILE *out,
21 const char *header,
22 const char *string,
23 unsigned row,
24 unsigned column,
25 unsigned tty_width,
26 unsigned tty_height,
27 bool check_tty) {
28 return -EOPNOTSUPP;
29 }
30 #endif
31
32 static inline int print_qrcode(FILE *out, const char *header, const char *string) {
33 return print_qrcode_full(out, header, string, UINT_MAX, UINT_MAX, UINT_MAX, UINT_MAX, true);
34 }