]> mj.ucw.cz Git - libucw.git/blobdiff - lib/pools.h
added buck2obj_realloc(), it is automatically called when needed
[libucw.git] / lib / pools.h
index aef1e63e4437f8a1f9838532cea0a12bbae700aa..6058c5eefc9549de214660e3df2c7eea22805fb6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Sherlock Library -- Memory Pools
  *
- *     (c) 1997--2001 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2004 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
@@ -47,4 +47,27 @@ static inline void *mp_alloc_fast_noalign(struct mempool *p, uns l)
   return f;
 }
 
+static inline void *
+mp_start_string(struct mempool *p, uns l)
+{
+  ASSERT(l <= p->chunk_size);
+  return mp_alloc(p, l);
+}
+
+static inline void
+mp_end_string(struct mempool *p, void *stop)
+{
+  p->free = stop;
+}
+
+/* pool-str.c */
+
+char *mp_strdup(struct mempool *, char *);
+char *mp_multicat(struct mempool *, ...);
+static inline char *
+mp_strcat(struct mempool *mp, char *x, char *y)
+{
+  return mp_multicat(mp, x, y, NULL);
+}
+
 #endif