From 42f10e04df42ab19aac74f82a6f113ee29e2012b Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 30 Aug 2011 16:48:36 +0000 Subject: Remove buflib from the pluginlib and use the core one. buflib_get_data() isn't inlined for plugins anymore, but can be if really needed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30387 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugin.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'apps/plugin.h') diff --git a/apps/plugin.h b/apps/plugin.h index 9bfe3fa..d566a5d 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -91,6 +91,7 @@ void* plugin_get_buffer(size_t *buffer_size); #include "list.h" #include "tree.h" #include "color_picker.h" +#include "buflib.h" #include "buffering.h" #include "tagcache.h" #include "viewport.h" @@ -928,6 +929,23 @@ struct plugin_api { the API gets incompatible */ struct entry* (*tree_get_entries)(struct tree_context* t); struct entry* (*tree_get_entry_at)(struct tree_context* t, int index); + + /* the buflib memory management library */ + void (*buflib_init)(struct buflib_context* ctx, void* buf, size_t size); + size_t (*buflib_available)(struct buflib_context* ctx); + int (*buflib_alloc)(struct buflib_context* ctx, size_t size); + int (*buflib_alloc_ex)(struct buflib_context* ctx, size_t size, + const char* name, struct buflib_callbacks *ops); + int (*buflib_alloc_maximum)(struct buflib_context* ctx, const char* name, + size_t* size, struct buflib_callbacks *ops); + void (*buflib_buffer_in)(struct buflib_context* ctx, int size); + void* (*buflib_buffer_out)(struct buflib_context* ctx, size_t* size); + int (*buflib_free)(struct buflib_context* ctx, int handle); + bool (*buflib_shrink)(struct buflib_context* ctx, int handle, + void* new_start, size_t new_size); + void* (*buflib_get_data)(struct buflib_context* ctx, int handle); + const char* (*buflib_get_name)(struct buflib_context* ctx, int handle); + }; /* plugin header */ -- cgit v1.1