Esempio n. 1
0
static void
print_caught_error(void)
{
  if (err_msg) {
    /* Print the error to stderr first. */
    fputs("libuim: ", stderr);
    if (fatal_errored)
      fputs("[fatal] ", stderr);
    fputs(err_msg, stderr);
    fputs("\n", stderr);
    if (fatal_errored) {
      fputs("libuim: ", stderr);
      fputs(ERRMSG_UIM_HAS_BEEN_DISABLED, stderr);
      fputs("\n", stderr);
    }

    /* And notify user of it via uim-notify in addition to the stderr msg. */
#if UIM_USE_NOTIFY_PLUGINS && !UIM_NON_LIBUIM_PROG
    /* Since this function will also be called on hard situations such
     * as memory exhaustion, these uim_notify_*() calls may be failed
     * to notify user of the error, due to the memory shortage.
     *   -- YamaKen 2008-02-11 */

    /* XXX: stderr messges will be duplicated */
    if (fatal_errored) {
      uim_notify_fatal_raw(err_msg);
      uim_notify_fatal_raw(ERRMSG_UIM_HAS_BEEN_DISABLED);
    } else {
      uim_notify_info(err_msg);
    }
#endif  /* UIM_USE_NOTIFY_PLUGINS */
  }
}
Esempio n. 2
0
static uim_lisp
notify_info(uim_lisp msg_)
{
  const char *msg = REFER_C_STR(msg_);

  return MAKE_BOOL(uim_notify_info("%s", msg));
}