diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-04-30 16:20:01 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-04-30 16:20:01 +0300 |
| commit | dbcb4228e0301c241b5d921fd64e6d6139f714e3 (patch) | |
| tree | 09bf856ac97e953a27a74f87f61135fddbf8af2a /include/cu/res.h | |
| parent | 2ca159fb5c2a52f33c499eef1fa50a98a863b0f0 (diff) | |
| download | ek-dbcb4228e0301c241b5d921fd64e6d6139f714e3.tar.gz ek-dbcb4228e0301c241b5d921fd64e6d6139f714e3.zip | |
rename to ek
Diffstat (limited to 'include/cu/res.h')
| -rw-r--r-- | include/cu/res.h | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/include/cu/res.h b/include/cu/res.h deleted file mode 100644 index e1a1fc3..0000000 --- a/include/cu/res.h +++ /dev/null @@ -1,57 +0,0 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later */ - -/** - * @file res.h - * Simple resource manager header. - */ - -#ifndef CT_RES_H -#define CT_RES_H - -#include <stddef.h> - -/** - * Very simple resource manager. - * Keeps track of all allocations and frees them all at once. - */ -struct res { - /** Number of allocations. */ - size_t n; - /** Maximum number of allocations. */ - size_t max; - /** Pointer to array of pointers to allocations. */ - void **p; -}; - -/** - * Create new resource manager. - * - * @return Pointer to resource manager. - */ -struct res *res_create(); - -/** - * Resource manager wrapper around malloc(). - * - * @param r Resource manager. - * @param size Size of allocation. - * @return Pointer to newly allocated area. - */ -void *res_alloc(struct res *r, size_t size); - -/** - * Add already alloced pointer to manager. - * - * @param r Resource manager. - * @param p Pointer to manage. - */ -void res_add(struct res *r, void *p); - -/** - * Destroy resource manager and free all associated allocations. - * - * @param r Resource manager to destroy. - */ -void res_destroy(struct res *r); - -#endif /* CT_RES_H */ |
