diff options
Diffstat (limited to 'test/data/emacs-module/mod-test.c')
| -rw-r--r-- | test/data/emacs-module/mod-test.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c index 37186fcc4d1..da298d4e398 100644 --- a/test/data/emacs-module/mod-test.c +++ b/test/data/emacs-module/mod-test.c | |||
| @@ -673,6 +673,14 @@ Fmod_test_async_pipe (emacs_env *env, ptrdiff_t nargs, emacs_value *args, | |||
| 673 | return env->intern (env, "nil"); | 673 | return env->intern (env, "nil"); |
| 674 | } | 674 | } |
| 675 | 675 | ||
| 676 | static emacs_value | ||
| 677 | Fmod_test_identity (emacs_env *env, ptrdiff_t nargs, emacs_value *args, | ||
| 678 | void *data) | ||
| 679 | { | ||
| 680 | assert (nargs == 1); | ||
| 681 | return args[0]; | ||
| 682 | } | ||
| 683 | |||
| 676 | /* Lisp utilities for easier readability (simple wrappers). */ | 684 | /* Lisp utilities for easier readability (simple wrappers). */ |
| 677 | 685 | ||
| 678 | /* Provide FEATURE to Emacs. */ | 686 | /* Provide FEATURE to Emacs. */ |
| @@ -764,6 +772,19 @@ emacs_module_init (struct emacs_runtime *ert) | |||
| 764 | 772 | ||
| 765 | #undef DEFUN | 773 | #undef DEFUN |
| 766 | 774 | ||
| 775 | emacs_value constant_fn | ||
| 776 | = env->make_function (env, 0, 0, Fmod_test_return_t, NULL, NULL); | ||
| 777 | env->make_interactive (env, constant_fn, env->intern (env, "nil")); | ||
| 778 | bind_function (env, "mod-test-return-t-int", constant_fn); | ||
| 779 | |||
| 780 | emacs_value identity_fn | ||
| 781 | = env->make_function (env, 1, 1, Fmod_test_identity, NULL, NULL); | ||
| 782 | const char *interactive_spec = "i"; | ||
| 783 | env->make_interactive (env, identity_fn, | ||
| 784 | env->make_string (env, interactive_spec, | ||
| 785 | strlen (interactive_spec))); | ||
| 786 | bind_function (env, "mod-test-identity", identity_fn); | ||
| 787 | |||
| 767 | provide (env, "mod-test"); | 788 | provide (env, "mod-test"); |
| 768 | return 0; | 789 | return 0; |
| 769 | } | 790 | } |