changeset 1054:0a9a633a23e5

Remove unused functions in nodejs plugin
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 24 Nov 2010 15:47:33 +0800
parents df6ee4568ca2
children 1375aa8629ac
files nodejs/X_supp_njs.c
diffstat 1 files changed, 0 insertions(+), 86 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/X_supp_njs.c	Wed Nov 24 15:44:28 2010 +0800
+++ b/nodejs/X_supp_njs.c	Wed Nov 24 15:47:33 2010 +0800
@@ -8,10 +8,7 @@
  */
 #include <stdio.h>
 #include <string.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
 #include <ev.h>
-#include "mb_X_supp.h"
 #include "mb_tools.h"
 #include <mb_backend.h>
 #include "X_supp_njs.h"
@@ -115,66 +112,6 @@
 
 /* @} */
 
-#ifdef USE_MB_TMAN
-static void timer_cb(EV_P_ ev_timer *tmwatcher, int revent);
-
-/*! \brief Register next timeout with libev.
- */
-static void
-set_next_timeout(njs_runtime_t *rt) {
-    mb_tman_t *tman;
-    mb_timeval_t now, tmo;
-    ev_tstamp tout;
-    int r;
-
-    tman = X_MB_tman(rt->xrt);
-    get_now(&now);
-    r = mb_tman_next_timeout(tman, &now, &tmo);
-    if(r == 0) {
-	MB_TIMEVAL_DIFF(&tmo, &now);
-	tout = (ev_tstamp)MB_TIMEVAL_SEC(&tmo) +
-	    (ev_tstamp)MB_TIMEVAL_USEC(&tmo) / 1000000;
-	ev_timer_init(&rt->tmwatcher, timer_cb, tout, 0);
-	ev_timer_start(&rt->tmwatcher);
-	rt->enable_timer = 1;
-    } else
-	rt->enable_timer = 0;
-}
-
-static void
-x_conn_cb(EV_P_ ev_io *iowatcher, int revent) {
-    njs_runtime_t *rt = MEM2OBJ(iowatcher, njs_runtime_t, iowatcher);
-    redraw_man_t *rdman;
-    extern void _X_MB_handle_x_event_for_nodejs(void *rt);
-
-    rdman = X_MB_rdman(rt->xrt);
-    _X_MB_handle_x_event_for_nodejs(rt->xrt);
-    rdman_redraw_changed(rdman);
-
-    if(rt->enable_timer == 0) /* no installed timeout */
-	set_next_timeout(rt);
-}
-
-static void
-timer_cb(EV_P_ ev_timer *tmwatcher, int revent) {
-    njs_runtime_t *rt = MEM2OBJ(tmwatcher, njs_runtime_t, tmwatcher);
-    mb_tman_t *tman;
-    redraw_man_t *rdman;
-    mb_timeval_t now;
-    extern int _X_MB_flush_x_conn_for_nodejs(void *rt);
-
-    tman = X_MB_tman(rt->xrt);
-    get_now(&now);
-    mb_tman_handle_timeout(tman, &now);
-
-    rdman = X_MB_rdman(rt->xrt);
-    rdman_redraw_changed(rdman);
-    _X_MB_flush_x_conn_for_nodejs(rt->xrt);
-
-    set_next_timeout(rt);
-}
-
-#endif /* USE_MB_TMAN */
 
 /*! \defgroup njs_io_man IO manager for nodejs.
  * @{
@@ -282,29 +219,6 @@
 
 /* @} */
 
-#if 0
-/*! \brief Handle connection coming data and timeout of timers.
- *
- * \param rt is a runtime object for X.
- */
-void
-njs_mb_init_handle_connection(njs_runtime_t *rt) {
-    void *xrt = rt->xrt;
-    int fd;
-    extern int _X_MB_get_x_conn_for_nodejs(void *rt);
-
-    /*
-     * Setup watcher for X connection.
-     */
-    fd = _X_MB_get_x_conn_for_nodejs(xrt);
-    ev_io_init(&rt->iowatcher, x_conn_cb, fd, EV_READ);
-    ev_io_start(&rt->iowatcher);
-    rt->enable_io = 1;
-
-    set_next_timeout(rt);
-}
-#endif
-
 /*! \brief Free njs_runtime_t.
  */
 void