]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/mempool.h
ABI: Symbol renames for libucw and libcharset
[libucw.git] / ucw / mempool.h
index bcc22bd35bcf755e0aca15ad05e15655bd66332b..f5aff6f56ae2b6bfb479e11ded6e2bb1528fe4c6 100644 (file)
 #ifndef _UCW_POOLS_H
 #define _UCW_POOLS_H
 
+#ifdef CONFIG_UCW_CLEAN_ABI
+#define mp_alloc ucw_mp_alloc
+#define mp_alloc_internal ucw_mp_alloc_internal
+#define mp_alloc_noalign ucw_mp_alloc_noalign
+#define mp_alloc_zero ucw_mp_alloc_zero
+#define mp_delete ucw_mp_delete
+#define mp_flush ucw_mp_flush
+#define mp_grow_internal ucw_mp_grow_internal
+#define mp_init ucw_mp_init
+#define mp_memdup ucw_mp_memdup
+#define mp_multicat ucw_mp_multicat
+#define mp_new ucw_mp_new
+#define mp_open ucw_mp_open
+#define mp_pop ucw_mp_pop
+#define mp_printf ucw_mp_printf
+#define mp_printf_append ucw_mp_printf_append
+#define mp_push ucw_mp_push
+#define mp_realloc ucw_mp_realloc
+#define mp_realloc_zero ucw_mp_realloc_zero
+#define mp_restore ucw_mp_restore
+#define mp_spread_internal ucw_mp_spread_internal
+#define mp_start ucw_mp_start
+#define mp_start_internal ucw_mp_start_internal
+#define mp_start_noalign ucw_mp_start_noalign
+#define mp_stats ucw_mp_stats
+#define mp_str_from_mem ucw_mp_str_from_mem
+#define mp_strdup ucw_mp_strdup
+#define mp_strjoin ucw_mp_strjoin
+#define mp_total_size ucw_mp_total_size
+#define mp_vprintf ucw_mp_vprintf
+#define mp_vprintf_append ucw_mp_vprintf_append
+#endif
+
 /***
  * [[defs]]
  * Definitions
@@ -170,8 +203,7 @@ void *mp_start_internal(struct mempool *pool, uns size) LIKE_MALLOC;
 void *mp_grow_internal(struct mempool *pool, uns size);
 void *mp_spread_internal(struct mempool *pool, void *p, uns size);
 
-static inline uns
-mp_idx(struct mempool *pool, void *ptr)
+static inline uns mp_idx(struct mempool *pool, void *ptr)
 {
   return ptr == pool->last_big;
 }
@@ -410,6 +442,11 @@ static inline char *LIKE_MALLOC mp_strcat(struct mempool *mp, const char *x, con
  * tells how many there is of them.
  **/
 char *mp_strjoin(struct mempool *p, char **a, uns n, uns sep) LIKE_MALLOC;
+/**
+ * Convert memory block to a string. Makes a copy of the given memory block
+ * in the mempool @p, adding an extra terminating zero byte at the end.
+ **/
+char *mp_str_from_mem(struct mempool *p, const void *mem, uns len) LIKE_MALLOC;
 
 
 /***