aboutsummaryrefslogtreecommitdiffstats
path: root/pack.h
blob: a9b0ba442fefbe9fd7267e06cf47ea7eb63f2e49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * Copyright (C) 2020 Tomasz Kramkowski <tk@the-tk.com>
 * SPDX-License-Identifier: MIT
 */
#ifndef PACK_H
#define PACK_H

#include <stddef.h>

enum pack_status {
	PACK_OK,
	PACK_FMTINVAL,
	PACK_TOOSMALL,
};

extern enum pack_trace {
	PACK_TRACE_OFF,
	PACK_TRACE_CALL,
	PACK_TRACE_DEBUG,
	PACK_TRACE_ALL,
} pack_trace;

enum pack_status unpack(void *buf, size_t size, const char *fmt, ...);

const char *pack_strerror(enum pack_status status);

#endif // !PACK_H