5 #define LUABIND_DONT_COPY_STRINGS
6 //#define LUABIND_NO_ERROR_CHECKING
14 #include <luabind/luabind.hpp>
17 void bind_cln(lua_State
* L
)
19 using namespace luabind
;
23 class_
<cl_R
>(L
, "cl_R")
25 .def(constructor
<const cl_I
&>())
26 .def(constructor
<float>())
27 .def(constructor
<const char*>())
28 .def(tostring(const_self
))
30 .def(const_self
+ const_self
)
31 .def(const_self
- const_self
)
32 .def(const_self
* const_self
)
33 .def(const_self
/ const_self
)
34 .def(const_self
<= const_self
)
35 .def(const_self
< const_self
)
36 .def(const_self
== const_self
)
37 .def(other
<int>() + const_self
)
38 .def(other
<int>() - const_self
)
39 .def(other
<int>() * const_self
)
40 .def(other
<int>() / const_self
)
41 .def(other
<int>() <= const_self
)
42 .def(other
<int>() < const_self
)
43 .def(const_self
+ other
<int>())
44 .def(const_self
- other
<int>())
45 .def(const_self
* other
<int>())
46 .def(const_self
/ other
<int>())
47 .def(const_self
<= other
<int>())
48 .def(const_self
< other
<int>())
53 class_
<cl_RA
, cl_R
>(L
, "cl_RA")
55 .def(constructor
<const cl_I
&>())
56 .def(constructor
<int>())
57 .def(constructor
<const char*>())
58 .def(tostring(const_self
))
60 .def(const_self
+ const_self
)
61 .def(const_self
- const_self
)
62 .def(const_self
* const_self
)
63 .def(const_self
/ const_self
)
64 .def(const_self
<= const_self
)
65 .def(const_self
< const_self
)
66 .def(const_self
== const_self
)
67 .def(other
<int>() + const_self
)
68 .def(other
<int>() - const_self
)
69 .def(other
<int>() * const_self
)
70 .def(other
<int>() / const_self
)
71 .def(other
<int>() <= const_self
)
72 .def(other
<int>() < const_self
)
73 .def(const_self
+ other
<int>())
74 .def(const_self
- other
<int>())
75 .def(const_self
* other
<int>())
76 .def(const_self
/ other
<int>())
77 .def(const_self
<= other
<int>())
78 .def(const_self
< other
<int>())
82 class_
<cl_I
, cl_RA
>(L
, "cl_I")
84 .def(constructor
<const cl_I
&>())
85 .def(constructor
<int>())
86 .def(constructor
<const char*>())
87 .def(tostring(const_self
))
89 .def(const_self
+ const_self
)
90 .def(const_self
- const_self
)
91 .def(const_self
* const_self
)
92 .def(const_self
<= const_self
)
93 .def(const_self
< const_self
)
94 .def(const_self
== const_self
)
95 .def(other
<int>() + const_self
)
96 .def(other
<int>() - const_self
)
97 .def(other
<int>() * const_self
)
98 .def(other
<int>() <= const_self
)
99 .def(other
<int>() < const_self
)
100 .def(const_self
+ other
<int>())
101 .def(const_self
- other
<int>())
102 .def(const_self
* other
<int>())
103 .def(const_self
<= other
<int>())
104 .def(const_self
< other
<int>())
107 function(L
, "factorial", &factorial
);
108 // function(L, "numerator", &numerator);
109 // function(L, "denominator", &denominator);
110 // function(L, "max", &max);
111 // function(L, "min", &min);
112 // function(L, "floor", &floor1);
113 // function(L, "ceiling", &ceiling1);
114 // function(L, "truncate", &truncate1);
115 // function(L, "round", &round1);
116 // function(L, "mod", &cln::mod);
117 // function(L, "rem", &rem);
118 // function(L, "sqrt", &sqrt);
119 // function(L, "exp", &exp);
120 // function(L, "ln", &ln);
121 // function(L, "log", &log);
126 lua_State
* L
= lua_open();
133 lua_dofile(L
, "cln_test.lua");