X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flibpspp%2Fpool.h;h=7dab5b47e4978806926b1e914667fa0483aa562f;hb=e7d0a9f16192ceeff9243f0ede8e399ee1ef0d44;hp=daa866b356110fbc74f4ec313047b1bad8782d14;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp diff --git a/src/libpspp/pool.h b/src/libpspp/pool.h index daa866b356..7dab5b47e4 100644 --- a/src/libpspp/pool.h +++ b/src/libpspp/pool.h @@ -1,5 +1,5 @@ /* PSPP - computes sample statistics. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2006 Free Software Foundation, Inc. Written by Ben Pfaff . This program is free software; you can redistribute it and/or @@ -20,7 +20,10 @@ #if !pool_h #define pool_h 1 +#include #include +#include +#include "compiler.h" /* Maximum size of a suballocated block. Larger blocks are allocated directly with malloc() to avoid memory wastage at the end of a @@ -62,7 +65,10 @@ void *pool_clone (struct pool *, const void *, size_t) MALLOC_LIKE; void *pool_alloc_unaligned (struct pool *, size_t) MALLOC_LIKE; void *pool_clone_unaligned (struct pool *, const void *, size_t) MALLOC_LIKE; char *pool_strdup (struct pool *, const char *) MALLOC_LIKE; -char *pool_strcat (struct pool *, const char *, ...) MALLOC_LIKE; +char *pool_vasprintf (struct pool *, const char *, va_list) + MALLOC_LIKE PRINTF_FORMAT (2, 0); +char *pool_asprintf (struct pool *, const char *, ...) + MALLOC_LIKE PRINTF_FORMAT (2, 3); /* Standard allocation routines. */ void *pool_malloc (struct pool *, size_t) MALLOC_LIKE; @@ -78,20 +84,20 @@ void pool_add_subpool (struct pool *, struct pool *subpool); /* Files. */ FILE *pool_fopen (struct pool *, const char *, const char *); -int pool_fclose (struct pool *, FILE *); +int pool_fclose (struct pool *, FILE *) WARN_UNUSED_RESULT; FILE *pool_tmpfile (struct pool *); void pool_attach_file (struct pool *, FILE *); void pool_detach_file (struct pool *, FILE *); /* Custom allocations. */ void pool_register (struct pool *, void (*free) (void *), void *p); -int pool_unregister (struct pool *, void *); +bool pool_unregister (struct pool *, void *); /* Partial freeing. */ void pool_mark (struct pool *, struct pool_mark *); void pool_release (struct pool *, const struct pool_mark *); -#if GLOBAL_DEBUGGING +#if DEBUGGING void pool_dump (const struct pool *, const char *title); #endif