diff include/mb_backend.h @ 993:5b58e74988bc refine_backend_if

Use mb_backend_t::new instead of mb_backend_t::init
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 22 Nov 2010 00:42:29 +0800
parents 1882700bb4b9
children 5d9def42df12
line wrap: on
line diff
--- a/include/mb_backend.h	Mon Nov 22 00:42:29 2010 +0800
+++ b/include/mb_backend.h	Mon Nov 22 00:42:29 2010 +0800
@@ -16,9 +16,13 @@
 #inclde "mb_dfb_supp.h"
 #endif
 
-typedef void *MBB_WINDOW;
 typedef void mb_rt_t;
 
+typedef struct _mb_timer_man mb_timer_man_t;
+typedef struct _mb_timer_factory mb_timer_factory_t;
+typedef struct _mb_IO_man mb_IO_man_t;
+typedef struct _mb_IO_factory mb_IO_factory_t;
+
 /*! \brief The backend engine mb_backend_t is used to define the
  *         interface to realize the MB.
  *
@@ -34,7 +38,7 @@
  */
 typedef struct {
     mb_rt_t *(*new)(const char *display, int w,int h);
-    mb_rt_t *(*new_with_win)(const char *display, MBB_WINDOW win, int w,int h);
+    mb_rt_t *(*new_with_win)(const char *display, MB_WINDOW win, int w,int h);
     
     void (*free)(mb_rt_t *rt);
     /*! \brief Request the backend to start monitoring a file descriptor.
@@ -73,7 +77,8 @@
 
 /*! \brief Type of IO that registered with an IO manager.
  */
-enum MB_IO_TYPE {MB_IO_DUMMY, MB_IO_R, MB_IO_W, MB_IO_RW};
+enum _MB_IO_TYPE {MB_IO_DUMMY, MB_IO_R, MB_IO_W, MB_IO_RW};
+typedef enum _MB_IO_TYPE MB_IO_TYPE;
 
 /*! \brief Function signature of callback functions for IO requests.
  */
@@ -84,10 +89,9 @@
 struct _mb_IO_man {
     int (*reg)(struct _mb_IO_man *io_man,
 	       int fd, MB_IO_TYPE type, mb_IO_cb_t cb, void *data);
-    void (*unreg)(struct _mb_IO_Man *io_man,
+    void (*unreg)(struct _mb_IO_man *io_man,
 		  int io_hdl);
 };
-typedef struct _mb_IO_man mb_IO_man_t;
 
 /*! \brief Factory of IO managers.
  */
@@ -95,7 +99,6 @@
     mb_IO_man_t *(*new)(void);
     void (*free)(mb_IO_man_t *io_man);
 };
-typedef struct _mb_IO_factory mb_IO_factory_t;
 
 /*! \brief Function signature of callback functions for timers.
  */
@@ -113,7 +116,7 @@
      * \param tm_hdl is the handle returned by _mb_timer_man::timeout.
      */
     void (*remove)(struct _mb_timer_man *tm_man, int tm_hdl);
-} mb_timer_man_t;
+};
 
 /*! \brief Factory of timer manager.
  */
@@ -121,6 +124,5 @@
     mb_timer_man_t *(*new)(void);
     void (*free)(mb_timer_man_t *timer_man);
 };
-typedef struct _mb_timer_factory mb_timer_factory_t;
 
 #endif /* __MB_BACKEND_H_ */