diff options
| author | 2025-11-17 20:57:42 -0600 | |
|---|---|---|
| committer | 2025-11-17 20:57:42 -0600 | |
| commit | 2b44f885e97b0d8902014a5a61f6687fa2931dec (patch) | |
| tree | 9e3ecfb3858f33a3922f47bde8a2163d9deed95e /include | |
| parent | build config + more plugin stuff (diff) | |
ignore this commit
Diffstat (limited to 'include')
| -rw-r--r-- | include/macros.h | 20 | ||||
| -rw-r--r-- | include/plugins.h | 24 |
2 files changed, 43 insertions, 1 deletions
diff --git a/include/macros.h b/include/macros.h index 3702df7..b7a1bd2 100644 --- a/include/macros.h +++ b/include/macros.h @@ -3,10 +3,28 @@ #include "config.h" -#ifdef PTX_MODULE +#define UNUSED(...) ((void)((void) __VA_ARGS__)) +#define NO_OP_DECL _Static_assert(1, "") + +#ifdef __has_attribute +# if __has_attribute(unavailable) +# define PTX_UNAVAILABLE(_x) __attribute__((unavailable(_x))) +# define PTX_UNAVAILABLE_DEF(_x, _def) _def PTX_UNAVAILABLE(_x) +# else +# define PTX_UNAVAILABLE(_x) +# define PTX_UNAVAILABLE_DEF(_x, _def) /* definition hidden */ NO_OP_DECL +# endif +#else +# define PTX_UNAVAILABLE(_x) +# define PTX_UNAVAILABLE_DEF(_x, _def) /* definition hidden */ NO_OP_DECL +#endif + +#ifdef PTX_PLUGIN #define PTX_API PTX_IMPORT +#define PTX_INTERNAL(_def) PTX_UNAVAILABLE_DEF("internal API", _def) #else #define PTX_API PTX_EXPORT +#define PTX_INTERNAL(_def) _def #endif #endif /* include guard */ diff --git a/include/plugins.h b/include/plugins.h new file mode 100644 index 0000000..f6865e5 --- /dev/null +++ b/include/plugins.h @@ -0,0 +1,24 @@ +#ifndef PTX_PLUGINS_H_INCLUDED +#define PTX_PLUGINS_H_INCLUDED + +#include "macros.h" + +typedef struct ptx__plugin_manager_tag ptx_plugin_manager_t; +typedef struct ptx__plugin_handle_tag ptx_plugin_t; + +/* for testing */ +#ifdef _CLANGD +#undef PTX_PLUGIN +#define PTX_PLUGIN 1 +#endif + +PTX_INTERNAL(ptx_plugin_manager_t *ptx_plugin_manager_new(void) ATTR_MALLOC() ATTR_MALLOC((ptx_plugin_manager_free, 1)) ATTR_WUR); +PTX_INTERNAL(void ptx_plugin_manager_free(ptx_plugin_manager_t *mgr)); + +PTX_INTERNAL(int ptx_plugin_manager_load_dir(ptx_plugin_manager_t *mgr, const char *dir)); + +#ifdef PTX_PLUGIN + +#endif + +#endif |
