diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2019-01-25 11:26:25 +0100 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2019-01-25 11:26:25 +0100 |
| commit | f54a568880bf47c2ea54c9b30d291156b34d6539 (patch) | |
| tree | aab9bb44b306da7651e8caf38bbab5cfeeb81b7d /shared/systemd/src/basic/hexdecoct.h | |
| parent | e8ac7dacdcf4b38addef4f8ac6ab038f9d29582c (diff) | |
| parent | bbae86d3d2997a853ca0365e8eb7a3ca7489ee09 (diff) | |
Update upstream source from tag 'upstream/1.15.2'
Update to upstream version '1.15.2' with Debian dir b4be4b7cfce96679a31cb9d423107789761e3b49
Diffstat (limited to 'shared/systemd/src/basic/hexdecoct.h')
| -rw-r--r-- | shared/systemd/src/basic/hexdecoct.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/shared/systemd/src/basic/hexdecoct.h b/shared/systemd/src/basic/hexdecoct.h new file mode 100644 index 00000000..9477d16e --- /dev/null +++ b/shared/systemd/src/basic/hexdecoct.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include <stdbool.h> +#include <stddef.h> +#include <stdio.h> +#include <sys/types.h> + +#include "macro.h" + +char octchar(int x) _const_; +int unoctchar(char c) _const_; + +char decchar(int x) _const_; +int undecchar(char c) _const_; + +char hexchar(int x) _const_; +int unhexchar(char c) _const_; + +char *hexmem(const void *p, size_t l); +int unhexmem(const char *p, size_t l, void **mem, size_t *len); + +char base32hexchar(int x) _const_; +int unbase32hexchar(char c) _const_; + +char base64char(int x) _const_; +int unbase64char(char c) _const_; + +char *base32hexmem(const void *p, size_t l, bool padding); +int unbase32hexmem(const char *p, size_t l, bool padding, void **mem, size_t *len); + +ssize_t base64mem(const void *p, size_t l, char **out); +int base64_append(char **prefix, int plen, + const void *p, size_t l, + int margin, int width); +int unbase64mem(const char *p, size_t l, void **mem, size_t *len); + +void hexdump(FILE *f, const void *p, size_t s); |