Index: /trunk/mem.c
===================================================================
--- /trunk/mem.c	(revision 380)
+++ /trunk/mem.c	(revision 381)
@@ -9,6 +9,6 @@
 #include <stdlib.h>
 #include <string.h>
-#define XC_SHM_IMPL
-#define XC_MEM_IMPL
+#define XC_MEMBLOCK_IMPL _xc_mem_block_t
+#define XC_MEM_IMPL _xc_mem_mem_t
 #include "xc_shm.h"
 #include "align.h"
@@ -31,5 +31,5 @@
 
 /* {{{ mem */
-struct _xc_block_t {
+struct _xc_mem_block_t {
 #ifdef ALLOC_DEBUG_BLOCK_CHECK
 	unsigned int magic;
@@ -39,5 +39,5 @@
 };
 
-struct _xc_mem_t {
+struct _xc_mem_mem_t {
 	const xc_mem_handlers_t *handlers;
 	xc_shm_t                *shm;
Index: /trunk/mem.h
===================================================================
--- /trunk/mem.h	(revision 380)
+++ /trunk/mem.h	(revision 381)
@@ -1,4 +1,17 @@
-typedef struct _xc_mem_t xc_mem_t;
-typedef struct _xc_block_t xc_block_t;
+typedef struct _xc_mem_handlers_t xc_mem_handlers_t;
+
+#ifndef XC_MEM_IMPL
+struct _xc_mem_t {
+	const xc_mem_handlers_t *handlers;
+	xc_shm_t                *shm;
+};
+#   define XC_MEM_IMPL _xc_mem_t
+#endif
+
+#ifndef XC_MEMBLOCK_IMPL
+#   define XC_MEMBLOCK_IMPL _xc_block_t
+#endif
+typedef struct XC_MEM_IMPL xc_mem_t;
+typedef struct XC_MEMBLOCK_IMPL xc_block_t;
 typedef unsigned int xc_memsize_t;
 
@@ -38,5 +51,5 @@
 }
 
-typedef struct {
+struct _xc_mem_handlers_t {
 	XC_MEM_MALLOC((*malloc));
 	XC_MEM_FREE((*free));
@@ -54,12 +67,5 @@
 	XC_MEM_INIT((*init));
 	XC_MEM_DESTROY((*destroy));
-} xc_mem_handlers_t;
-
-#ifndef XC_MEM_IMPL
-struct _xc_mem_t {
-	const xc_mem_handlers_t *handlers;
-	xc_shm_t                *shm;
 };
-#endif
 
 int xc_mem_scheme_register(const char *name, const xc_mem_handlers_t *handlers);
Index: /trunk/mmap.c
===================================================================
--- /trunk/mmap.c	(revision 380)
+++ /trunk/mmap.c	(revision 381)
@@ -30,5 +30,5 @@
 
 #include "php.h"
-#define XC_SHM_IMPL
+#define XC_SHM_IMPL _xc_mmap_shm_t
 #include "xc_shm.h"
 #include "utils.h"
@@ -39,5 +39,5 @@
 
 /* {{{ xc_shm_t */
-struct _xc_shm_t {
+struct _xc_mmap_shm_t {
 	xc_shm_handlers_t *handlers;
 	void *ptr;
Index: /trunk/xc_malloc.c
===================================================================
--- /trunk/xc_malloc.c	(revision 380)
+++ /trunk/xc_malloc.c	(revision 381)
@@ -1,4 +1,4 @@
-#define XC_SHM_IMPL
-#define XC_MEM_IMPL
+#define XC_SHM_IMPL _xc_malloc_shm_t
+#define XC_MEM_IMPL _xc_malloc_mem_t
 #include <stdlib.h>
 #include <stdio.h>
@@ -9,5 +9,5 @@
 #include "utils.h"
 
-struct _xc_mem_t {
+struct _xc_malloc_mem_t {
 	const xc_mem_handlers_t *handlers;
 	xc_shm_t                *shm;
@@ -107,6 +107,6 @@
 /* }}} */
 
-/* {{{ xc_shm_t */
-struct _xc_shm_t {
+/* {{{ _xc_malloc_shm_t */
+struct _xc_malloc_shm_t {
 	xc_shm_handlers_t *handlers;
 	xc_shmsize_t       size;
Index: /trunk/xc_shm.h
===================================================================
--- /trunk/xc_shm.h	(revision 380)
+++ /trunk/xc_shm.h	(revision 381)
@@ -1,5 +1,14 @@
 #ifndef XC_SHM_H
 #define XC_SHM_H
-typedef struct _xc_shm_t xc_shm_t;
+typedef struct _xc_shm_handlers_t xc_shm_handlers_t;
+
+#ifndef XC_SHM_IMPL
+struct _xc_shm_t {
+	const xc_shm_handlers_t *handlers;
+};
+#define XC_SHM_IMPL _xc_shm_t
+#endif
+
+typedef struct XC_SHM_IMPL xc_shm_t;
 typedef size_t xc_shmsize_t;
 
@@ -34,5 +43,5 @@
 }
 
-typedef struct {
+struct _xc_shm_handlers_t {
 	const xc_mem_handlers_t *memhandlers;
 	XC_SHM_CAN_READONLY((*can_readonly));
@@ -46,12 +55,6 @@
 	XC_SHM_MEMINIT((*meminit));
 	XC_SHM_MEMDESTROY((*memdestroy));
-} xc_shm_handlers_t;
+};
 
-
-#ifndef XC_SHM_IMPL
-struct _xc_shm_t {
-	const xc_shm_handlers_t *handlers;
-};
-#endif
 typedef struct _xc_shm_scheme_t xc_shm_scheme_t;
 
