GNU Radio's TEST Package
obj-riscv64-linux-gnu/lib/fosphor/resource_internal.h
Go to the documentation of this file.
1/*
2 * resource_internal.h
3 *
4 * Internal structures for the resource management
5 *
6 * Copyright (C) 2013-2021 Sylvain Munaut
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 */
9
10#pragma once
11
12/*! \addtogroup resource
13 * @{
14 */
15
16/*! \file resource_internal.h
17 * \brief Internal header for the resource management
18 */
19
20#include "llist.h"
21
22/*! \brief Internal structure describing a packed resource */
23struct resource_pack
24{
25 const char *name; /*!< \brief Name of the resource */
26 const void *data; /*!< \brief Data (with added final \0) */
27 unsigned int len; /*!< \brief Original length (in bytes) of data */
28};
29
30struct resource_cache
31{
32 struct llist_head head; /*< \brief Linked list head for cache */
33
34 const char *name; /*< \brief Name of the resource */
35 const void *data; /*< \brief Data pointer given to user */
36 unsigned int len; /*< \brief riginal length (in bytes) of data */
37
38 int refcnt; /*< \brief Reference counter */
39 int flags; /*< \brief Flags */
40
41#define RES_FLAG_MALLOCED (1 << 0)
42
43 char extra[0]; /*< \brief Extra data for whatever ... */
44};
45
46/*! @} */
Simple double-linked list.
Definition lib/fosphor/llist.h:25
Definition lib/fosphor/resource_internal.h:31
const char * name
Definition lib/fosphor/resource_internal.h:34
unsigned int len
Definition lib/fosphor/resource_internal.h:36
char extra[0]
Definition lib/fosphor/resource_internal.h:43
int refcnt
Definition lib/fosphor/resource_internal.h:38
struct llist_head head
Definition lib/fosphor/resource_internal.h:32
int flags
Definition lib/fosphor/resource_internal.h:39
const void * data
Definition lib/fosphor/resource_internal.h:35
Internal structure describing a packed resource.
Definition lib/fosphor/resource_internal.h:24
const char * name
Name of the resource.
Definition lib/fosphor/resource_internal.h:25
const void * data
Data (with added final \0)
Definition lib/fosphor/resource_internal.h:26
unsigned int len
Original length (in bytes) of data.
Definition lib/fosphor/resource_internal.h:27