]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/hexdecoct.h
319b21a17c658d704ac36da111895fa2d01503d5
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
11 char octchar(int x
) _const_
;
12 int unoctchar(char c
) _const_
;
14 char decchar(int x
) _const_
;
15 int undecchar(char c
) _const_
;
17 char hexchar(int x
) _const_
;
18 int unhexchar(char c
) _const_
;
20 char *hexmem(const void *p
, size_t l
);
21 int unhexmem_full(const char *p
, size_t l
, bool secure
, void **mem
, size_t *len
);
22 static inline int unhexmem(const char *p
, size_t l
, void **mem
, size_t *len
) {
23 return unhexmem_full(p
, l
, false, mem
, len
);
26 char base32hexchar(int x
) _const_
;
27 int unbase32hexchar(char c
) _const_
;
29 char base64char(int x
) _const_
;
30 char urlsafe_base64char(int x
) _const_
;
31 int unbase64char(char c
) _const_
;
33 char *base32hexmem(const void *p
, size_t l
, bool padding
);
34 int unbase32hexmem(const char *p
, size_t l
, bool padding
, void **mem
, size_t *len
);
36 ssize_t
base64mem_full(const void *p
, size_t l
, size_t line_break
, char **ret
);
37 static inline ssize_t
base64mem(const void *p
, size_t l
, char **ret
) {
38 return base64mem_full(p
, l
, SIZE_MAX
, ret
);
41 ssize_t
base64_append(
48 int unbase64mem_full(const char *p
, size_t l
, bool secure
, void **mem
, size_t *len
);
49 static inline int unbase64mem(const char *p
, size_t l
, void **mem
, size_t *len
) {
50 return unbase64mem_full(p
, l
, false, mem
, len
);
53 void hexdump(FILE *f
, const void *p
, size_t s
);