Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
cached_plugin_descriptors.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2020-2021 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __PLUGINS_CACHED_PLUGIN_DESCRIPTORS_H__
11#define __PLUGINS_CACHED_PLUGIN_DESCRIPTORS_H__
12
14#include "utils/yaml.h"
15
22#define CACHED_PLUGIN_DESCRIPTORS_SCHEMA_VERSION 3
23
28{
31
34 int num_descriptors;
35
39 int num_blacklisted;
41
42static const cyaml_schema_field_t cached_plugin_descriptors_fields_schema[] = {
43 YAML_FIELD_INT (CachedPluginDescriptors, schema_version),
46 descriptors,
47 plugin_descriptor_schema),
50 blacklisted,
51 plugin_descriptor_schema),
52
53 CYAML_FIELD_END
54};
55
56static const cyaml_schema_value_t cached_plugin_descriptors_schema = {
59 cached_plugin_descriptors_fields_schema),
60};
61
67
68void
69cached_plugin_descriptors_serialize_to_file (CachedPluginDescriptors * self);
70
75int
78 const char * abs_path);
79
91const PluginDescriptor *
94 const PluginDescriptor * descr,
95 bool check_valid,
96 bool check_blacklisted);
97
111 const char * abs_path);
112
119void
122 const char * abs_path,
123 int _serialize);
124
134void
137 const PluginDescriptor * _new_descr,
138 bool _serialize);
139
146void
149 const PluginDescriptor * descr,
150 int _serialize);
151
155void
157
158void
159cached_plugin_descriptors_free (CachedPluginDescriptors * self);
160
165#endif
PluginDescriptor ** cached_plugin_descriptors_get(CachedPluginDescriptors *self, const char *abs_path)
Returns the PluginDescriptor's corresponding to the .so/.dll file at the given path,...
void cached_plugin_descriptors_replace(CachedPluginDescriptors *self, const PluginDescriptor *_new_descr, bool _serialize)
Replaces a descriptor in the cache.
CachedPluginDescriptors * cached_plugin_descriptors_new(void)
Reads the file and fills up the object.
const PluginDescriptor * cached_plugin_descriptors_find(CachedPluginDescriptors *self, const PluginDescriptor *descr, bool check_valid, bool check_blacklisted)
Finds a descriptor matching the given one's unique identifiers.
void cached_plugin_descriptors_clear(CachedPluginDescriptors *self)
Clears the descriptors and removes the cache file.
int cached_plugin_descriptors_is_blacklisted(CachedPluginDescriptors *self, const char *abs_path)
Returns if the plugin at the given path is blacklisted or not.
void cached_plugin_descriptors_blacklist(CachedPluginDescriptors *self, const char *abs_path, int _serialize)
Appends a descriptor to the cache.
void cached_plugin_descriptors_add(CachedPluginDescriptors *self, const PluginDescriptor *descr, int _serialize)
Appends a descriptor to the cache.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
Definition yaml.h:202
#define YAML_FIELD_FIXED_SIZE_PTR_ARRAY_VAR_COUNT(owner, member, schema)
Fixed-width array of pointers with variable count.
Definition yaml.h:55
Descriptors to be cached.
PluginDescriptor * descriptors[90000]
Valid descriptors.
PluginDescriptor * blacklisted[90000]
Blacklisted paths and hashes, to skip when scanning.
int schema_version
Version of the file.
YAML utils.