libsir 2.2.5
Standard Incident Reporter
Loading...
Searching...
No Matches
plugin_sample.h
1/*
2 * plugin_sample.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_PLUGIN_SAMPLE_H_INCLUDED
33# define _SIR_PLUGIN_SAMPLE_H_INCLUDED
34
35# include "sir/platform.h"
36# include "sir/types.h"
37
43# if defined(__WIN__)
45BOOL APIENTRY DllMain(HMODULE module, DWORD ul_reason_for_call, LPVOID reserved);
46# define PLUGIN_EXPORT __declspec(dllexport)
47# else
48# define PLUGIN_EXPORT
49# endif
50
79PLUGIN_EXPORT bool sir_plugin_query(sir_plugininfo* info);
80
90PLUGIN_EXPORT bool sir_plugin_init(void);
91
105PLUGIN_EXPORT bool sir_plugin_write(sir_level level, const char* message);
106
115PLUGIN_EXPORT bool sir_plugin_cleanup(void);
116
178#endif /* !_SIR_PLUGIN_SAMPLE_H_INCLUDED */
PLUGIN_EXPORT bool sir_plugin_init(void)
Called by libsir after the plugin is queried and successfully validated.
Definition plugin_sample.c:70
PLUGIN_EXPORT bool sir_plugin_cleanup(void)
Called by libsir when the plugin is about to be unloaded.
Definition plugin_sample.c:81
PLUGIN_EXPORT bool sir_plugin_write(sir_level level, const char *message)
Called by libsir when a message is dispatched on any level whose bit was set in the levels bitmask of...
Definition plugin_sample.c:75
PLUGIN_EXPORT bool sir_plugin_query(sir_plugininfo *info)
Called by libsir after the plugin library object is loaded, but before any other functions are probed...
Definition plugin_sample.c:55
uint16_t sir_level
The sir_level type.
Definition types.h:71
The libsir-to-plugin query data structure.
Definition types.h:329