76 |
return;} \ |
return;} \ |
77 |
ret fname |
ret fname |
78 |
|
|
79 |
#define DEFUN_NEW(string,ret,fname,pack,min,max, flags, ret0a0,a12,a34,a56,args,doc) ret fname args |
#define MAKEFUN(pack,string,fname,argd) \ |
80 |
|
(pack == SI ? SI_makefun(string,fname,argd) : \ |
81 |
|
pack == LISP ? LISP_makefun(string,fname,argd) : \ |
82 |
|
error("Bad pack variable in MAKEFUN\n")) |
83 |
|
|
84 |
|
#define mjoin(a_,b_) a_ ## b_ |
85 |
|
#define Mjoin(a_,b_) mjoin(a_,b_) |
86 |
|
|
87 |
|
#define SI 0 |
88 |
|
#define LISP 1 |
89 |
|
|
90 |
|
#undef FFN |
91 |
|
#undef LFD |
92 |
|
#undef FFD |
93 |
|
#undef STATD |
94 |
|
#undef make_function |
95 |
|
#undef make_si_function |
96 |
|
#undef make_si_sfun |
97 |
|
#undef make_special_form |
98 |
|
#ifdef STATIC_FUNCTION_POINTERS |
99 |
|
#define FFN(a_) Mjoin(a_,_static) |
100 |
|
#define LFD(a_) static void FFN(a_) (); void a_ () { FFN(a_)();} static void FFN(a_) |
101 |
|
#define FFD(a_) static void FFN(a_) (object); void a_ (object x) { FFN(a_)(x);} static void FFN(a_) |
102 |
|
#define make_function(a_,b_) make_function_internal(a_,FFN(b_)) |
103 |
|
#define make_si_function(a_,b_) make_si_function_internal(a_,FFN(b_)) |
104 |
|
#define make_special_form(a_,b_) make_special_form_internal(a_,FFN(b_)) |
105 |
|
#define make_si_sfun(a_,b_,c_) make_si_sfun_internal(a_,FFN(b_),c_) |
106 |
|
#define STATD static |
107 |
|
#else |
108 |
|
#define FFN(a_) (a_) |
109 |
|
#define LFD(a_) void a_ |
110 |
|
#define FFD(a_) void a_ |
111 |
|
#define make_function(a_,b_) make_function_internal(a_,b_) |
112 |
|
#define make_si_function(a_,b_) make_si_function_internal(a_,b_) |
113 |
|
#define make_special_form(a_,b_) make_special_form_internal(a_,b_) |
114 |
|
#define make_si_sfun(a_,b_,c_) make_si_sfun_internal(a_,b_,c_) |
115 |
|
#define STATD |
116 |
|
#endif |
117 |
|
|
118 |
|
#define DEFUN_NEW(string,ret,fname,pack,min,max, flags, ret0a0,a12,a34,a56,args,doc) STATD ret FFN(fname) args;\ |
119 |
|
void Mjoin(fname,_init) () {\ |
120 |
|
MAKEFUN(pack,string,(ret (*)())FFN(fname),F_ARGD(min,max,flags,ARGTYPES(ret0a0,a12,a34,a56)));\ |
121 |
|
}\ |
122 |
|
STATD ret FFN(fname) args |
123 |
|
|
124 |
/* eg. |
/* eg. |
125 |
A function taking from 2 to 8 args |
A function taking from 2 to 8 args |
126 |
returning object the first args is object, the next 6 int, and last defaults to object. |
returning object the first args is object, the next 6 int, and last defaults to object. |
130 |
|
|
131 |
/* for defining old style */ |
/* for defining old style */ |
132 |
#define DEFUNO_NEW(string,ret,fname,pack,min,max, flags, ret0a0,a12,a34,a56,oldret,old,args,doc) \ |
#define DEFUNO_NEW(string,ret,fname,pack,min,max, flags, ret0a0,a12,a34,a56,oldret,old,args,doc) \ |
133 |
ret fname args; \ |
STATD ret FFN(fname) args; \ |
134 |
oldret old(void) \ |
void Mjoin(fname,_init) () {\ |
135 |
{ Iinvoke_c_function_from_value_stack((object (*)())fname,F_ARGD(min,max,flags,ARGTYPES(ret0a0,a12,a34,a56))); \ |
MAKEFUN(pack,string,(ret (*)())FFN(fname),F_ARGD(min,max,flags,ARGTYPES(ret0a0,a12,a34,a56)));\ |
136 |
|
}\ |
137 |
|
LFD(old)(void) \ |
138 |
|
{ Iinvoke_c_function_from_value_stack((object (*)())FFN(fname),F_ARGD(min,max,flags,ARGTYPES(ret0a0,a12,a34,a56))); \ |
139 |
return;} \ |
return;} \ |
140 |
ret fname args |
STATD ret FFN(fname) args |
141 |
|
|
142 |
/* these will come later */ |
/* these will come later */ |
143 |
#define DEFUNL DEFUN |
#define DEFUNL DEFUN |