SYNOPSIS

#include <ixp.h>

char *ixp_errbuf(void);

void ixp_errstr(char *buf, int nbuf);

void ixp_rerrstr(char *buf, int nbuf);

void ixp_werrstr(const char *fmt, ...);

int      (*ixp_vsnprint)(char *buf, int nbuf, const char *fmt, va_list);

PARAMETERS

buf

The buffer to read and/or fill.

nbuf

The size of the buffer.

fmt

A format string with which to write the errstr.

...

Arguments to fmt.

DESCRIPTION

These functions simulate Plan 9's errstr functionality. They replace errno in libixp. Note that these functions are not internationalized.

ixp_errbuf(3) returns the errstr buffer for the current thread. ixp_rerrstr(3) fills buf with the data from the current thread's error buffer, while ixp_errstr(3) exchanges buf's contents with those of the current thread's error buffer. ixp_werrstr(3) formats the given format string, fmt, via ixp_vsnprint(3) and writes it to the error buffer.

ixp_vsnprint(3) may be set to a function which will format its arguments write the result to the nbuf length buffer buf(3). The default value is vsnprintf(3). The function must format '%s' as a nul-terminated string and may not consume any arguments not indicated by a %-prefixed format specifier, but may otherwise behave in any manner chosen by the user.

RELATED TO ixp_vsnprint…