summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md23
1 files changed, 23 insertions, 0 deletions
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 <err.h>. 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.