From 780d398d7b29ac874df30854f85072a45aaec9a9 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 4 Dec 2010 15:47:32 +0000 Subject: Remove initialisation, use system allocation functions. r=vince svn path=/trunk/libwapcaplet/; revision=10963 --- include/libwapcaplet/libwapcaplet.h | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'include') diff --git a/include/libwapcaplet/libwapcaplet.h b/include/libwapcaplet/libwapcaplet.h index a92dc4e..a5ec3d0 100644 --- a/include/libwapcaplet/libwapcaplet.h +++ b/include/libwapcaplet/libwapcaplet.h @@ -18,16 +18,6 @@ extern "C" #include #include -/** - * Memory allocator function type - * - * @param ptr The old pointer to reallocate (NULL for new allocations). - * @param size The size of block to allocate. - * @param pw The private pointer for the allocator. - * @return The newly allocated/resized pointer or NULL on error. - */ -typedef void *(*lwc_allocator_fn)(void *ptr, size_t size, void *pw); - /** * An interned string. */ @@ -46,9 +36,8 @@ typedef void (*lwc_iteration_callback_fn)(lwc_string *str, void *pw); */ typedef enum lwc_error_e { lwc_error_ok = 0, /**< No error. */ - lwc_error_initialised = 1, /**< Library already initialised. */ - lwc_error_oom = 2, /**< Out of memory. */ - lwc_error_range = 3, /**< Substring internment out of range. */ + lwc_error_oom = 1, /**< Out of memory. */ + lwc_error_range = 2, /**< Substring internment out of range. */ } lwc_error; /** @@ -56,27 +45,6 @@ typedef enum lwc_error_e { */ typedef uint32_t lwc_hash; -/** - * Initialise the library. - * - * Initialise the library with an allocator function. All strings - * interned will be allocated via this function, as will any - * structures required to manage libwapcaplet. In this manner, all - * interned strings are directly comparable, no matter what interned - * them. - * - * @note If you require to know how much memory libwapcaplet is using - * then you should use a counting allocator function. - * - * @param alloc The allocator to use for libwapcaplet allocations. - * @param pw The private word to pass to \a alloc. - * @param buckets The number of buckets to use by default, or zero to - * allow the implementation to choose for itself. - * @return The result of initialising. If not OK do not use - * any further wapcaplet functions. - */ -extern lwc_error lwc_initialise(lwc_allocator_fn alloc, void *pw, lwc_hash buckets); - /** * Intern a string. * -- cgit v1.2.3