145#define withConLock(con) blkWrap (conLock(con), conUnlock(con))
209#define conFmt(con, fmt, ...) \
210 _conFmt(con, fmt, count_macro_args(__VA_ARGS__), (stvar[]) { __VA_ARGS__ })
Macro argument counting utilities.
Block wrapping macros for automatic resource management.
void conMemGet(ConStream *con, string *out)
ConStream * conCreateMem(const ConCaps *caps)
struct ConStream ConStream
ConColorDepth
Color depth a stream is able to render.
void conGetCaps(ConStream *con, ConCaps *out)
void conDestroy(ConStream **con)
void conLock(ConStream *con)
uint16 conHeight(ConStream *con)
Current terminal height in rows, re-queried on every call. 0 if unknown or not a tty.
uint16 conWidth(ConStream *con)
Current terminal width in columns, re-queried on every call. 0 if unknown or not a tty.
void conUnlock(ConStream *con)
@ CON_ColorTrue
24-bit RGB
@ CON_Color16
Standard + bright ANSI 16-color palette.
@ CON_Color256
256-color palette (6x6x6 cube + grayscale ramp + 16 base)
@ CON_ColorNone
No color support; styling is a no-op.
bool conFlush(ConStream *con)
bool conNL(ConStream *con)
bool conPutc(ConStream *con, int32 codepoint)
bool conPuts(ConStream *con, strref s)
bool conPutsz(ConStream *con, const char *sz)
bool _conFmt(ConStream *con, strref fmt, int n, stvar *args)
bool conWrite(ConStream *con, const void *buf, size_t sz)
#define stvar(typen, val)
Core string types and fundamental operations.
bool altscreen
The alternate screen buffer is available.
bool cursorquery
conGetCursor() can report the real cursor position
ConColorDepth color
Highest color depth the stream will render.
uint16 height
Terminal height in rows, 0 if unknown.
bool istty
The underlying handle is an interactive terminal.
bool vt
VT/ANSI escape sequences are accepted on output.
uint16 width
Terminal width in columns, 0 if unknown.
bool unicode
Non-ASCII UTF-8 output is safe to write directly.
bool cursor
Cursor addressing (conSetCursor and friends) is available.
Variant type containers and type-safe variadic argument support.