2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / libjava / gnu / gcj / xlib / natXException.cc
blob4bf7197fb8a0f0116c7aa35b07421f493e2b6c14
1 /* Copyright (C) 2000 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
7 details. */
9 #include <X11/Xlib.h>
11 #include <gcj/cni.h>
12 #include <gnu/gcj/xlib/Display.h>
13 #include <gnu/gcj/xlib/XException.h>
15 jstring gnu::gcj::xlib::XException::toString(Display* display, jint status)
17 ::Display* dpy = (::Display*) (display->display);
19 const int ERROR_TEXT_LENGTH = 256;
20 char errorText[ERROR_TEXT_LENGTH];
22 XGetErrorText(dpy, status, errorText, ERROR_TEXT_LENGTH);
23 return JvNewStringLatin1(errorText);