From dce77a40507a20dbc8c4404339b630bd6f17cc4b Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 22 Apr 2022 17:38:39 -0400 Subject: add README --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5cd47c9 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +This header implements the functions from BSD's . In short: + +void warn(const char *fmt, ...); +void warnx(const char *fmt, ...); +void warnc(int code, const char *fmt, ...); + +Output a warning to stderr, consisting of the program name (as determined +by getprogname() -- if your system doesn't have this, you can use my +getprogname library, or #define getprogname() "you program's name"), followed +by printf() like output (if fmt is not NULL -- otherwise this portion is +skipped). Finally, warn() prints a string version of errno, and warnc() prints +the string if errno were code (warnx() simply returns after printf() handling). + +In addition to those: + +void err(int eval, const char *fmt, ...); +void errx(int eval, const char *fmt, ...); +void errc(int eval, const char *fmt, ...); + +These print the same output as above, and then exit with a status of eval. + +There are also versions of all of the above, prefixed with v, that take a +va_list parameter rather than variadic arguments. -- cgit v1.2.1