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