library: expanded/generalized memory allocation provisions

A callback provision in the form of xalloc_err_handler
(of type message_fn) was added to the alloc module.

This change allowed a program like top, who alters the
termios structure, to override the default fprint(stderr...)
behavior in the event of an error.

The new function xstrdup was also added for symmetry.
This commit is contained in:
Jim Warner
2011-11-16 10:49:02 -06:00
committed by Craig Small
parent f9ab2fec43
commit 7126cc4491
5 changed files with 60 additions and 19 deletions

View File

@@ -5,8 +5,6 @@
EXTERN_C_BEGIN
typedef void (*message_fn)(const char *restrict, ...) __attribute__((format(printf,1,2)));
extern const char * lookup_wchan(unsigned KLONG address, unsigned pid);
extern int open_psdb(const char *restrict override);
extern int open_psdb_message(const char *restrict override, message_fn message);