VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
PluginDescriptor.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
VoltMod/Host/IPluginContext.hpp
>
4
#include <cstddef>
5
6
#if defined(_WIN32)
7
#define VOLTMOD_EXPORT __declspec(dllexport)
8
#else
9
#define VOLTMOD_EXPORT __attribute__((visibility("default")))
10
#endif
11
12
namespace
VoltMod
13
{
14
15
/** What a plugin library exports. @ref VoltModVersion stays first: the host reads it before anything else. */
16
struct
PluginDescriptor
17
{
18
/** The VoltMod release the plugin was built with; the host loads only its own. */
19
const
char
*
VoltModVersion
;
20
21
/** The short commit the plugin was built from. */
22
const
char
*
BuildStamp
;
23
24
/** Attach to @p host. On false, write why into @p error, which holds @p errorSize bytes. */
25
bool (*
Load
)(
IPluginContext
* host,
char
* error,
size_t
errorSize);
26
27
/** Release everything Load took. The host frees the library only after this returns. */
28
void (*
Unload
)();
29
30
/** This plugin's status as JSON it owns, valid until the next call. */
31
const
char
* (*Status)();
32
};
33
34
/** The one symbol the host resolves in a plugin library. A new name whenever the descriptor's layout
35
* changes, so an older library is never read. */
36
inline
constexpr
const
char
*
PluginEntryName
=
"VoltMod_Plugin"
;
37
38
}
// namespace VoltMod
IPluginContext.hpp
VoltMod
Definition
Options.hpp:13
VoltMod::PluginEntryName
constexpr const char * PluginEntryName
Definition
PluginDescriptor.hpp:36
VoltMod::IPluginContext
Definition
IPluginContext.hpp:19
VoltMod::PluginDescriptor
Definition
PluginDescriptor.hpp:17
VoltMod::PluginDescriptor::Unload
void(* Unload)()
Definition
PluginDescriptor.hpp:28
VoltMod::PluginDescriptor::Load
bool(* Load)(IPluginContext *host, char *error, size_t errorSize)
Definition
PluginDescriptor.hpp:25
VoltMod::PluginDescriptor::VoltModVersion
const char * VoltModVersion
Definition
PluginDescriptor.hpp:19
VoltMod::PluginDescriptor::BuildStamp
const char * BuildStamp
Definition
PluginDescriptor.hpp:22
include
VoltMod
Host
PluginDescriptor.hpp
Generated by
1.15.0