]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/hexdecoct.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
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 int unbase64char(char c
) _const_
;
32 char *base32hexmem(const void *p
, size_t l
, bool padding
);
33 int unbase32hexmem(const char *p
, size_t l
, bool padding
, void **mem
, size_t *len
);
35 ssize_t
base64mem(const void *p
, size_t l
, char **out
);
36 int base64_append(char **prefix
, int plen
,
37 const void *p
, size_t l
,
38 int margin
, int width
);
39 int unbase64mem_full(const char *p
, size_t l
, bool secure
, void **mem
, size_t *len
);
40 static inline int unbase64mem(const char *p
, size_t l
, void **mem
, size_t *len
) {
41 return unbase64mem_full(p
, l
, false, mem
, len
);
44 void hexdump(FILE *f
, const void *p
, size_t s
);