diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-04-22 17:38:39 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-04-22 17:38:39 -0400 |
commit | dce77a40507a20dbc8c4404339b630bd6f17cc4b (patch) | |
tree | 41ecfe54f5c26ca97074f10fb3e180bc83b49531 /README.md | |
parent | 088672836ad3774c7ad89e2a4956531e063b6771 (diff) |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
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. |