]> git.imager.perl.org - imager.git/blobdiff - error.c
note GIF changes
[imager.git] / error.c
diff --git a/error.c b/error.c
index 1f89bb4229bbee351a2fd6b721aac0b866d0fe58..03a271ca8c61a5ec1e30bf366a8c7cfcc23cf7c0 100644 (file)
--- a/error.c
+++ b/error.c
@@ -94,7 +94,9 @@ the mark.
 
 =over
 
-=item i_clear_error()
+=item im_clear_error(ctx)
+X<im_clear_error API>X<i_clear_error API>
+=synopsis im_clear_error(aIMCTX);
 =synopsis i_clear_error();
 =category Error handling
 
@@ -102,6 +104,8 @@ Clears the error stack.
 
 Called by any Imager function before doing any other processing.
 
+Also callable as C<i_clear_error()>.
+
 =cut
 */
 
@@ -122,9 +126,11 @@ im_clear_error(im_context_t ctx) {
 }
 
 /*
-=item i_push_error(int code, char const *msg)
+=item im_push_error(ctx, code, message)
+X<im_push_error API>X<i_push_error API>
 =synopsis i_push_error(0, "Yep, it's broken");
 =synopsis i_push_error(errno, "Error writing");
+=synopsis im_push_error(aIMCTX, 0, "Something is wrong");
 =category Error handling
 
 Called by an Imager function to push an error message onto the stack.
@@ -159,8 +165,11 @@ im_push_error(im_context_t ctx, int code, char const *msg) {
 }
 
 /*
-=item i_push_errorvf(int C<code>, char const *C<fmt>, va_list C<ap>)
-
+=item im_push_errorvf(ctx, code, format, args)
+X<im_push_error_vf API>X<i_push_errorvf API>
+=synopsis va_args args;
+=synopsis va_start(args, lastarg);
+=synopsis im_push_errorvf(ctx, code, format, args);
 =category Error handling
 
 Intended for use by higher level functions, takes a varargs pointer
@@ -168,6 +177,8 @@ and a format to produce the finally pushed error message.
 
 Does not support perl specific format codes.
 
+Also callable as C<i_push_errorvf(code, format, args)>
+
 =cut
 */
 void 
@@ -187,11 +198,6 @@ im_push_errorvf(im_context_t ctx, int code, char const *fmt, va_list ap) {
   im_push_error(ctx, code, buf);
 }
 
-void
-(i_push_errorvf)(int code, char const *fmt, va_list ap) {
-  im_push_errorvf(im_get_context(), code, fmt, ap);
-}
-
 /*
 =item i_push_errorf(int code, char const *fmt, ...)
 =synopsis i_push_errorf(errno, "Cannot open file %s: %d", filename, errno);
@@ -211,6 +217,17 @@ i_push_errorf(int code, char const *fmt, ...) {
   va_end(ap);
 }
 
+/*
+=item im_push_errorf(ctx, code, char const *fmt, ...)
+=synopsis im_push_errorf(aIMCTX, errno, "Cannot open file %s: %d", filename, errno);
+=category Error handling
+
+A version of im_push_error() that does printf() like formatting.
+
+Does not support perl specific format codes.
+
+=cut
+*/
 void
 im_push_errorf(im_context_t ctx, int code, char const *fmt, ...) {
   va_list ap;
@@ -284,11 +301,15 @@ int i_failed(int code, char const *msg) {
 
 #endif
 
+#ifdef IM_ASSERT
+
 /*
 =item im_assert_fail(file, line, message)
 
 Called when an im_assert() assertion fails.
 
+Only available when Imager is built with assertions.
+
 =cut
 */
 
@@ -299,6 +320,8 @@ im_assert_fail(char const *file, int line, char const *message) {
   abort();
 }
 
+#endif
+
 /*
 =back