mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
buflib: Add CONFIG_BUFLIB_BACKEND for selecting a buflib backend
Defaults to the normal "mempool" backend, which is currently the only implementation. Change-Id: I56d034a6e0f5edc90c39526d1551945eec6ca336
This commit is contained in:
parent
680261fbb7
commit
f995c26de9
9 changed files with 48 additions and 5 deletions
30
firmware/include/buflib.h
Normal file
30
firmware/include/buflib.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/**************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2023 Aidan MacDonald
|
||||
*
|
||||
* 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_
|
||||
#define _BUFLIB_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if CONFIG_BUFLIB_BACKEND == BUFLIB_BACKEND_MEMPOOL
|
||||
#include "buflib_mempool.h"
|
||||
#endif
|
||||
|
||||
#endif /* _BUFLIB_H_ */
|
||||
|
|
@ -26,6 +26,10 @@
|
|||
#ifndef _BUFLIB_MEMPOOL_H_
|
||||
#define _BUFLIB_MEMPOOL_H_
|
||||
|
||||
#ifndef _BUFLIB_H_
|
||||
# error "include buflib.h instead"
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
#include "buflib_mempool.h"
|
||||
#include "buflib.h"
|
||||
|
||||
#define CHUNK_ALLOC_INVALID ((size_t)-1)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include "config.h"
|
||||
#include "buflib_mempool.h"
|
||||
#include "buflib.h"
|
||||
#include "chunk_alloc.h"
|
||||
|
||||
/* All functions below are wrappers for functions in buflib.h, except
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue