#define MODULE_FUNCTION_BEGIN_NO_CATCH(error_retval) \
do { \
- eassert (env != NULL); \
check_main_thread (); \
if (module_non_local_exit_check (env) != emacs_funcall_exit_return) \
return error_retval; \
static enum emacs_funcall_exit
module_non_local_exit_check (emacs_env *env)
{
- eassert (env != NULL);
check_main_thread ();
return env->private_members->pending_non_local_exit;
}
static void
module_non_local_exit_clear (emacs_env *env)
{
- eassert (env != NULL);
check_main_thread ();
env->private_members->pending_non_local_exit = emacs_funcall_exit_return;
}
static enum emacs_funcall_exit
module_non_local_exit_get (emacs_env *env, emacs_value *sym, emacs_value *data)
{
- eassert (env != NULL);
- eassert (sym != NULL);
- eassert (data != NULL);
check_main_thread ();
struct emacs_env_private *p = env->private_members;
if (p->pending_non_local_exit != emacs_funcall_exit_return)
static void
module_non_local_exit_signal (emacs_env *env, emacs_value sym, emacs_value data)
{
- eassert (env != NULL);
check_main_thread ();
if (module_non_local_exit_check (env) == emacs_funcall_exit_return)
module_non_local_exit_signal_1 (env, value_to_lisp (sym),
static void
module_non_local_exit_throw (emacs_env *env, emacs_value tag, emacs_value value)
{
- eassert (env != NULL);
check_main_thread ();
if (module_non_local_exit_check (env) == emacs_funcall_exit_return)
module_non_local_exit_throw_1 (env, value_to_lisp (tag),
static intmax_t
module_extract_integer (emacs_env *env, emacs_value n)
{
- verify (MOST_NEGATIVE_FIXNUM >= INTMAX_MIN);
- verify (MOST_POSITIVE_FIXNUM <= INTMAX_MAX);
MODULE_FUNCTION_BEGIN (0);
Lisp_Object l = value_to_lisp (n);
CHECK_NUMBER (l);
}
*length = required_buf_size;
- eassert (SREF (lisp_str_utf8, raw_size) == '\0');
memcpy (buffer, SDATA (lisp_str_utf8), raw_size + 1);
return true;
module_make_string (emacs_env *env, const char *str, ptrdiff_t length)
{
MODULE_FUNCTION_BEGIN (module_nil);
- eassert (str != NULL);
if (! (0 <= length && length <= STRING_BYTES_BOUND))
xsignal0 (Qoverflow_error);
AUTO_STRING_WITH_LEN (lstr, str, length);
module_function_arity (const struct Lisp_Module_Function *const function)
{
ptrdiff_t minargs = function->min_arity;
- eassert (minargs >= 0);
- eassert (minargs <= MOST_POSITIVE_FIXNUM);
ptrdiff_t maxargs = function->max_arity;
- eassert (maxargs >= minargs || maxargs == MANY);
- eassert (maxargs <= MOST_POSITIVE_FIXNUM);
return Fcons (make_number (minargs),
maxargs == MANY ? Qmany : make_number (maxargs));
}