]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/hexdecoct.h
tree-wide: remove Emacs lines from all files
[thirdparty/systemd.git] / src / basic / hexdecoct.h
CommitLineData
e4e73a63
LP
1#pragma once
2
3/***
4 This file is part of systemd.
5
6 Copyright 2010 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
22#include <stdbool.h>
11c3a366 23#include <stddef.h>
e4e73a63
LP
24#include <stdio.h>
25#include <sys/types.h>
26
27#include "macro.h"
28
29char octchar(int x) _const_;
30int unoctchar(char c) _const_;
31
32char decchar(int x) _const_;
33int undecchar(char c) _const_;
34
35char hexchar(int x) _const_;
36int unhexchar(char c) _const_;
37
38char *hexmem(const void *p, size_t l);
39int unhexmem(const char *p, size_t l, void **mem, size_t *len);
40
41char base32hexchar(int x) _const_;
42int unbase32hexchar(char c) _const_;
43
44char base64char(int x) _const_;
45int unbase64char(char c) _const_;
46
47char *base32hexmem(const void *p, size_t l, bool padding);
48int unbase32hexmem(const char *p, size_t l, bool padding, void **mem, size_t *len);
49
d7671a3e
ZJS
50ssize_t base64mem(const void *p, size_t l, char **out);
51int base64_append(char **prefix, int plen,
52 const void *p, size_t l,
53 int margin, int width);
e4e73a63
LP
54int unbase64mem(const char *p, size_t l, void **mem, size_t *len);
55
56void hexdump(FILE *f, const void *p, size_t s);