| 16 | #define CASE(m) case m: return #m; |
| 17 | |
| 18 | static const char *x11error(int code) |
| 19 | { |
| 20 | if(code >= FirstExtensionError && code <= LastExtensionError) |
| 21 | return "Extension error"; |
| 22 | switch(code) |
| 23 | { |
| 24 | CASE(BadRequest) |
| 25 | CASE(BadValue) |
| 26 | CASE(BadWindow) |
| 27 | CASE(BadPixmap) |
| 28 | CASE(BadAtom) |
| 29 | CASE(BadCursor) |
| 30 | CASE(BadFont) |
| 31 | CASE(BadMatch) |
| 32 | CASE(BadDrawable) |
| 33 | CASE(BadAccess) |
| 34 | CASE(BadAlloc) |
| 35 | CASE(BadColor) |
| 36 | CASE(BadGC) |
| 37 | CASE(BadIDChoice) |
| 38 | CASE(BadName) |
| 39 | CASE(BadLength) |
| 40 | CASE(BadImplementation) |
| 41 | default: return "Unknown error code"; |
| 42 | } |
| 43 | } |