Debian Codegraph @

modules/lsp-runtime-lib/include/lsp-plug.in/resource/types.h

raw
1 /*
2 * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2020 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-runtime-lib
6 * Created on: 26 окт. 2020 г.
7 *
8 * lsp-runtime-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-runtime-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-runtime-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifndef LSP_PLUG_IN_RESOURCE_TYPES_H_
23 #define LSP_PLUG_IN_RESOURCE_TYPES_H_
24
25 #include <lsp-plug.in/runtime/version.h>
26 #include <lsp-plug.in/common/types.h>
27
28 namespace lsp
29 {
30 namespace resource
31 {
32 static const size_t RESOURCE_NAME_MAX = 64;
33
34 enum resource_type_t
35 {
36 RES_FILE,
37 RES_DIR
38 };
39
40 /**
41 * Resource descriptor
42 */
43 typedef struct resource_t
44 {
45 resource_type_t type;
46 char name[RESOURCE_NAME_MAX];
47 } resource_t;
48
49 /**
50 * Raw resource descriptor
51 */
52 typedef struct raw_resource_t
53 {
54 resource_type_t type; // Type of resource
55 const char *name; // Name of resource
56 int32_t parent; // Index of parent resource (negative if none)
57 int32_t segment; // The start of segment
58 int32_t offset; // Offset of the resource
59 uint32_t length; // Length of the resource
60 } raw_resource_t;
61
62 /**
63 * Raw resource storage
64 */
65 typedef struct raw_storage_t
66 {
67 const char *data; // The resource data
68 const char *commands; // The list of compression commands
69 const raw_resource_t *resources; // The list of built-in resources
70 } raw_storage_t;
71 }
72 }
73
74 #endif /* LSP_PLUG_IN_RESOURCE_TYPES_H_ */