1 /* Structure size (for version checking). */
4 /* Private data; users should not touch this. */
5 struct emacs_env_private
*private_members
;
7 /* Memory management. */
9 emacs_value (*make_global_ref
) (emacs_env
*env
,
10 emacs_value any_reference
)
11 EMACS_ATTRIBUTE_NONNULL(1);
13 void (*free_global_ref
) (emacs_env
*env
,
14 emacs_value global_reference
)
15 EMACS_ATTRIBUTE_NONNULL(1);
17 /* Non-local exit handling. */
19 enum emacs_funcall_exit (*non_local_exit_check
) (emacs_env
*env
)
20 EMACS_ATTRIBUTE_NONNULL(1);
22 void (*non_local_exit_clear
) (emacs_env
*env
)
23 EMACS_ATTRIBUTE_NONNULL(1);
25 enum emacs_funcall_exit (*non_local_exit_get
)
27 emacs_value
*non_local_exit_symbol_out
,
28 emacs_value
*non_local_exit_data_out
)
29 EMACS_ATTRIBUTE_NONNULL(1, 2, 3);
31 void (*non_local_exit_signal
) (emacs_env
*env
,
32 emacs_value non_local_exit_symbol
,
33 emacs_value non_local_exit_data
)
34 EMACS_ATTRIBUTE_NONNULL(1);
36 void (*non_local_exit_throw
) (emacs_env
*env
,
39 EMACS_ATTRIBUTE_NONNULL(1);
41 /* Function registration. */
43 emacs_value (*make_function
) (emacs_env
*env
,
46 emacs_value (*function
) (emacs_env
*env
,
51 EMACS_ATTRIBUTE_NONNULL(1),
52 const char *documentation
,
54 EMACS_ATTRIBUTE_NONNULL(1, 4);
56 emacs_value (*funcall
) (emacs_env
*env
,
60 EMACS_ATTRIBUTE_NONNULL(1);
62 emacs_value (*intern
) (emacs_env
*env
,
63 const char *symbol_name
)
64 EMACS_ATTRIBUTE_NONNULL(1, 2);
66 /* Type conversion. */
68 emacs_value (*type_of
) (emacs_env
*env
,
70 EMACS_ATTRIBUTE_NONNULL(1);
72 bool (*is_not_nil
) (emacs_env
*env
, emacs_value value
)
73 EMACS_ATTRIBUTE_NONNULL(1);
75 bool (*eq
) (emacs_env
*env
, emacs_value a
, emacs_value b
)
76 EMACS_ATTRIBUTE_NONNULL(1);
78 intmax_t (*extract_integer
) (emacs_env
*env
, emacs_value value
)
79 EMACS_ATTRIBUTE_NONNULL(1);
81 emacs_value (*make_integer
) (emacs_env
*env
, intmax_t value
)
82 EMACS_ATTRIBUTE_NONNULL(1);
84 double (*extract_float
) (emacs_env
*env
, emacs_value value
)
85 EMACS_ATTRIBUTE_NONNULL(1);
87 emacs_value (*make_float
) (emacs_env
*env
, double value
)
88 EMACS_ATTRIBUTE_NONNULL(1);
90 /* Copy the content of the Lisp string VALUE to BUFFER as an utf8
91 null-terminated string.
93 SIZE must point to the total size of the buffer. If BUFFER is
94 NULL or if SIZE is not big enough, write the required buffer size
95 to SIZE and return true.
97 Note that SIZE must include the last null byte (e.g. "abc" needs
100 Return true if the string was successfully copied. */
102 bool (*copy_string_contents
) (emacs_env
*env
,
105 ptrdiff_t *size_inout
)
106 EMACS_ATTRIBUTE_NONNULL(1, 4);
108 /* Create a Lisp string from a utf8 encoded string. */
109 emacs_value (*make_string
) (emacs_env
*env
,
110 const char *contents
, ptrdiff_t length
)
111 EMACS_ATTRIBUTE_NONNULL(1, 2);
113 /* Embedded pointer type. */
114 emacs_value (*make_user_ptr
) (emacs_env
*env
,
115 void (*fin
) (void *) EMACS_NOEXCEPT
,
117 EMACS_ATTRIBUTE_NONNULL(1);
119 void *(*get_user_ptr
) (emacs_env
*env
, emacs_value uptr
)
120 EMACS_ATTRIBUTE_NONNULL(1);
121 void (*set_user_ptr
) (emacs_env
*env
, emacs_value uptr
, void *ptr
)
122 EMACS_ATTRIBUTE_NONNULL(1);
124 void (*(*get_user_finalizer
) (emacs_env
*env
, emacs_value uptr
))
125 (void *) EMACS_NOEXCEPT
EMACS_ATTRIBUTE_NONNULL(1);
126 void (*set_user_finalizer
) (emacs_env
*env
,
128 void (*fin
) (void *) EMACS_NOEXCEPT
)
129 EMACS_ATTRIBUTE_NONNULL(1);
131 /* Vector functions. */
132 emacs_value (*vec_get
) (emacs_env
*env
, emacs_value vec
, ptrdiff_t i
)
133 EMACS_ATTRIBUTE_NONNULL(1);
135 void (*vec_set
) (emacs_env
*env
, emacs_value vec
, ptrdiff_t i
,
137 EMACS_ATTRIBUTE_NONNULL(1);
139 ptrdiff_t (*vec_size
) (emacs_env
*env
, emacs_value vec
)
140 EMACS_ATTRIBUTE_NONNULL(1);