summaryrefslogtreecommitdiff
path: root/src/emacs-module.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/emacs-module.h.in')
-rw-r--r--src/emacs-module.h.in32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/emacs-module.h.in b/src/emacs-module.h.in
index 5743d10ca43..fbeaebd7956 100644
--- a/src/emacs-module.h.in
+++ b/src/emacs-module.h.in
@@ -56,7 +56,7 @@ extern "C" {
#endif
/* Current environment. */
-typedef struct emacs_env_27 emacs_env;
+typedef struct emacs_env_@emacs_major_version@ emacs_env;
/* Opaque pointer representing an Emacs Lisp value.
BEWARE: Do not assume NULL is a valid value! */
@@ -74,10 +74,25 @@ struct emacs_runtime
struct emacs_runtime_private *private_members;
/* Return an environment pointer. */
- emacs_env *(*get_environment) (struct emacs_runtime *ert)
+ emacs_env *(*get_environment) (struct emacs_runtime *runtime)
EMACS_ATTRIBUTE_NONNULL(1);
};
+/* Type aliases for function pointer types used in the module API.
+ Note that we don't use these aliases directly in the API to be able
+ to mark the function arguments as 'noexcept' before C++20.
+ However, users can use them if they want. */
+
+/* Function prototype for the module Lisp functions. These must not
+ throw C++ exceptions. */
+typedef emacs_value (*emacs_function) (emacs_env *env, ptrdiff_t nargs,
+ emacs_value *args,
+ void *data)
+ EMACS_NOEXCEPT EMACS_ATTRIBUTE_NONNULL (1);
+
+/* Function prototype for module user-pointer finalizers. These must
+ not throw C++ exceptions. */
+typedef void (*emacs_finalizer) (void *data) EMACS_NOEXCEPT;
/* Possible Emacs function call outcomes. */
enum emacs_funcall_exit
@@ -131,8 +146,19 @@ struct emacs_env_27
@module_env_snippet_27@
};
+struct emacs_env_28
+{
+@module_env_snippet_25@
+
+@module_env_snippet_26@
+
+@module_env_snippet_27@
+
+@module_env_snippet_28@
+};
+
/* Every module should define a function as follows. */
-extern int emacs_module_init (struct emacs_runtime *ert)
+extern int emacs_module_init (struct emacs_runtime *runtime)
EMACS_NOEXCEPT
EMACS_ATTRIBUTE_NONNULL(1);