libsir 2.2.5
Standard Incident Reporter
Loading...
Searching...
No Matches
plugins.h
1/*
2 * plugins.h
3 *
4 * Version: 2.2.5
5 *
6 * -----------------------------------------------------------------------------
7 *
8 * SPDX-License-Identifier: MIT
9 *
10 * Copyright (c) 2018-2024 Ryan M. Lederman <lederman@gmail.com>
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a copy of
13 * this software and associated documentation files (the "Software"), to deal in
14 * the Software without restriction, including without limitation the rights to
15 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
16 * the Software, and to permit persons to whom the Software is furnished to do so,
17 * subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included in all
20 * copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
24 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
25 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
26 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 *
29 * -----------------------------------------------------------------------------
30 */
31
32#ifndef _SIR_PLUGINS_H_INCLUDED
33# define _SIR_PLUGINS_H_INCLUDED
34
35# include "sir/types.h"
36
37typedef bool (*sir_plugin_pred)(const void*, const sir_plugin*);
38
39sirpluginid _sir_plugin_load(const char* path);
40sirpluginid _sir_plugin_probe(sir_plugin* plugin);
41sir_pluginexport _sir_plugin_getexport(sir_pluginhandle handle, const char* name);
42bool _sir_plugin_unload(sir_plugin* plugin);
43
44sirpluginid _sir_plugin_add(sir_plugin* plugin);
45bool _sir_plugin_rem(sirpluginid id);
46void _sir_plugin_destroy(sir_plugin** plugin);
47
48bool _sir_plugin_cache_pred_id(const void* match, const sir_plugin* iter);
49
50sirpluginid _sir_plugin_cache_add(sir_plugincache* spc, sir_plugin* plugin);
51sir_plugin* _sir_plugin_cache_find_id(const sir_plugincache* spc, sirpluginid id);
52sir_plugin* _sir_plugin_cache_find(const sir_plugincache* spc, const void* match, sir_plugin_pred pred);
53bool _sir_plugin_cache_rem(sir_plugincache* spc, sirpluginid id);
54bool _sir_plugin_cache_destroy(sir_plugincache* spc);
55bool _sir_plugin_cache_dispatch(const sir_plugincache* spc, sir_level level, sirbuf* buf,
56 size_t* dispatched, size_t* wanted);
57
58#endif /* !_SIR_PLUGINS_H_INCLUDED */
uint16_t sir_level
The sir_level type.
Definition types.h:71
uint32_t sirpluginid
Plugin module identifier type.
Definition types.h:52
Internally-used plugin module data.
Definition types.h:368
Plugin module cache.
Definition types.h:379
Formatted output container.
Definition types.h:412