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/plugins/lib/buflib.h | 58 ----------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 apps/plugins/lib/buflib.h (limited to 'apps/plugins/lib/buflib.h') diff --git a/apps/plugins/lib/buflib.h b/apps/plugins/lib/buflib.h deleted file mode 100644 index 47ad57f..0000000 --- a/apps/plugins/lib/buflib.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** -* __________ __ ___. -* Open \______ \ ____ ____ | | _\_ |__ _______ ___ -* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / -* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < -* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ -* \/ \/ \/ \/ \/ -* $Id$ -* -* This is a memory allocator designed to provide reasonable management of free -* space and fast access to allocated data. More than one allocator can be used -* at a time by initializing multiple contexts. -* -* Copyright (C) 2009 Andrew Mahone -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -* KIND, either express or implied. -* -****************************************************************************/ - -#ifndef _BUFLIB_H_ -#include - -union buflib_data -{ - intptr_t val; - union buflib_data *ptr; -}; - -struct buflib_context -{ - union buflib_data *handle_table; - union buflib_data *first_free_handle; - union buflib_data *last_handle; - union buflib_data *first_free_block; - union buflib_data *buf_start; - union buflib_data *alloc_end; - bool compact; -}; - -void buflib_init(struct buflib_context *context, void *buf, size_t size); -int buflib_alloc(struct buflib_context *context, size_t size); -void buflib_free(struct buflib_context *context, int handle); -void* buflib_buffer_out(struct buflib_context *ctx, size_t *size); -void buflib_buffer_in(struct buflib_context *ctx, int size); - - - -static inline void* buflib_get_data(struct buflib_context *context, int handle) -{ - return (void*)(context->handle_table[-handle].ptr); -} -#endif -- cgit v1.1