home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xseterrorhandler.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  6.2 KB  |  199 lines

  1.  
  2.  
  3.  
  4. XSetErrorHandler(3X11)      XLIB FUNCTIONS   XSetErrorHandler(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XSetErrorHandler, XGetErrorText, XDisplayName, XSetIOEr-
  9.        rorHandler, XGetErrorDatabaseText - default error handlers
  10.  
  11. SSYYNNTTAAXX
  12.        int (*XSetErrorHandler(_h_a_n_d_l_e_r))()
  13.          int (*_h_a_n_d_l_e_r)(Display *, XErrorEvent *)
  14.  
  15.        XGetErrorText(_d_i_s_p_l_a_y, _c_o_d_e, _b_u_f_f_e_r___r_e_t_u_r_n, _l_e_n_g_t_h)
  16.          Display *_d_i_s_p_l_a_y;
  17.          int _c_o_d_e;
  18.          char *_b_u_f_f_e_r___r_e_t_u_r_n;
  19.          int _l_e_n_g_t_h;
  20.  
  21.        char *XDisplayName(_s_t_r_i_n_g)
  22.          char *_s_t_r_i_n_g;
  23.  
  24.        int (*XSetIOErrorHandler(_h_a_n_d_l_e_r))()
  25.          int (*_h_a_n_d_l_e_r)(Display *);
  26.  
  27.        XGetErrorDatabaseText(_d_i_s_p_l_a_y, _n_a_m_e, _m_e_s_s_a_g_e,
  28.        _d_e_f_a_u_l_t___s_t_r_i_n_g, _b_u_f_f_e_r___r_e_t_u_r_n, _l_e_n_g_t_h)
  29.          Display *_d_i_s_p_l_a_y;
  30.          char *_n_a_m_e, *_m_e_s_s_a_g_e;
  31.          char *_d_e_f_a_u_l_t___s_t_r_i_n_g;
  32.          char *_b_u_f_f_e_r___r_e_t_u_r_n;
  33.          int _l_e_n_g_t_h;
  34.  
  35. AARRGGUUMMEENNTTSS
  36.        _b_u_f_f_e_r___r_e_t_u_r_n
  37.          Returns the error description.
  38.  
  39.        _c_o_d_e     Specifies the error code for which you want to
  40.          obtain a description.
  41.  
  42.        _d_e_f_a_u_l_t___s_t_r_i_n_g
  43.          Specifies the default error message if none is
  44.          found in the database.
  45.  
  46.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  47.  
  48.        _h_a_n_d_l_e_r     Specifies the program's supplied error handler.
  49.  
  50.        _l_e_n_g_t_h     Specifies the size of the buffer.
  51.  
  52.        _m_e_s_s_a_g_e     Specifies the type of the error message.
  53.  
  54.        _n_a_m_e     Specifies the name of the application.
  55.  
  56.        _s_t_r_i_n_g     Specifies the character string.
  57.  
  58. DDEESSCCRRIIPPTTIIOONN
  59.        Xlib generally calls the program's supplied error handler
  60.        whenever an error is received.  It is not called on
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XSetErrorHandler(3X11)      XLIB FUNCTIONS   XSetErrorHandler(3X11)
  71.  
  72.  
  73.        _B_a_d_N_a_m_e errors from _O_p_e_n_F_o_n_t, _L_o_o_k_u_p_C_o_l_o_r, or _A_l_l_o_c_N_a_m_e_d_-
  74.        _C_o_l_o_r protocol requests or on _B_a_d_F_o_n_t errors from a _Q_u_e_r_y_-
  75.        _F_o_n_t protocol request.  These errors generally are
  76.        reflected back to the program through the procedural
  77.        interface.  Because this condition is not assumed to be
  78.        fatal, it is acceptable for your error handler to return;
  79.        the returned value is ignored.  However, the error handler
  80.        should not call any functions (directly or indirectly) on
  81.        the display that will generate protocol requests or that
  82.        will look for input events.  The previous error handler is
  83.        returned.
  84.  
  85.        The _X_G_e_t_E_r_r_o_r_T_e_x_t function copies a null-terminated string
  86.        describing the specified error code into the specified
  87.        buffer.    The returned text is in the encoding of the cur-
  88.        rent locale.  It is recommended that you use this function
  89.        to obtain an error description because extensions to Xlib
  90.        may define their own error codes and error strings.
  91.  
  92.        The _X_D_i_s_p_l_a_y_N_a_m_e function returns the name of the display
  93.        that _X_O_p_e_n_D_i_s_p_l_a_y would attempt to use.    If a NULL string
  94.        is specified, _X_D_i_s_p_l_a_y_N_a_m_e looks in the environment for
  95.        the display and returns the display name that _X_O_p_e_n_D_i_s_p_l_a_y
  96.        would attempt to use.  This makes it easier to report to
  97.        the user precisely which display the program attempted to
  98.        open when the initial connection attempt failed.
  99.  
  100.        The _X_S_e_t_I_O_E_r_r_o_r_H_a_n_d_l_e_r sets the fatal I/O error handler.
  101.        Xlib calls the program's supplied error handler if any
  102.        sort of system call error occurs (for example, the connec-
  103.        tion to the server was lost).  This is assumed to be a
  104.        fatal condition, and the called routine should not return.
  105.        If the I/O error handler does return, the client process
  106.        exits.
  107.  
  108.        Note that the previous error handler is returned.
  109.  
  110.        The _X_G_e_t_E_r_r_o_r_D_a_t_a_b_a_s_e_T_e_x_t function returns a null-
  111.        terminated message (or the default message) from the error
  112.        message database.  Xlib uses this function internally to
  113.        look up its error messages.  The text in the
  114.        default_string argument is assumed to be in the encoding
  115.        of the current locale, and the text stored in the
  116.        buffer_return argument is in the encoding of the current
  117.        locale.
  118.  
  119.        The name argument should generally be the name of your
  120.        application.  The message argument should indicate which
  121.        type of error message you want.    If the name and message
  122.        are not in the Host Portable Character Encoding, the
  123.        result is implementation-dependent.  Xlib uses three pre-
  124.        defined ``application names'' to report errors.    In these
  125.        names, uppercase and lowercase matter.
  126.  
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XSetErrorHandler(3X11)      XLIB FUNCTIONS   XSetErrorHandler(3X11)
  137.  
  138.  
  139.        XProtoError
  140.          The protocol error number is used as a string
  141.          for the message argument.
  142.  
  143.        XlibMessage
  144.          These are the message strings that are used
  145.          internally by the library.
  146.  
  147.        XRequest     For a core protocol request, the major request
  148.          protocol number is used for the message argu-
  149.          ment.    For an extension request, the extension
  150.          name (as given by _I_n_i_t_E_x_t_e_n_s_i_o_n) followed by a
  151.          period (.) and the minor request protocol number
  152.          is used for the message argument.  If no string
  153.          is found in the error database, the
  154.          default_string is returned to the buffer argu-
  155.          ment.
  156.  
  157. SSEEEE AALLSSOO
  158.        XOpenDisplay(3X11), XSynchronize(3X11)
  159.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.