#endif
/*
-=item i_errors()
+=item im_errors(ctx)
+=synopsis i_errmsg *errors = im_errors(aIMCTX);
+=synopsis i_errmsg *errors = i_errors();
Returns a pointer to the first element of an array of error messages,
terminated by a NULL pointer. The highest level message is first.
+Also callable as C<i_errors()>.
+
=cut
*/
i_errmsg *im_errors(im_context_t ctx) {
return ctx->error_stack + ctx->error_sp;
}
-i_errmsg *i_errors(void) {
- return im_errors(im_get_context());
-}
-
/*
=back
#include "iolayert.h"
+/* error message information returned by im_errors() */
+
+typedef struct {
+ char *msg;
+ int code;
+} i_errmsg;
+
typedef struct i_render_tag i_render;
#ifdef IMAGER_FORMAT_ATTR
see error.c for documentation
the error information is currently global
*/
-typedef struct {
- char *msg;
- int code;
-} i_errmsg;
-
typedef void (*i_error_cb)(int code, char const *msg);
typedef void (*i_failed_cb)(i_errmsg *msgs);
extern i_error_cb i_set_error_cb(i_error_cb);
extern i_failed_cb i_set_failed_cb(i_failed_cb);
extern void i_set_argv0(char const *);
extern int i_set_errors_fatal(int new_fatal);
-extern i_errmsg *i_errors(void);
+extern i_errmsg *im_errors(pIMCTX);
extern void im_push_error(pIMCTX, int code, char const *msg);
#ifndef IMAGER_NO_CONTEXT
im_lhead,
im_loog,
im_context_refinc,
- im_context_refdec
+ im_context_refdec,
+ im_errors
};
/* in general these functions aren't called by Imager internally, but
void (*f_im_loog)(im_context_t, int level,const char *msg, ... ) I_FORMAT_ATTR(3,4);
void (*f_im_context_refinc)(im_context_t, const char *where);
void (*f_im_context_refdec)(im_context_t, const char *where);
+ i_errmsg *(*f_im_errors)(im_context_t);
} im_ext_funcs;
#define PERL_FUNCTION_TABLE_NAME "Imager::__ext_func_table"
#define i_clear_error() im_clear_error(aIMCTX)
#define i_push_errorvf(code, fmt, args) im_push_errorvf(aIMCTX, code, fmt, args)
#define i_push_error(code, msg) im_push_error(aIMCTX, code, msg)
+#define i_errors() im_errors(aIMCTX)
#define io_new_fd(fd) im_io_new_fd(aIMCTX, (fd))
#define io_new_bufchain() im_io_new_bufchain(aIMCTX)