limb 0.2.0

2024-01-09

output.h(0)
limb manual
output.h(0)

NAME

output.h - writing to stdout/stderr

SYNOPSIS

#include <limb/output.h>

const char *PROG

DESCRIPTION

This header defines functions used to write messages/warnings to stdout or stderr.

Most of the following are implemented as macros to obuffer_putmsg(3), using either obuffer_1 or obuffer_2. Messages can also end up written to other output buffers if they were attached. For more, refer to obuffer.h(0).

Functions

The following functions/macros are defined :

add(3)

Write given strings to stdout buffers with level OLVL_NORMAL or more

adde(3)

Write given strings to stderr buffers with level OLVL_NORMAL or more

dbg(3)

Write given strings to stdout buffers with level OLVL_DEBUG or more, prefixing with function name, file name and line number, adding a LF and flushing the buffer afterwards

dbgverb(3)

Same as dbg(3) but with OLVL_MAXIMUM

die(3)

Same as errdie(3) but prefixed with "PROG: "

diecmdusage(3)

Same as dieusage(3) but adds the command's name and usage.

diecmdhelp(3)

Same as diehelp(3) but adds the command's name, usage and show its help screen.

dief(3)

Same as die(3) but with an extra "fatal: "

diefu(3)

Same as dief(3) but with an extra "unable to "

diesys(3)

Same as sysdie(3) but prefixed with "PROG: "

diefsys(3)

Same as diesys(3) but with an extra "fatal: "

diefusys(3)

Same as diefsys(3) but with an extra "unable to "

diehelp(3)

Write given usage string to stderr prefixed with "usage: PROG ", a blank line, then the help string; and end program execution using given exit code

dieusage(3)

Write given string to stderr prefixed with "usage: PROG " and end program execution using given exit code

dieversion(3)

Write a version and copyright message to stdout

err(3)

Write given strings to stderr buffers with level OLVL_NORMAL or more, adding a LF and flushing the buffer afterwards

errdie(3)

Same as err(3) but ends program execution using given exit code

errhelp(3)

Same as diehelp(3) but does not end program execution.

errverb(3)

Same as err(3) but with OLVL_VERBOSE

list_matches(3)

To list all matching element from a partial match in an array of strings.

list_matches_full(3)

To list all matching element from a partial match in an array.

out(3)

Write given strings to stdout buffers with level OLVL_NORMAL or more, adding a LF and flushing the buffer afterwards

outdie(3)

Same as out(3) but ends program execution using given exit code

quiet(3)

Same as out(3) but with OLVL_QUIET

sys(3)

Same as err(3) with adding a colon, a space and the error description for errno before the LF

sysdie(3)

Same as sys(3) but ends program execution using given exit code

sysverb(3)

Same as sys(3) but with OLVL_VERBOSE

verb(3)

Same as out(3) but with OLVL_VERBOSE

warn(3)

Write a warning to stderr buffers with level OLVL_NORMAL or more

warnsys(3)

Same as warn(3) but adding error description after the warning

warnu(3)

Same as warn(3) but starting the warning with "unable to "

warnusys(3)

Same as warnsys(3) but starting the warning with "unable to "

Macros

The following macros are defined :

retw(3)

Same as warn(3) then return the given value

retwu(3)

Same as warnu(3) then return the given value

retwsys(3)

Same as warnsys(3) then return the given value

retwusys(3)

Same as warnusys(3) then return the given value

limb 0.1.0
2023-07-24
output.h(0)