<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Jul 5, 2007, at 7:08, Carl Worth wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Thu, 05 Jul 2007 11:01:00 +0100, Bill Spitzak wrote:</DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Depending on the error this could be pointers to string constants (this</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">would be a requirement for out-of-memory), or a buffer allocated and</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">belonging to the cairo_t. I would think some function would be used to</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">retrieve the error:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">const char* cairo_error_string(cairo_t);</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">That's been there for a long time, (and it does return a pointer to a</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">string constant). See:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>const char *</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>cairo_status_to_string (cairo_status_t status);</DIV></BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The problem is that backend specific errors don't work their way into this system. I.e. you can't use this mechanism to report that win32 produced some esoteric error when you did a clip or something. OoM is just plain confusing. GDIError would be less confusing, but not really much more helpful.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>For the Smalltalk case, what I could see doing is watching my own stderr and picking off cairo errors. This gets tricky, because cairo functions aren't the only functions in a program that might choose to write to stderr, so I end up having to filter somehow.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>My goal basically is to create/throw an exception when a Cairo error occurs, with as much meaningful information packed into it.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I kind of like Bill Spitzak's proposal of just having the error code be a pointer to a string. No string (null) means no error. The one disadvantage I see to this is that you can't easily "classify" the error codes without parsing the string.</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>--</DIV><DIV>Travis Griggs</DIV><DIV>Objologist</DIV><DIV>"There are a thousand hacking at the branches of evil to one who is striking at the root" - Henry David Thoreau</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></BODY></HTML>