1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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);
}
|