aboutsummaryrefslogtreecommitdiff
path: root/include/errors.h
blob: 00fe6dca78510927abcf3d30126cc62db479236e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef MLIB_ERRORS_H
#define MLIB_ERRORS_H

#include <stdarg.h>

void setprogname(const char *);

[[gnu::format(printf, 1, 2)]] void warn(const char *, ...);
[[gnu::format(printf, 1, 2)]] void warnx(const char *, ...);
void vwarn(const char *, va_list);
void vwarnx(const char *, va_list);

[[noreturn, gnu::format(printf, 1, 2)]] void err(const char *, ...);
[[noreturn, gnu::format(printf, 1, 2)]] void errx(const char *, ...);
[[noreturn, gnu::format(printf, 2, 3)]] void cerr(int, const char *, ...);
[[noreturn, gnu::format(printf, 2, 3)]] void cerrx(int, const char *, ...);

extern const char *__mlib_errors_progname;

#define progname() (__mlib_errors_progname)

#endif /* !MLIB_ERRORS_H */