<div dir="ltr">I think LAST_STATUS should print a number, not a message.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 18, 2015 at 5:28 AM, Enrico Weigelt, metux IT consult <span dir="ltr"><<a href="mailto:enrico.weigelt@gr13.net" target="_blank">enrico.weigelt@gr13.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Enrico Weigelt, metux IT consult <<a href="mailto:enrico.weigelt@gr13.net">enrico.weigelt@gr13.net</a>><br>
---<br>
src/cairo-error.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++<br>
src/cairo.h | 2 ++<br>
2 files changed, 52 insertions(+)<br>
<br>
diff --git a/src/cairo-error.c b/src/cairo-error.c<br>
index 1b9bd76..6f13c77 100644<br>
--- a/src/cairo-error.c<br>
+++ b/src/cairo-error.c<br>
@@ -71,3 +71,53 @@ _cairo_error (cairo_status_t status)<br>
}<br>
<br>
COMPILE_TIME_ASSERT ((int)CAIRO_INT_STATUS_LAST_STATUS == (int)CAIRO_STATUS_LAST_STATUS);<br>
+<br>
+const char* cairo_status_text(cairo_status_t status)<br>
+{<br>
+ switch (status) {<br>
+ case CAIRO_STATUS_SUCCESS: return "SUCCESS";<br>
+ case CAIRO_STATUS_NO_MEMORY: return "NO_MEMORY";<br>
+ case CAIRO_STATUS_INVALID_RESTORE: return "INVALID_RESTORE";<br>
+ case CAIRO_STATUS_INVALID_POP_GROUP: return "INVALID_POP_GROUP";<br>
+ case CAIRO_STATUS_NO_CURRENT_POINT: return "NO_CURRENT_POINT";<br>
+ case CAIRO_STATUS_INVALID_MATRIX: return "INVALID_MATRIX";<br>
+ case CAIRO_STATUS_INVALID_STATUS: return "INVALID_STATUS";<br>
+ case CAIRO_STATUS_NULL_POINTER: return "NULL_POINTER";<br>
+ case CAIRO_STATUS_INVALID_STRING: return "INVALID_STATUS";<br>
+ case CAIRO_STATUS_INVALID_PATH_DATA: return "INVALID_PATH_DATA";<br>
+ case CAIRO_STATUS_READ_ERROR: return "READ_ERROR";<br>
+ case CAIRO_STATUS_WRITE_ERROR: return "WRITE_ERROR";<br>
+ case CAIRO_STATUS_SURFACE_FINISHED: return "SURFACE_FINISHED";<br>
+ case CAIRO_STATUS_SURFACE_TYPE_MISMATCH: return "SURFACE_TYPE_MISMATCH";<br>
+ case CAIRO_STATUS_PATTERN_TYPE_MISMATCH: return "PATTERN_TYPE_MISMATCH";<br>
+ case CAIRO_STATUS_INVALID_CONTENT: return "INVALID_CONTENT";<br>
+ case CAIRO_STATUS_INVALID_FORMAT: return "INVALID_FORMAT";<br>
+ case CAIRO_STATUS_INVALID_VISUAL: return "INVALID_VISUAL";<br>
+ case CAIRO_STATUS_FILE_NOT_FOUND: return "FILE_NOT_FOUND";<br>
+ case CAIRO_STATUS_INVALID_DASH: return "INVALID_DASH";<br>
+ case CAIRO_STATUS_INVALID_DSC_COMMENT: return "INVALID_DSC_COMMENT";<br>
+ case CAIRO_STATUS_INVALID_INDEX: return "INVALID_INDEX";<br>
+ case CAIRO_STATUS_CLIP_NOT_REPRESENTABLE: return "CLIP_NOT_REPRESENTABLE";<br>
+ case CAIRO_STATUS_TEMP_FILE_ERROR: return "TEMP_FILE_ERROR";<br>
+ case CAIRO_STATUS_INVALID_STRIDE: return "INVALID_STRIDE";<br>
+ case CAIRO_STATUS_FONT_TYPE_MISMATCH: return "FONT_TYPE_MISMATCH";<br>
+ case CAIRO_STATUS_USER_FONT_IMMUTABLE: return "USER_FONT_IMMUTABLE";<br>
+ case CAIRO_STATUS_USER_FONT_ERROR: return "USER_FONT_ERROR";<br>
+ case CAIRO_STATUS_NEGATIVE_COUNT: return "NEGATIVE_COUNT";<br>
+ case CAIRO_STATUS_INVALID_CLUSTERS: return "INVALID_CLUSTERS";<br>
+ case CAIRO_STATUS_INVALID_SLANT: return "INVALID_SLANT";<br>
+ case CAIRO_STATUS_INVALID_WEIGHT: return "INVALID_WEIGHT";<br>
+ case CAIRO_STATUS_INVALID_SIZE: return "INVALID_SIZE";<br>
+ case CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED: return "USER_FONT_NOT_IMPLEMENTED";<br>
+ case CAIRO_STATUS_DEVICE_TYPE_MISMATCH: return "DEVICE_TYPE_MISMATCH";<br>
+ case CAIRO_STATUS_DEVICE_ERROR: return "DEVICE_ERROR";<br>
+ case CAIRO_STATUS_INVALID_MESH_CONSTRUCTION: return "INVALID_MESH_CONSTRUCTION";<br>
+ case CAIRO_STATUS_DEVICE_FINISHED: return "DEVICE_FINISHED";<br>
+ case CAIRO_STATUS_JBIG2_GLOBAL_MISSING: return "JBIG2_GLOBAL_MISSING";<br>
+ case CAIRO_STATUS_LAST_STATUS: return "LAST_STATUS";<br>
+ }<br>
+<br>
+ static __thread char _buf[32];<br>
+ snprintf(_buf, sizeof(_buf), "%d", status);<br>
+ return _buf;<br>
+}<br>
diff --git a/src/cairo.h b/src/cairo.h<br>
index 3104d47..a993d38 100644<br>
--- a/src/cairo.h<br>
+++ b/src/cairo.h<br>
@@ -352,6 +352,8 @@ typedef enum _cairo_status {<br>
CAIRO_STATUS_LAST_STATUS<br>
} cairo_status_t;<br>
<br>
+const char* cairo_status_text(cairo_status_t status);<br>
+<br>
/**<br>
* cairo_content_t:<br>
* @CAIRO_CONTENT_COLOR: The surface will hold color content only. (Since 1.0)<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.6.4.442.g545299f<br>
<br>
--<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" rel="noreferrer" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a></font></span></blockquote></div><br></div>