Index: /branches/1.2/xc_malloc.c
===================================================================
--- /branches/1.2/xc_malloc.c	(revision 302)
+++ /branches/1.2/xc_malloc.c	(revision 380)
@@ -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>
@@ -8,5 +8,5 @@
 #include "align.h"
 
-struct _xc_mem_t {
+struct _xc_malloc_mem_t {
 	const xc_mem_handlers_t *handlers;
 	xc_shm_t                *shm;
@@ -106,6 +106,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: /branches/1.2/mem.c
===================================================================
--- /branches/1.2/mem.c	(revision 302)
+++ /branches/1.2/mem.c	(revision 380)
@@ -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"
@@ -30,5 +30,5 @@
 
 /* {{{ mem */
-struct _xc_block_t {
+struct _xc_mem_block_t {
 #ifdef ALLOC_DEBUG_BLOCK_CHECK
 	unsigned int magic;
@@ -38,5 +38,5 @@
 };
 
-struct _xc_mem_t {
+struct _xc_mem_mem_t {
 	const xc_mem_handlers_t *handlers;
 	xc_shm_t                *shm;
Index: /branches/1.2/mem.h
===================================================================
--- /branches/1.2/mem.h	(revision 148)
+++ /branches/1.2/mem.h	(revision 380)
@@ -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: /branches/1.2/xc_shm.h
===================================================================
--- /branches/1.2/xc_shm.h	(revision 163)
+++ /branches/1.2/xc_shm.h	(revision 380)
@@ -1,3 +1,12 @@
-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;
 
@@ -32,5 +41,5 @@
 }
 
-typedef struct {
+struct _xc_shm_handlers_t {
 	const xc_mem_handlers_t *memhandlers;
 	XC_SHM_CAN_READONLY((*can_readonly));
@@ -44,12 +53,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;
 
Index: /branches/1.2/mmap.c
===================================================================
--- /branches/1.2/mmap.c	(revision 334)
+++ /branches/1.2/mmap.c	(revision 380)
@@ -32,5 +32,5 @@
 
 #include "php.h"
-#define XC_SHM_IMPL
+#define XC_SHM_IMPL _xc_mmap_shm_t
 #include "xc_shm.h"
 
@@ -40,5 +40,5 @@
 
 /* {{{ xc_shm_t */
-struct _xc_shm_t {
+struct _xc_mmap_shm_t {
 	xc_shm_handlers_t *handlers;
 	void *ptr;
