diff options
author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2014-12-02 16:17:10 -0500 |
---|---|---|
committer | Ted Zlatanov <tzz@lifelogs.com> | 2014-12-04 19:54:16 -0500 |
commit | ae901ddbfff04e8b1b0d63c452a6ca3f4c81fb17 (patch) | |
tree | b806504944c633be45255321d1203bbcc2504781 /modules/fmod/fmod.c | |
parent | dd601050e7db69f322eea09d99751d8e6363b153 (diff) | |
download | emacs-dynamic-modules-rc2.tar.gz |
Add external modulesold-branches/dynamic-modules-rc2dynamic-modules-rc2
* configure.ac: Add libtool support and module Makefiles.
* src/Makefile.in: Support libtool.
* src/alloc.c (mark_object): Mark the doc field of Lisp_Subr as object.
* src/doc.c (doc_is_from_module_p, get_doc_string, reread_doc_file)
(store_function_docstring, build_file_p, Fsnarf_documentation):
Support docstrings for external modules.
* src/lisp.h: Make the doc field of Lisp_Subr a Lisp_Object.
* src/lread.c (Fget_load_suffixes, Fload_module, string_suffixes_p)
(string_suffix_p, Fload, intern_c_string_1, defsubr)
(syms_of_lread): Add loading of external modules and the
docstrings of their functions.
* modules/curl: New module.
* modules/elisp: New module.
* modules/fmod: New module.
* modules/opaque: New module.
* modules/yaml: New module.
Diffstat (limited to 'modules/fmod/fmod.c')
-rw-r--r-- | modules/fmod/fmod.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/modules/fmod/fmod.c b/modules/fmod/fmod.c new file mode 100644 index 00000000000..57da6168ae2 --- /dev/null +++ b/modules/fmod/fmod.c @@ -0,0 +1,60 @@ +#include <config.h> +#include <lisp.h> + +#include <math.h> + +/* emacs checks for this symbol before running the module */ + +int plugin_is_GPL_compatible; + +/* module feature name */ +static Lisp_Object Qfmod; + +/* define a new lisp function */ + +EXFUN (Ffmod, 2); +DEFUN ("fmod", Ffmod, Sfmod, 2, 2, 0, + doc: "Returns the floating-point remainder of NUMER/DENOM") + (Lisp_Object numer, Lisp_Object denom) +{ + return make_float (fmod (extract_float (numer), extract_float (denom))); +} + +EXFUN (Ffmod_test1, 0); +DEFUN ("fmod-test1", Ffmod_test1, Sfmod_test1, 0, 0, 0, + doc: "Return 1") + (void) +{ + return make_float (1.); +} + +EXFUN (Ffmod_test2, 0); +DEFUN ("fmod-test2", Ffmod_test2, Sfmod_test2, 0, 0, 0, + doc: "Return 2") + (void) +{ + return make_float (2.); +} + + +EXFUN (Ffmod_test3, 0); +DEFUN ("fmod-test3", Ffmod_test3, Sfmod_test3, 0, 0, 0, + doc: "Return 3") + (void) +{ + return make_float (3.); +} + +/* entry point of the module */ + +void init () +{ + DEFSYM (Qfmod, "fmod"); + + defsubr (&Sfmod); + defsubr (&Sfmod_test1); + defsubr (&Sfmod_test2); + defsubr (&Sfmod_test3); + + Fprovide (Qfmod, Qnil); +} |