Blame examples/libpool/libpool.h

Packit c00610
#ifndef ST_HAVE_POOL_H
Packit c00610
#define ST_HAVE_POOL_H
Packit c00610
Packit c00610
#ifdef __cplusplus
Packit c00610
extern "C" {
Packit c00610
#endif
Packit c00610
Packit c00610
	typedef struct pool pool_t;
Packit c00610
Packit c00610
/* ------ pool_new - create and return a new pool; make a sub-pool of p if p is non-NULL -------- */
Packit c00610
	struct pool *pool_new(struct pool *p);
Packit c00610
Packit c00610
/* ------ pool_free - destroy a pool and free all memory acquired in this pool and subpools - */
Packit c00610
	void pool_free(struct pool *pool);
Packit c00610
Packit c00610
/* ------ pool_alloc - allocate memory inside of pool ------------------------------------------- */
Packit c00610
	void *pool_alloc(struct pool *pool, int size);
Packit c00610
Packit c00610
/* ------ pool_calloc - allocate memory inside of pool and set to 0 ----------------------------- */
Packit c00610
	void *pool_calloc(struct pool *pool, int size);
Packit c00610
Packit c00610
/* ------ pool_strcat - concatenate the strings in ...; all parts must be char*, last be NULL --- */
Packit c00610
	char *pool_strcat(struct pool *pool, ...);
Packit c00610
Packit c00610
/* ------ pool_strdup - duplicate the string within pool ---------------------------------------- */
Packit c00610
	char *pool_strdup(struct pool *pool, const char *str);
Packit c00610
Packit c00610
/* ------ pool_sprintf - sprintf fmt and ... in pool; currently limited to max length of 8192 --- */
Packit c00610
	char *pool_sprintf(struct pool *pool, const char *fmt, ...);
Packit c00610
Packit c00610
	/* duplicate the first n non-null characters beginning at str */
Packit c00610
	char *pool_strndup(struct pool *pool, const char *str, int n);
Packit c00610
Packit c00610
#ifdef __cplusplus
Packit c00610
}				/* extern "C" */
Packit c00610
#endif
Packit c00610
#endif