Browse Source Download (without any required ccan dependencies)
err
err(), errx(), warn() and warnx(), as per BSD's err.h.
Rusty Russell <rusty@rustcorp.com.au>
A few platforms don't provide err.h; for those, this provides replacements. For most, it simple includes the system err.h.
Unfortunately, you have to call err_set_progname() to tell the replacements your program name, otherwise it prints "unknown program".
#include <ccan/err/err.h>
int main(int argc, char *argv[])
{
err_set_progname(argv[0]);
if (argc != 1)
errx(1, "Expect no arguments");
exit(0);
}
CC0 (Public domain)