diff options
Diffstat (limited to 'apps/plugins/pdbox/PDa/src/m_pd.h')
-rw-r--r-- | apps/plugins/pdbox/PDa/src/m_pd.h | 1300 |
1 files changed, 1300 insertions, 0 deletions
diff --git a/apps/plugins/pdbox/PDa/src/m_pd.h b/apps/plugins/pdbox/PDa/src/m_pd.h new file mode 100644 index 0000000000..67c569c581 --- /dev/null +++ b/apps/plugins/pdbox/PDa/src/m_pd.h | |||
@@ -0,0 +1,1300 @@ | |||
1 | /* Copyright (c) 1997-1999 Miller Puckette. | ||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | ||
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | ||
4 | |||
5 | #ifndef __m_pd_h_ | ||
6 | |||
7 | #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) | ||
8 | extern "C" { | ||
9 | #endif | ||
10 | |||
11 | #define PD_VERSION 0.37 /* oops, don't use this... */ */ | ||
12 | #define PD_MAJOR_VERSION 0 /* ... use these two instead. */ | ||
13 | #define PD_MINOR_VERSION 37 | ||
14 | |||
15 | /* old name for "MSW" flag -- we have to take it for the sake of many old | ||
16 | "nmakefiles" for externs, which will define NT and not MSW */ | ||
17 | #if defined(NT) && !defined(MSW) | ||
18 | #define MSW | ||
19 | #endif | ||
20 | |||
21 | #ifdef MSW | ||
22 | // #pragma warning( disable : 4091 ) | ||
23 | #pragma warning( disable : 4305 ) /* uncast const double to float */ | ||
24 | #pragma warning( disable : 4244 ) /* uncast float/int conversion etc. */ | ||
25 | #pragma warning( disable : 4101 ) /* unused automatic variables */ | ||
26 | #endif /* MSW */ | ||
27 | |||
28 | /* the external storage class is "extern" in UNIX; in MSW it's ugly. */ | ||
29 | #ifdef MSW | ||
30 | #ifdef PD_INTERNAL | ||
31 | #define EXTERN __declspec(dllexport) extern | ||
32 | #else | ||
33 | #define EXTERN __declspec(dllimport) extern | ||
34 | #endif /* PD_INTERNAL */ | ||
35 | #else | ||
36 | #define EXTERN extern | ||
37 | #endif /* MSW */ | ||
38 | |||
39 | /* and depending on the compiler, hidden data structures are | ||
40 | declared differently: */ | ||
41 | #if defined( __GNUC__) || defined( __BORLANDC__ ) || defined( __MWERKS__ ) | ||
42 | #define EXTERN_STRUCT struct | ||
43 | #else | ||
44 | #define EXTERN_STRUCT extern struct | ||
45 | #endif | ||
46 | |||
47 | |||
48 | #if !defined(_SIZE_T) && !defined(_SIZE_T_) | ||
49 | #include <stddef.h> /* just for size_t -- how lame! */ | ||
50 | #endif | ||
51 | |||
52 | #define MAXPDSTRING 1000 /* use this for anything you want */ | ||
53 | #define MAXPDARG 5 /* max number of args we can typecheck today */ | ||
54 | |||
55 | /* signed and unsigned integer types the size of a pointer: */ | ||
56 | #ifdef __alpha__ | ||
57 | typedef long t_int; | ||
58 | #else | ||
59 | typedef int t_int; | ||
60 | #endif | ||
61 | |||
62 | typedef float t_float; /* a floating-point number at most the same size */ | ||
63 | typedef float t_floatarg; /* floating-point type for function calls */ | ||
64 | |||
65 | typedef struct _symbol | ||
66 | { | ||
67 | char *s_name; | ||
68 | struct _class **s_thing; | ||
69 | struct _symbol *s_next; | ||
70 | } t_symbol; | ||
71 | |||
72 | EXTERN_STRUCT _array; | ||
73 | #define t_array struct _array /* g_canvas.h */ | ||
74 | |||
75 | /* pointers to glist and array elements go through a "stub" which sticks | ||
76 | around after the glist or array is freed. The stub itself is deleted when | ||
77 | both the glist/array is gone and the refcount is zero, ensuring that no | ||
78 | gpointers are pointing here. */ | ||
79 | |||
80 | #define GP_NONE 0 /* the stub points nowhere (has been cut off) */ | ||
81 | #define GP_GLIST 1 /* the stub points to a glist element */ | ||
82 | #define GP_ARRAY 2 /* ... or array */ | ||
83 | |||
84 | typedef struct _gstub | ||
85 | { | ||
86 | union | ||
87 | { | ||
88 | struct _glist *gs_glist; /* glist we're in */ | ||
89 | struct _array *gs_array; /* array we're in */ | ||
90 | } gs_un; | ||
91 | int gs_which; /* GP_GLIST/GP_ARRAY */ | ||
92 | int gs_refcount; /* number of gpointers pointing here */ | ||
93 | } t_gstub; | ||
94 | |||
95 | typedef struct _gpointer /* pointer to a gobj in a glist */ | ||
96 | { | ||
97 | union | ||
98 | { | ||
99 | struct _scalar *gp_scalar; /* scalar we're in (if glist) */ | ||
100 | union word *gp_w; /* raw data (if array) */ | ||
101 | } gp_un; | ||
102 | int gp_valid; /* number which must match gpointee */ | ||
103 | t_gstub *gp_stub; /* stub which points to glist/array */ | ||
104 | } t_gpointer; | ||
105 | |||
106 | typedef union word | ||
107 | { | ||
108 | t_float w_float; | ||
109 | t_symbol *w_symbol; | ||
110 | t_gpointer *w_gpointer; | ||
111 | t_array *w_array; | ||
112 | struct _glist *w_list; | ||
113 | int w_index; | ||
114 | } t_word; | ||
115 | |||
116 | typedef enum | ||
117 | { | ||
118 | A_NULL, | ||
119 | A_FLOAT, | ||
120 | A_SYMBOL, | ||
121 | A_POINTER, | ||
122 | A_SEMI, | ||
123 | A_COMMA, | ||
124 | A_DEFFLOAT, | ||
125 | A_DEFSYM, | ||
126 | A_DOLLAR, | ||
127 | A_DOLLSYM, | ||
128 | A_GIMME, | ||
129 | A_CANT | ||
130 | } t_atomtype; | ||
131 | |||
132 | #define A_DEFSYMBOL A_DEFSYM /* better name for this */ | ||
133 | |||
134 | typedef struct _atom | ||
135 | { | ||
136 | t_atomtype a_type; | ||
137 | union word a_w; | ||
138 | } t_atom; | ||
139 | |||
140 | EXTERN_STRUCT _class; | ||
141 | #define t_class struct _class | ||
142 | |||
143 | EXTERN_STRUCT _outlet; | ||
144 | #define t_outlet struct _outlet | ||
145 | |||
146 | EXTERN_STRUCT _inlet; | ||
147 | #define t_inlet struct _inlet | ||
148 | |||
149 | EXTERN_STRUCT _binbuf; | ||
150 | #define t_binbuf struct _binbuf | ||
151 | |||
152 | EXTERN_STRUCT _clock; | ||
153 | #define t_clock struct _clock | ||
154 | |||
155 | EXTERN_STRUCT _outconnect; | ||
156 | #define t_outconnect struct _outconnect | ||
157 | |||
158 | EXTERN_STRUCT _glist; | ||
159 | #define t_glist struct _glist | ||
160 | #define t_canvas struct _glist /* LATER lose this */ | ||
161 | |||
162 | typedef t_class *t_pd; /* pure datum: nothing but a class pointer */ | ||
163 | |||
164 | typedef struct _gobj /* a graphical object */ | ||
165 | { | ||
166 | t_pd g_pd; /* pure datum header (class) */ | ||
167 | struct _gobj *g_next; /* next in list */ | ||
168 | } t_gobj; | ||
169 | |||
170 | typedef struct _scalar /* a graphical object holding data */ | ||
171 | { | ||
172 | t_gobj sc_gobj; /* header for graphical object */ | ||
173 | t_symbol *sc_template; /* template name (LATER replace with pointer) */ | ||
174 | t_word sc_vec[1]; /* indeterminate-length array of words */ | ||
175 | } t_scalar; | ||
176 | |||
177 | typedef struct _text /* patchable object - graphical, with text */ | ||
178 | { | ||
179 | t_gobj te_g; /* header for graphical object */ | ||
180 | t_binbuf *te_binbuf; /* holder for the text */ | ||
181 | t_outlet *te_outlet; /* linked list of outlets */ | ||
182 | t_inlet *te_inlet; /* linked list of inlets */ | ||
183 | short te_xpix; /* x&y location (within the toplevel) */ | ||
184 | short te_ypix; | ||
185 | short te_width; /* requested width in chars, 0 if auto */ | ||
186 | unsigned int te_type:2; /* from defs below */ | ||
187 | } t_text; | ||
188 | |||
189 | #define T_TEXT 0 /* just a textual comment */ | ||
190 | #define T_OBJECT 1 /* a MAX style patchable object */ | ||
191 | #define T_MESSAGE 2 /* a MAX stype message */ | ||
192 | #define T_ATOM 3 /* a cell to display a number or symbol */ | ||
193 | |||
194 | #define te_pd te_g.g_pd | ||
195 | |||
196 | /* t_object is synonym for t_text (LATER unify them) */ | ||
197 | |||
198 | typedef struct _text t_object; | ||
199 | |||
200 | #define ob_outlet te_outlet | ||
201 | #define ob_inlet te_inlet | ||
202 | #define ob_binbuf te_binbuf | ||
203 | #define ob_pd te_g.g_pd | ||
204 | #define ob_g te_g | ||
205 | |||
206 | typedef void (*t_method)(void); | ||
207 | typedef void *(*t_newmethod)( void); | ||
208 | typedef void (*t_gotfn)(void *x, ...); | ||
209 | |||
210 | /* ---------------- pre-defined objects and symbols --------------*/ | ||
211 | EXTERN t_pd pd_objectmaker; /* factory for creating "object" boxes */ | ||
212 | EXTERN t_pd pd_canvasmaker; /* factory for creating canvases */ | ||
213 | EXTERN t_symbol s_pointer; | ||
214 | EXTERN t_symbol s_float; | ||
215 | EXTERN t_symbol s_symbol; | ||
216 | EXTERN t_symbol s_bang; | ||
217 | EXTERN t_symbol s_list; | ||
218 | EXTERN t_symbol s_anything; | ||
219 | EXTERN t_symbol s_signal; | ||
220 | EXTERN t_symbol s__N; | ||
221 | EXTERN t_symbol s__X; | ||
222 | EXTERN t_symbol s_x; | ||
223 | EXTERN t_symbol s_y; | ||
224 | EXTERN t_symbol s_; | ||
225 | |||
226 | /* --------- prototypes from the central message system ----------- */ | ||
227 | EXTERN void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv); | ||
228 | EXTERN void pd_forwardmess(t_pd *x, int argc, t_atom *argv); | ||
229 | EXTERN t_symbol *gensym(char *s); | ||
230 | EXTERN t_gotfn getfn(t_pd *x, t_symbol *s); | ||
231 | EXTERN t_gotfn zgetfn(t_pd *x, t_symbol *s); | ||
232 | EXTERN void nullfn(void); | ||
233 | EXTERN void pd_vmess(t_pd *x, t_symbol *s, char *fmt, ...); | ||
234 | #define mess0(x, s) ((*getfn((x), (s)))((x))) | ||
235 | #define mess1(x, s, a) ((*getfn((x), (s)))((x), (a))) | ||
236 | #define mess2(x, s, a,b) ((*getfn((x), (s)))((x), (a),(b))) | ||
237 | #define mess3(x, s, a,b,c) ((*getfn((x), (s)))((x), (a),(b),(c))) | ||
238 | #define mess4(x, s, a,b,c,d) ((*getfn((x), (s)))((x), (a),(b),(c),(d))) | ||
239 | #define mess5(x, s, a,b,c,d,e) ((*getfn((x), (s)))((x), (a),(b),(c),(d),(e))) | ||
240 | EXTERN void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv); | ||
241 | EXTERN t_pd *pd_newest(void); | ||
242 | |||
243 | /* --------------- memory management -------------------- */ | ||
244 | EXTERN void *getbytes(size_t nbytes); | ||
245 | EXTERN void *getzbytes(size_t nbytes); | ||
246 | EXTERN void *copybytes(void *src, size_t nbytes); | ||
247 | EXTERN void freebytes(void *x, size_t nbytes); | ||
248 | EXTERN void *resizebytes(void *x, size_t oldsize, size_t newsize); | ||
249 | |||
250 | /* -------------------- atoms ----------------------------- */ | ||
251 | |||
252 | #define SETSEMI(atom) ((atom)->a_type = A_SEMI, (atom)->a_w.w_index = 0) | ||
253 | #define SETCOMMA(atom) ((atom)->a_type = A_COMMA, (atom)->a_w.w_index = 0) | ||
254 | #define SETPOINTER(atom, gp) ((atom)->a_type = A_POINTER, \ | ||
255 | (atom)->a_w.w_gpointer = (gp)) | ||
256 | #define SETFLOAT(atom, f) ((atom)->a_type = A_FLOAT, (atom)->a_w.w_float = (f)) | ||
257 | #define SETSYMBOL(atom, s) ((atom)->a_type = A_SYMBOL, \ | ||
258 | (atom)->a_w.w_symbol = (s)) | ||
259 | #define SETDOLLAR(atom, n) ((atom)->a_type = A_DOLLAR, \ | ||
260 | (atom)->a_w.w_index = (n)) | ||
261 | #define SETDOLLSYM(atom, s) ((atom)->a_type = A_DOLLSYM, \ | ||
262 | (atom)->a_w.w_symbol= (s)) | ||
263 | |||
264 | EXTERN t_float atom_getfloat(t_atom *a); | ||
265 | EXTERN t_int atom_getint(t_atom *a); | ||
266 | EXTERN t_symbol *atom_getsymbol(t_atom *a); | ||
267 | EXTERN t_symbol *atom_gensym(t_atom *a); | ||
268 | EXTERN t_float atom_getfloatarg(int which, int argc, t_atom *argv); | ||
269 | EXTERN t_int atom_getintarg(int which, int argc, t_atom *argv); | ||
270 | EXTERN t_symbol *atom_getsymbolarg(int which, int argc, t_atom *argv); | ||
271 | |||
272 | EXTERN void atom_string(t_atom *a, char *buf, unsigned int bufsize); | ||
273 | |||
274 | /* ------------------ binbufs --------------- */ | ||
275 | |||
276 | EXTERN t_binbuf *binbuf_new(void); | ||
277 | EXTERN void binbuf_free(t_binbuf *x); | ||
278 | EXTERN t_binbuf *binbuf_duplicate(t_binbuf *y); | ||
279 | |||
280 | EXTERN void binbuf_text(t_binbuf *x, char *text, size_t size); | ||
281 | EXTERN void binbuf_gettext(t_binbuf *x, char **bufp, int *lengthp); | ||
282 | EXTERN void binbuf_clear(t_binbuf *x); | ||
283 | EXTERN void binbuf_add(t_binbuf *x, int argc, t_atom *argv); | ||
284 | EXTERN void binbuf_addv(t_binbuf *x, char *fmt, ...); | ||
285 | EXTERN void binbuf_addbinbuf(t_binbuf *x, t_binbuf *y); | ||
286 | EXTERN void binbuf_addsemi(t_binbuf *x); | ||
287 | EXTERN void binbuf_restore(t_binbuf *x, int argc, t_atom *argv); | ||
288 | EXTERN void binbuf_print(t_binbuf *x); | ||
289 | EXTERN int binbuf_getnatom(t_binbuf *x); | ||
290 | EXTERN t_atom *binbuf_getvec(t_binbuf *x); | ||
291 | EXTERN void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv); | ||
292 | EXTERN int binbuf_read(t_binbuf *b, char *filename, char *dirname, | ||
293 | int crflag); | ||
294 | EXTERN int binbuf_read_via_path(t_binbuf *b, char *filename, char *dirname, | ||
295 | int crflag); | ||
296 | EXTERN int binbuf_write(t_binbuf *x, char *filename, char *dir, | ||
297 | int crflag); | ||
298 | EXTERN void binbuf_evalfile(t_symbol *name, t_symbol *dir); | ||
299 | EXTERN t_symbol *binbuf_realizedollsym(t_symbol *s, int ac, t_atom *av, | ||
300 | int tonew); | ||
301 | |||
302 | /* ------------------ clocks --------------- */ | ||
303 | |||
304 | typedef long long t_time; | ||
305 | EXTERN t_clock *clock_new(void *owner, t_method fn); | ||
306 | EXTERN void clock_set(t_clock *x, t_time systime); | ||
307 | EXTERN void clock_delay(t_clock *x, t_time delaytime); | ||
308 | EXTERN void clock_unset(t_clock *x); | ||
309 | EXTERN t_time clock_getlogicaltime(void); | ||
310 | EXTERN t_time clock_getsystime(void); /* OBSOLETE; use clock_getlogicaltime() */ | ||
311 | EXTERN t_time clock_gettimesince(t_time prevsystime); | ||
312 | EXTERN t_time clock_getsystimeafter(t_time delaytime); | ||
313 | EXTERN void clock_free(t_clock *x); | ||
314 | |||
315 | /* ----------------- pure data ---------------- */ | ||
316 | EXTERN t_pd *pd_new(t_class *cls); | ||
317 | EXTERN void pd_free(t_pd *x); | ||
318 | EXTERN void pd_bind(t_pd *x, t_symbol *s); | ||
319 | EXTERN void pd_unbind(t_pd *x, t_symbol *s); | ||
320 | EXTERN t_pd *pd_findbyclass(t_symbol *s, t_class *c); | ||
321 | EXTERN void pd_pushsym(t_pd *x); | ||
322 | EXTERN void pd_popsym(t_pd *x); | ||
323 | EXTERN t_symbol *pd_getfilename(void); | ||
324 | EXTERN t_symbol *pd_getdirname(void); | ||
325 | EXTERN void pd_bang(t_pd *x); | ||
326 | EXTERN void pd_pointer(t_pd *x, t_gpointer *gp); | ||
327 | EXTERN void pd_float(t_pd *x, t_float f); | ||
328 | EXTERN void pd_symbol(t_pd *x, t_symbol *s); | ||
329 | EXTERN void pd_list(t_pd *x, t_symbol *s, int argc, t_atom *argv); | ||
330 | EXTERN void pd_anything(t_pd *x, t_symbol *s, int argc, t_atom *argv); | ||
331 | #define pd_class(x) (*(x)) | ||
332 | |||
333 | /* ----------------- pointers ---------------- */ | ||
334 | EXTERN void gpointer_init(t_gpointer *gp); | ||
335 | EXTERN void gpointer_copy(const t_gpointer *gpfrom, t_gpointer *gpto); | ||
336 | EXTERN void gpointer_unset(t_gpointer *gp); | ||
337 | EXTERN int gpointer_check(const t_gpointer *gp, int headok); | ||
338 | |||
339 | /* ----------------- patchable "objects" -------------- */ | ||
340 | EXTERN_STRUCT _inlet; | ||
341 | #define t_inlet struct _inlet | ||
342 | EXTERN_STRUCT _outlet; | ||
343 | #define t_outlet struct _outlet | ||
344 | |||
345 | EXTERN t_inlet *inlet_new(t_object *owner, t_pd *dest, t_symbol *s1, | ||
346 | t_symbol *s2); | ||
347 | EXTERN t_inlet *pointerinlet_new(t_object *owner, t_gpointer *gp); | ||
348 | EXTERN t_inlet *floatinlet_new(t_object *owner, t_float *fp); | ||
349 | EXTERN t_inlet *symbolinlet_new(t_object *owner, t_symbol **sp); | ||
350 | EXTERN void inlet_free(t_inlet *x); | ||
351 | |||
352 | EXTERN t_outlet *outlet_new(t_object *owner, t_symbol *s); | ||
353 | EXTERN void outlet_bang(t_outlet *x); | ||
354 | EXTERN void outlet_pointer(t_outlet *x, t_gpointer *gp); | ||
355 | EXTERN void outlet_float(t_outlet *x, t_float f); | ||
356 | EXTERN void outlet_symbol(t_outlet *x, t_symbol *s); | ||
357 | EXTERN void outlet_list(t_outlet *x, t_symbol *s, int argc, t_atom *argv); | ||
358 | EXTERN void outlet_anything(t_outlet *x, t_symbol *s, int argc, t_atom *argv); | ||
359 | EXTERN t_symbol *outlet_getsymbol(t_outlet *x); | ||
360 | EXTERN void outlet_free(t_outlet *x); | ||
361 | EXTERN t_object *pd_checkobject(t_pd *x); | ||
362 | |||
363 | |||
364 | /* -------------------- canvases -------------- */ | ||
365 | |||
366 | EXTERN void glob_setfilename(void *dummy, t_symbol *name, t_symbol *dir); | ||
367 | |||
368 | EXTERN void canvas_setargs(int argc, t_atom *argv); | ||
369 | EXTERN void canvas_getargs(int *argcp, t_atom **argvp); | ||
370 | EXTERN t_symbol *canvas_getcurrentdir(void); | ||
371 | EXTERN t_glist *canvas_getcurrent(void); | ||
372 | EXTERN void canvas_makefilename(t_glist *c, char *file, | ||
373 | char *result,int resultsize); | ||
374 | EXTERN t_symbol *canvas_getdir(t_glist *x); | ||
375 | EXTERN int sys_fontwidth(int fontsize); | ||
376 | EXTERN int sys_fontheight(int fontsize); | ||
377 | EXTERN void canvas_dataproperties(t_glist *x, t_scalar *sc, t_binbuf *b); | ||
378 | |||
379 | /* ---------------- widget behaviors ---------------------- */ | ||
380 | |||
381 | EXTERN_STRUCT _widgetbehavior; | ||
382 | #define t_widgetbehavior struct _widgetbehavior | ||
383 | |||
384 | EXTERN_STRUCT _parentwidgetbehavior; | ||
385 | #define t_parentwidgetbehavior struct _parentwidgetbehavior | ||
386 | EXTERN t_parentwidgetbehavior *pd_getparentwidget(t_pd *x); | ||
387 | |||
388 | /* -------------------- classes -------------- */ | ||
389 | |||
390 | #define CLASS_DEFAULT 0 /* flags for new classes below */ | ||
391 | #define CLASS_PD 1 | ||
392 | #define CLASS_GOBJ 2 | ||
393 | #define CLASS_PATCHABLE 3 | ||
394 | #define CLASS_NOINLET 8 | ||
395 | |||
396 | #define CLASS_TYPEMASK 3 | ||
397 | |||
398 | |||
399 | EXTERN t_class *class_new(t_symbol *name, t_newmethod newmethod, | ||
400 | t_method freemethod, size_t size, int flags, t_atomtype arg1, ...); | ||
401 | EXTERN void class_addcreator(t_newmethod newmethod, t_symbol *s, | ||
402 | t_atomtype type1, ...); | ||
403 | EXTERN void class_addmethod(t_class *c, t_method fn, t_symbol *sel, | ||
404 | t_atomtype arg1, ...); | ||
405 | EXTERN void class_addbang(t_class *c, t_method fn); | ||
406 | EXTERN void class_addpointer(t_class *c, t_method fn); | ||
407 | EXTERN void class_doaddfloat(t_class *c, t_method fn); | ||
408 | EXTERN void class_addsymbol(t_class *c, t_method fn); | ||
409 | EXTERN void class_addlist(t_class *c, t_method fn); | ||
410 | EXTERN void class_addanything(t_class *c, t_method fn); | ||
411 | EXTERN void class_sethelpsymbol(t_class *c, t_symbol *s); | ||
412 | EXTERN void class_setwidget(t_class *c, t_widgetbehavior *w); | ||
413 | EXTERN void class_setparentwidget(t_class *c, t_parentwidgetbehavior *w); | ||
414 | EXTERN t_parentwidgetbehavior *class_parentwidget(t_class *c); | ||
415 | EXTERN char *class_getname(t_class *c); | ||
416 | EXTERN char *class_gethelpname(t_class *c); | ||
417 | EXTERN void class_setdrawcommand(t_class *c); | ||
418 | EXTERN int class_isdrawcommand(t_class *c); | ||
419 | EXTERN void class_domainsignalin(t_class *c, int onset); | ||
420 | #define CLASS_MAINSIGNALIN(c, type, field) \ | ||
421 | class_domainsignalin(c, (char *)(&((type *)0)->field) - (char *)0) | ||
422 | |||
423 | /* prototype for functions to save Pd's to a binbuf */ | ||
424 | typedef void (*t_savefn)(t_gobj *x, t_binbuf *b); | ||
425 | EXTERN void class_setsavefn(t_class *c, t_savefn f); | ||
426 | EXTERN t_savefn class_getsavefn(t_class *c); | ||
427 | /* prototype for functions to open properties dialogs */ | ||
428 | typedef void (*t_propertiesfn)(t_gobj *x, struct _glist *glist); | ||
429 | EXTERN void class_setpropertiesfn(t_class *c, t_propertiesfn f); | ||
430 | EXTERN t_propertiesfn class_getpropertiesfn(t_class *c); | ||
431 | |||
432 | #ifndef PD_CLASS_DEF | ||
433 | #define class_addbang(x, y) class_addbang((x), (t_method)(y)) | ||
434 | #define class_addpointer(x, y) class_addpointer((x), (t_method)(y)) | ||
435 | #define class_addfloat(x, y) class_doaddfloat((x), (t_method)(y)) | ||
436 | #define class_addsymbol(x, y) class_addsymbol((x), (t_method)(y)) | ||
437 | #define class_addlist(x, y) class_addlist((x), (t_method)(y)) | ||
438 | #define class_addanything(x, y) class_addanything((x), (t_method)(y)) | ||
439 | #endif | ||
440 | |||
441 | /* ------------ printing --------------------------------- */ | ||
442 | EXTERN void post(char *fmt, ...); | ||
443 | EXTERN void startpost(char *fmt, ...); | ||
444 | EXTERN void poststring(char *s); | ||
445 | EXTERN void postfloat(float f); | ||
446 | EXTERN void postatom(int argc, t_atom *argv); | ||
447 | EXTERN void endpost(void); | ||
448 | EXTERN void error(char *fmt, ...); | ||
449 | EXTERN void bug(char *fmt, ...); | ||
450 | EXTERN void pd_error(void *object, char *fmt, ...); | ||
451 | EXTERN void sys_logerror(char *object, char *s); | ||
452 | EXTERN void sys_unixerror(char *object); | ||
453 | EXTERN void sys_ouch(void); | ||
454 | |||
455 | #ifdef __linux__ | ||
456 | EXTERN char* sys_get_path( void); | ||
457 | #endif | ||
458 | EXTERN void sys_addpath(const char* p); | ||
459 | |||
460 | |||
461 | /* ------------ system interface routines ------------------- */ | ||
462 | EXTERN int sys_isreadablefile(const char *name); | ||
463 | EXTERN void sys_bashfilename(const char *from, char *to); | ||
464 | EXTERN void sys_unbashfilename(const char *from, char *to); | ||
465 | EXTERN int open_via_path(const char *name, const char *ext, const char *dir, | ||
466 | char *dirresult, char **nameresult, unsigned int size, int bin); | ||
467 | EXTERN int sched_geteventno(void); | ||
468 | EXTERN t_time sys_getrealtime(void); | ||
469 | |||
470 | |||
471 | /* ------------ threading ------------------- */ | ||
472 | /* T.Grill - see m_sched.c */ | ||
473 | |||
474 | EXTERN void sys_lock(void); | ||
475 | EXTERN void sys_unlock(void); | ||
476 | EXTERN int sys_trylock(void); | ||
477 | |||
478 | |||
479 | /* --------------- signals ----------------------------------- */ | ||
480 | |||
481 | #define MAXLOGSIG 32 | ||
482 | #define MAXSIGSIZE (1 << MAXLOGSIG) | ||
483 | #ifndef FIXEDPOINT | ||
484 | typedef float t_sample; | ||
485 | #else | ||
486 | #include "m_fixed.h" | ||
487 | #endif | ||
488 | |||
489 | |||
490 | typedef struct _signal | ||
491 | { | ||
492 | int s_n; /* number of points in the array */ | ||
493 | t_sample *s_vec; /* the array */ | ||
494 | float s_sr; /* sample rate */ | ||
495 | int s_refcount; /* number of times used */ | ||
496 | int s_isborrowed; /* whether we're going to borrow our array */ | ||
497 | struct _signal *s_borrowedfrom; /* signal to borrow it from */ | ||
498 | struct _signal *s_nextfree; /* next in freelist */ | ||
499 | struct _signal *s_nextused; /* next in used list */ | ||
500 | } t_signal; | ||
501 | |||
502 | |||
503 | typedef t_int *(*t_perfroutine)(t_int *args); | ||
504 | |||
505 | EXTERN t_int *plus_perform(t_int *args); | ||
506 | EXTERN t_int *zero_perform(t_int *args); | ||
507 | EXTERN t_int *copy_perform(t_int *args); | ||
508 | |||
509 | EXTERN void dsp_add_plus(t_sample *in1, t_sample *in2, t_sample *out, int n); | ||
510 | EXTERN void dsp_add_copy(t_sample *in, t_sample *out, int n); | ||
511 | EXTERN void dsp_add_scalarcopy(t_sample *in, t_sample *out, int n); | ||
512 | EXTERN void dsp_add_zero(t_sample *out, int n); | ||
513 | |||
514 | EXTERN int sys_getblksize(void); | ||
515 | EXTERN float sys_getsr(void); | ||
516 | EXTERN int sys_get_inchannels(void); | ||
517 | EXTERN int sys_get_outchannels(void); | ||
518 | |||
519 | EXTERN void dsp_add(t_perfroutine f, int n, ...); | ||
520 | EXTERN void dsp_addv(t_perfroutine f, int n, t_int *vec); | ||
521 | EXTERN void pd_fft(float *buf, int npoints, int inverse); | ||
522 | EXTERN int ilog2(int n); | ||
523 | |||
524 | EXTERN void mayer_fht(t_sample *fz, int n); | ||
525 | EXTERN void mayer_fft(int n, t_sample *real, t_sample *imag); | ||
526 | EXTERN void mayer_ifft(int n, t_sample *real, t_sample *imag); | ||
527 | EXTERN void mayer_realfft(int n, t_sample *real); | ||
528 | EXTERN void mayer_realifft(int n, t_sample *real); | ||
529 | |||
530 | //EXTERN t_sample cos_table[]; | ||
531 | |||
532 | #define LOGCOSTABSIZE 9 | ||
533 | #define COSTABSIZE (1<<LOGCOSTABSIZE) | ||
534 | |||
535 | EXTERN int canvas_suspend_dsp(void); | ||
536 | EXTERN void canvas_resume_dsp(int oldstate); | ||
537 | EXTERN void canvas_update_dsp(void); | ||
538 | |||
539 | /* IOhannes { (up/downsampling) */ | ||
540 | typedef struct _resample | ||
541 | { | ||
542 | int method; /* up/downsampling method ID */ | ||
543 | |||
544 | t_int downsample; /* downsampling factor */ | ||
545 | t_int upsample; /* upsampling factor */ | ||
546 | |||
547 | t_sample *s_vec; /* here we hold the resampled data */ | ||
548 | int s_n; | ||
549 | |||
550 | t_sample *coeffs; /* coefficients for filtering... */ | ||
551 | int coefsize; | ||
552 | |||
553 | t_sample *buffer; /* buffer for filtering */ | ||
554 | int bufsize; | ||
555 | } t_resample; | ||
556 | |||
557 | EXTERN void resample_init(t_resample *x); | ||
558 | EXTERN void resample_free(t_resample *x); | ||
559 | |||
560 | EXTERN void resample_dsp(t_resample *x, t_sample *in, int insize, t_sample *out, int outsize, int method); | ||
561 | EXTERN void resamplefrom_dsp(t_resample *x, t_sample *in, int insize, int outsize, int method); | ||
562 | EXTERN void resampleto_dsp(t_resample *x, t_sample *out, int insize, int outsize, int method); | ||
563 | /* } IOhannes */ | ||
564 | |||
565 | /* ----------------------- utility functions for signals -------------- */ | ||
566 | EXTERN float mtof(float); | ||
567 | EXTERN float ftom(float); | ||
568 | EXTERN float rmstodb(float); | ||
569 | EXTERN float powtodb(float); | ||
570 | EXTERN float dbtorms(float); | ||
571 | EXTERN float dbtopow(float); | ||
572 | |||
573 | EXTERN float q8_sqrt(float); | ||
574 | EXTERN float q8_rsqrt(float); | ||
575 | #ifndef N32 | ||
576 | EXTERN float qsqrt(float); /* old names kept for extern compatibility */ | ||
577 | EXTERN float qrsqrt(float); | ||
578 | #endif | ||
579 | /* --------------------- data --------------------------------- */ | ||
580 | |||
581 | /* graphical arrays */ | ||
582 | EXTERN_STRUCT _garray; | ||
583 | #define t_garray struct _garray | ||
584 | |||
585 | EXTERN t_class *garray_class; | ||
586 | EXTERN int garray_getfloatarray(t_garray *x, int *size, t_sample **vec); | ||
587 | EXTERN float garray_get(t_garray *x, t_symbol *s, t_int indx); | ||
588 | EXTERN void garray_redraw(t_garray *x); | ||
589 | EXTERN int garray_npoints(t_garray *x); | ||
590 | EXTERN char *garray_vec(t_garray *x); | ||
591 | EXTERN void garray_resize(t_garray *x, t_floatarg f); | ||
592 | EXTERN void garray_usedindsp(t_garray *x); | ||
593 | EXTERN void garray_setsaveit(t_garray *x, int saveit); | ||
594 | EXTERN t_class *scalar_class; | ||
595 | |||
596 | EXTERN t_float *value_get(t_symbol *s); | ||
597 | EXTERN void value_release(t_symbol *s); | ||
598 | EXTERN int value_getfloat(t_symbol *s, t_float *f); | ||
599 | EXTERN int value_setfloat(t_symbol *s, t_float f); | ||
600 | |||
601 | /* ------- GUI interface - functions to send strings to TK --------- */ | ||
602 | EXTERN void sys_vgui(char *fmt, ...); | ||
603 | EXTERN void sys_gui(char *s); | ||
604 | |||
605 | /* dialog window creation and destruction */ | ||
606 | EXTERN void gfxstub_new(t_pd *owner, void *key, const char *cmd); | ||
607 | EXTERN void gfxstub_deleteforkey(void *key); | ||
608 | |||
609 | extern t_class *glob_pdobject; /* object to send "pd" messages */ | ||
610 | |||
611 | /*------------- Max 0.26 compatibility --------------------*/ | ||
612 | |||
613 | /* the following reflects the new way classes are laid out, with the class | ||
614 | pointing to the messlist and not vice versa. Externs shouldn't feel it. */ | ||
615 | typedef t_class *t_externclass; | ||
616 | |||
617 | EXTERN void c_extern(t_externclass *cls, t_newmethod newroutine, | ||
618 | t_method freeroutine, t_symbol *name, size_t size, int tiny, \ | ||
619 | t_atomtype arg1, ...); | ||
620 | EXTERN void c_addmess(t_method fn, t_symbol *sel, t_atomtype arg1, ...); | ||
621 | |||
622 | #define t_getbytes getbytes | ||
623 | #define t_freebytes freebytes | ||
624 | #define t_resizebytes resizebytes | ||
625 | #define typedmess pd_typedmess | ||
626 | #define vmess pd_vmess | ||
627 | |||
628 | /* A definition to help gui objects straddle 0.34-0.35 changes. If this is | ||
629 | defined, there is a "te_xpix" field in objects, not a "te_xpos" as before: */ | ||
630 | |||
631 | #define PD_USE_TE_XPIX | ||
632 | |||
633 | #if 0 | ||
634 | /* a test for NANs and denormals. Should only be necessary on i386. */ | ||
635 | #define PD_BADFLOAT(f) ((((*(unsigned int*)&(f))&0x7f800000)==0) || \ | ||
636 | (((*(unsigned int*)&(f))&0x7f800000)==0x7f800000)) | ||
637 | /* more stringent test: anything not between 1e-19 and 1e19 in absolute val */ | ||
638 | #define PD_BIGORSMALL(f) ((((*(unsigned int*)&(f))&0x60000000)==0) || \ | ||
639 | (((*(unsigned int*)&(f))&0x60000000)==0x60000000)) | ||
640 | #else | ||
641 | #define PD_BADFLOAT(f) 0 | ||
642 | #define PD_BIGORSMALL(f) 0 | ||
643 | #endif | ||
644 | |||
645 | #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) | ||
646 | } | ||
647 | #endif | ||
648 | |||
649 | #define __m_pd_h_ | ||
650 | #endif /* __m_pd_h_ */ | ||
651 | /* Copyright (c) 1997-1999 Miller Puckette. | ||
652 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | ||
653 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | ||
654 | |||
655 | #ifndef __m_pd_h_ | ||
656 | |||
657 | #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) | ||
658 | extern "C" { | ||
659 | #endif | ||
660 | |||
661 | #define PD_VERSION 0.37 /* oops, don't use this... */ */ | ||
662 | #define PD_MAJOR_VERSION 0 /* ... use these two instead. */ | ||
663 | #define PD_MINOR_VERSION 37 | ||
664 | |||
665 | /* old name for "MSW" flag -- we have to take it for the sake of many old | ||
666 | "nmakefiles" for externs, which will define NT and not MSW */ | ||
667 | #if defined(NT) && !defined(MSW) | ||
668 | #define MSW | ||
669 | #endif | ||
670 | |||
671 | #ifdef MSW | ||
672 | // #pragma warning( disable : 4091 ) | ||
673 | #pragma warning( disable : 4305 ) /* uncast const double to float */ | ||
674 | #pragma warning( disable : 4244 ) /* uncast float/int conversion etc. */ | ||
675 | #pragma warning( disable : 4101 ) /* unused automatic variables */ | ||
676 | #endif /* MSW */ | ||
677 | |||
678 | /* the external storage class is "extern" in UNIX; in MSW it's ugly. */ | ||
679 | #ifdef MSW | ||
680 | #ifdef PD_INTERNAL | ||
681 | #define EXTERN __declspec(dllexport) extern | ||
682 | #else | ||
683 | #define EXTERN __declspec(dllimport) extern | ||
684 | #endif /* PD_INTERNAL */ | ||
685 | #else | ||
686 | #define EXTERN extern | ||
687 | #endif /* MSW */ | ||
688 | |||
689 | /* and depending on the compiler, hidden data structures are | ||
690 | declared differently: */ | ||
691 | #if defined( __GNUC__) || defined( __BORLANDC__ ) || defined( __MWERKS__ ) | ||
692 | #define EXTERN_STRUCT struct | ||
693 | #else | ||
694 | #define EXTERN_STRUCT extern struct | ||
695 | #endif | ||
696 | |||
697 | |||
698 | #if !defined(_SIZE_T) && !defined(_SIZE_T_) | ||
699 | #include <stddef.h> /* just for size_t -- how lame! */ | ||
700 | #endif | ||
701 | |||
702 | #define MAXPDSTRING 1000 /* use this for anything you want */ | ||
703 | #define MAXPDARG 5 /* max number of args we can typecheck today */ | ||
704 | |||
705 | /* signed and unsigned integer types the size of a pointer: */ | ||
706 | #ifdef __alpha__ | ||
707 | typedef long t_int; | ||
708 | #else | ||
709 | typedef int t_int; | ||
710 | #endif | ||
711 | |||
712 | typedef float t_float; /* a floating-point number at most the same size */ | ||
713 | typedef float t_floatarg; /* floating-point type for function calls */ | ||
714 | |||
715 | typedef struct _symbol | ||
716 | { | ||
717 | char *s_name; | ||
718 | struct _class **s_thing; | ||
719 | struct _symbol *s_next; | ||
720 | } t_symbol; | ||
721 | |||
722 | EXTERN_STRUCT _array; | ||
723 | #define t_array struct _array /* g_canvas.h */ | ||
724 | |||
725 | /* pointers to glist and array elements go through a "stub" which sticks | ||
726 | around after the glist or array is freed. The stub itself is deleted when | ||
727 | both the glist/array is gone and the refcount is zero, ensuring that no | ||
728 | gpointers are pointing here. */ | ||
729 | |||
730 | #define GP_NONE 0 /* the stub points nowhere (has been cut off) */ | ||
731 | #define GP_GLIST 1 /* the stub points to a glist element */ | ||
732 | #define GP_ARRAY 2 /* ... or array */ | ||
733 | |||
734 | typedef struct _gstub | ||
735 | { | ||
736 | union | ||
737 | { | ||
738 | struct _glist *gs_glist; /* glist we're in */ | ||
739 | struct _array *gs_array; /* array we're in */ | ||
740 | } gs_un; | ||
741 | int gs_which; /* GP_GLIST/GP_ARRAY */ | ||
742 | int gs_refcount; /* number of gpointers pointing here */ | ||
743 | } t_gstub; | ||
744 | |||
745 | typedef struct _gpointer /* pointer to a gobj in a glist */ | ||
746 | { | ||
747 | union | ||
748 | { | ||
749 | struct _scalar *gp_scalar; /* scalar we're in (if glist) */ | ||
750 | union word *gp_w; /* raw data (if array) */ | ||
751 | } gp_un; | ||
752 | int gp_valid; /* number which must match gpointee */ | ||
753 | t_gstub *gp_stub; /* stub which points to glist/array */ | ||
754 | } t_gpointer; | ||
755 | |||
756 | typedef union word | ||
757 | { | ||
758 | t_float w_float; | ||
759 | t_symbol *w_symbol; | ||
760 | t_gpointer *w_gpointer; | ||
761 | t_array *w_array; | ||
762 | struct _glist *w_list; | ||
763 | int w_index; | ||
764 | } t_word; | ||
765 | |||
766 | typedef enum | ||
767 | { | ||
768 | A_NULL, | ||
769 | A_FLOAT, | ||
770 | A_SYMBOL, | ||
771 | A_POINTER, | ||
772 | A_SEMI, | ||
773 | A_COMMA, | ||
774 | A_DEFFLOAT, | ||
775 | A_DEFSYM, | ||
776 | A_DOLLAR, | ||
777 | A_DOLLSYM, | ||
778 | A_GIMME, | ||
779 | A_CANT | ||
780 | } t_atomtype; | ||
781 | |||
782 | #define A_DEFSYMBOL A_DEFSYM /* better name for this */ | ||
783 | |||
784 | typedef struct _atom | ||
785 | { | ||
786 | t_atomtype a_type; | ||
787 | union word a_w; | ||
788 | } t_atom; | ||
789 | |||
790 | EXTERN_STRUCT _class; | ||
791 | #define t_class struct _class | ||
792 | |||
793 | EXTERN_STRUCT _outlet; | ||
794 | #define t_outlet struct _outlet | ||
795 | |||
796 | EXTERN_STRUCT _inlet; | ||
797 | #define t_inlet struct _inlet | ||
798 | |||
799 | EXTERN_STRUCT _binbuf; | ||
800 | #define t_binbuf struct _binbuf | ||
801 | |||
802 | EXTERN_STRUCT _clock; | ||
803 | #define t_clock struct _clock | ||
804 | |||
805 | EXTERN_STRUCT _outconnect; | ||
806 | #define t_outconnect struct _outconnect | ||
807 | |||
808 | EXTERN_STRUCT _glist; | ||
809 | #define t_glist struct _glist | ||
810 | #define t_canvas struct _glist /* LATER lose this */ | ||
811 | |||
812 | typedef t_class *t_pd; /* pure datum: nothing but a class pointer */ | ||
813 | |||
814 | typedef struct _gobj /* a graphical object */ | ||
815 | { | ||
816 | t_pd g_pd; /* pure datum header (class) */ | ||
817 | struct _gobj *g_next; /* next in list */ | ||
818 | } t_gobj; | ||
819 | |||
820 | typedef struct _scalar /* a graphical object holding data */ | ||
821 | { | ||
822 | t_gobj sc_gobj; /* header for graphical object */ | ||
823 | t_symbol *sc_template; /* template name (LATER replace with pointer) */ | ||
824 | t_word sc_vec[1]; /* indeterminate-length array of words */ | ||
825 | } t_scalar; | ||
826 | |||
827 | typedef struct _text /* patchable object - graphical, with text */ | ||
828 | { | ||
829 | t_gobj te_g; /* header for graphical object */ | ||
830 | t_binbuf *te_binbuf; /* holder for the text */ | ||
831 | t_outlet *te_outlet; /* linked list of outlets */ | ||
832 | t_inlet *te_inlet; /* linked list of inlets */ | ||
833 | short te_xpix; /* x&y location (within the toplevel) */ | ||
834 | short te_ypix; | ||
835 | short te_width; /* requested width in chars, 0 if auto */ | ||
836 | unsigned int te_type:2; /* from defs below */ | ||
837 | } t_text; | ||
838 | |||
839 | #define T_TEXT 0 /* just a textual comment */ | ||
840 | #define T_OBJECT 1 /* a MAX style patchable object */ | ||
841 | #define T_MESSAGE 2 /* a MAX stype message */ | ||
842 | #define T_ATOM 3 /* a cell to display a number or symbol */ | ||
843 | |||
844 | #define te_pd te_g.g_pd | ||
845 | |||
846 | /* t_object is synonym for t_text (LATER unify them) */ | ||
847 | |||
848 | typedef struct _text t_object; | ||
849 | |||
850 | #define ob_outlet te_outlet | ||
851 | #define ob_inlet te_inlet | ||
852 | #define ob_binbuf te_binbuf | ||
853 | #define ob_pd te_g.g_pd | ||
854 | #define ob_g te_g | ||
855 | |||
856 | typedef void (*t_method)(void); | ||
857 | typedef void *(*t_newmethod)( void); | ||
858 | typedef void (*t_gotfn)(void *x, ...); | ||
859 | |||
860 | /* ---------------- pre-defined objects and symbols --------------*/ | ||
861 | EXTERN t_pd pd_objectmaker; /* factory for creating "object" boxes */ | ||
862 | EXTERN t_pd pd_canvasmaker; /* factory for creating canvases */ | ||
863 | EXTERN t_symbol s_pointer; | ||
864 | EXTERN t_symbol s_float; | ||
865 | EXTERN t_symbol s_symbol; | ||
866 | EXTERN t_symbol s_bang; | ||
867 | EXTERN t_symbol s_list; | ||
868 | EXTERN t_symbol s_anything; | ||
869 | EXTERN t_symbol s_signal; | ||
870 | EXTERN t_symbol s__N; | ||
871 | EXTERN t_symbol s__X; | ||
872 | EXTERN t_symbol s_x; | ||
873 | EXTERN t_symbol s_y; | ||
874 | EXTERN t_symbol s_; | ||
875 | |||
876 | /* --------- prototypes from the central message system ----------- */ | ||
877 | EXTERN void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv); | ||
878 | EXTERN void pd_forwardmess(t_pd *x, int argc, t_atom *argv); | ||
879 | EXTERN t_symbol *gensym(char *s); | ||
880 | EXTERN t_gotfn getfn(t_pd *x, t_symbol *s); | ||
881 | EXTERN t_gotfn zgetfn(t_pd *x, t_symbol *s); | ||
882 | EXTERN void nullfn(void); | ||
883 | EXTERN void pd_vmess(t_pd *x, t_symbol *s, char *fmt, ...); | ||
884 | #define mess0(x, s) ((*getfn((x), (s)))((x))) | ||
885 | #define mess1(x, s, a) ((*getfn((x), (s)))((x), (a))) | ||
886 | #define mess2(x, s, a,b) ((*getfn((x), (s)))((x), (a),(b))) | ||
887 | #define mess3(x, s, a,b,c) ((*getfn((x), (s)))((x), (a),(b),(c))) | ||
888 | #define mess4(x, s, a,b,c,d) ((*getfn((x), (s)))((x), (a),(b),(c),(d))) | ||
889 | #define mess5(x, s, a,b,c,d,e) ((*getfn((x), (s)))((x), (a),(b),(c),(d),(e))) | ||
890 | EXTERN void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv); | ||
891 | EXTERN t_pd *pd_newest(void); | ||
892 | |||
893 | /* --------------- memory management -------------------- */ | ||
894 | EXTERN void *getbytes(size_t nbytes); | ||
895 | EXTERN void *getzbytes(size_t nbytes); | ||
896 | EXTERN void *copybytes(void *src, size_t nbytes); | ||
897 | EXTERN void freebytes(void *x, size_t nbytes); | ||
898 | EXTERN void *resizebytes(void *x, size_t oldsize, size_t newsize); | ||
899 | |||
900 | /* -------------------- atoms ----------------------------- */ | ||
901 | |||
902 | #define SETSEMI(atom) ((atom)->a_type = A_SEMI, (atom)->a_w.w_index = 0) | ||
903 | #define SETCOMMA(atom) ((atom)->a_type = A_COMMA, (atom)->a_w.w_index = 0) | ||
904 | #define SETPOINTER(atom, gp) ((atom)->a_type = A_POINTER, \ | ||
905 | (atom)->a_w.w_gpointer = (gp)) | ||
906 | #define SETFLOAT(atom, f) ((atom)->a_type = A_FLOAT, (atom)->a_w.w_float = (f)) | ||
907 | #define SETSYMBOL(atom, s) ((atom)->a_type = A_SYMBOL, \ | ||
908 | (atom)->a_w.w_symbol = (s)) | ||
909 | #define SETDOLLAR(atom, n) ((atom)->a_type = A_DOLLAR, \ | ||
910 | (atom)->a_w.w_index = (n)) | ||
911 | #define SETDOLLSYM(atom, s) ((atom)->a_type = A_DOLLSYM, \ | ||
912 | (atom)->a_w.w_symbol= (s)) | ||
913 | |||
914 | EXTERN t_float atom_getfloat(t_atom *a); | ||
915 | EXTERN t_int atom_getint(t_atom *a); | ||
916 | EXTERN t_symbol *atom_getsymbol(t_atom *a); | ||
917 | EXTERN t_symbol *atom_gensym(t_atom *a); | ||
918 | EXTERN t_float atom_getfloatarg(int which, int argc, t_atom *argv); | ||
919 | EXTERN t_int atom_getintarg(int which, int argc, t_atom *argv); | ||
920 | EXTERN t_symbol *atom_getsymbolarg(int which, int argc, t_atom *argv); | ||
921 | |||
922 | EXTERN void atom_string(t_atom *a, char *buf, unsigned int bufsize); | ||
923 | |||
924 | /* ------------------ binbufs --------------- */ | ||
925 | |||
926 | EXTERN t_binbuf *binbuf_new(void); | ||
927 | EXTERN void binbuf_free(t_binbuf *x); | ||
928 | EXTERN t_binbuf *binbuf_duplicate(t_binbuf *y); | ||
929 | |||
930 | EXTERN void binbuf_text(t_binbuf *x, char *text, size_t size); | ||
931 | EXTERN void binbuf_gettext(t_binbuf *x, char **bufp, int *lengthp); | ||
932 | EXTERN void binbuf_clear(t_binbuf *x); | ||
933 | EXTERN void binbuf_add(t_binbuf *x, int argc, t_atom *argv); | ||
934 | EXTERN void binbuf_addv(t_binbuf *x, char *fmt, ...); | ||
935 | EXTERN void binbuf_addbinbuf(t_binbuf *x, t_binbuf *y); | ||
936 | EXTERN void binbuf_addsemi(t_binbuf *x); | ||
937 | EXTERN void binbuf_restore(t_binbuf *x, int argc, t_atom *argv); | ||
938 | EXTERN void binbuf_print(t_binbuf *x); | ||
939 | EXTERN int binbuf_getnatom(t_binbuf *x); | ||
940 | EXTERN t_atom *binbuf_getvec(t_binbuf *x); | ||
941 | EXTERN void binbuf_eval(t_binbuf *x, t_pd *target, int argc, t_atom *argv); | ||
942 | EXTERN int binbuf_read(t_binbuf *b, char *filename, char *dirname, | ||
943 | int crflag); | ||
944 | EXTERN int binbuf_read_via_path(t_binbuf *b, char *filename, char *dirname, | ||
945 | int crflag); | ||
946 | EXTERN int binbuf_write(t_binbuf *x, char *filename, char *dir, | ||
947 | int crflag); | ||
948 | EXTERN void binbuf_evalfile(t_symbol *name, t_symbol *dir); | ||
949 | EXTERN t_symbol *binbuf_realizedollsym(t_symbol *s, int ac, t_atom *av, | ||
950 | int tonew); | ||
951 | |||
952 | /* ------------------ clocks --------------- */ | ||
953 | |||
954 | typedef long long t_time; | ||
955 | EXTERN t_clock *clock_new(void *owner, t_method fn); | ||
956 | EXTERN void clock_set(t_clock *x, t_time systime); | ||
957 | EXTERN void clock_delay(t_clock *x, t_time delaytime); | ||
958 | EXTERN void clock_unset(t_clock *x); | ||
959 | EXTERN t_time clock_getlogicaltime(void); | ||
960 | EXTERN t_time clock_getsystime(void); /* OBSOLETE; use clock_getlogicaltime() */ | ||
961 | EXTERN t_time clock_gettimesince(t_time prevsystime); | ||
962 | EXTERN t_time clock_getsystimeafter(t_time delaytime); | ||
963 | EXTERN void clock_free(t_clock *x); | ||
964 | |||
965 | /* ----------------- pure data ---------------- */ | ||
966 | EXTERN t_pd *pd_new(t_class *cls); | ||
967 | EXTERN void pd_free(t_pd *x); | ||
968 | EXTERN void pd_bind(t_pd *x, t_symbol *s); | ||
969 | EXTERN void pd_unbind(t_pd *x, t_symbol *s); | ||
970 | EXTERN t_pd *pd_findbyclass(t_symbol *s, t_class *c); | ||
971 | EXTERN void pd_pushsym(t_pd *x); | ||
972 | EXTERN void pd_popsym(t_pd *x); | ||
973 | EXTERN t_symbol *pd_getfilename(void); | ||
974 | EXTERN t_symbol *pd_getdirname(void); | ||
975 | EXTERN void pd_bang(t_pd *x); | ||
976 | EXTERN void pd_pointer(t_pd *x, t_gpointer *gp); | ||
977 | EXTERN void pd_float(t_pd *x, t_float f); | ||
978 | EXTERN void pd_symbol(t_pd *x, t_symbol *s); | ||
979 | EXTERN void pd_list(t_pd *x, t_symbol *s, int argc, t_atom *argv); | ||
980 | EXTERN void pd_anything(t_pd *x, t_symbol *s, int argc, t_atom *argv); | ||
981 | #define pd_class(x) (*(x)) | ||
982 | |||
983 | /* ----------------- pointers ---------------- */ | ||
984 | EXTERN void gpointer_init(t_gpointer *gp); | ||
985 | EXTERN void gpointer_copy(const t_gpointer *gpfrom, t_gpointer *gpto); | ||
986 | EXTERN void gpointer_unset(t_gpointer *gp); | ||
987 | EXTERN int gpointer_check(const t_gpointer *gp, int headok); | ||
988 | |||
989 | /* ----------------- patchable "objects" -------------- */ | ||
990 | EXTERN_STRUCT _inlet; | ||
991 | #define t_inlet struct _inlet | ||
992 | EXTERN_STRUCT _outlet; | ||
993 | #define t_outlet struct _outlet | ||
994 | |||
995 | EXTERN t_inlet *inlet_new(t_object *owner, t_pd *dest, t_symbol *s1, | ||
996 | t_symbol *s2); | ||
997 | EXTERN t_inlet *pointerinlet_new(t_object *owner, t_gpointer *gp); | ||
998 | EXTERN t_inlet *floatinlet_new(t_object *owner, t_float *fp); | ||
999 | EXTERN t_inlet *symbolinlet_new(t_object *owner, t_symbol **sp); | ||
1000 | EXTERN void inlet_free(t_inlet *x); | ||
1001 | |||
1002 | EXTERN t_outlet *outlet_new(t_object *owner, t_symbol *s); | ||
1003 | EXTERN void outlet_bang(t_outlet *x); | ||
1004 | EXTERN void outlet_pointer(t_outlet *x, t_gpointer *gp); | ||
1005 | EXTERN void outlet_float(t_outlet *x, t_float f); | ||
1006 | EXTERN void outlet_symbol(t_outlet *x, t_symbol *s); | ||
1007 | EXTERN void outlet_list(t_outlet *x, t_symbol *s, int argc, t_atom *argv); | ||
1008 | EXTERN void outlet_anything(t_outlet *x, t_symbol *s, int argc, t_atom *argv); | ||
1009 | EXTERN t_symbol *outlet_getsymbol(t_outlet *x); | ||
1010 | EXTERN void outlet_free(t_outlet *x); | ||
1011 | EXTERN t_object *pd_checkobject(t_pd *x); | ||
1012 | |||
1013 | |||
1014 | /* -------------------- canvases -------------- */ | ||
1015 | |||
1016 | EXTERN void glob_setfilename(void *dummy, t_symbol *name, t_symbol *dir); | ||
1017 | |||
1018 | EXTERN void canvas_setargs(int argc, t_atom *argv); | ||
1019 | EXTERN void canvas_getargs(int *argcp, t_atom **argvp); | ||
1020 | EXTERN t_symbol *canvas_getcurrentdir(void); | ||
1021 | EXTERN t_glist *canvas_getcurrent(void); | ||
1022 | EXTERN void canvas_makefilename(t_glist *c, char *file, | ||
1023 | char *result,int resultsize); | ||
1024 | EXTERN t_symbol *canvas_getdir(t_glist *x); | ||
1025 | EXTERN int sys_fontwidth(int fontsize); | ||
1026 | EXTERN int sys_fontheight(int fontsize); | ||
1027 | EXTERN void canvas_dataproperties(t_glist *x, t_scalar *sc, t_binbuf *b); | ||
1028 | |||
1029 | /* ---------------- widget behaviors ---------------------- */ | ||
1030 | |||
1031 | EXTERN_STRUCT _widgetbehavior; | ||
1032 | #define t_widgetbehavior struct _widgetbehavior | ||
1033 | |||
1034 | EXTERN_STRUCT _parentwidgetbehavior; | ||
1035 | #define t_parentwidgetbehavior struct _parentwidgetbehavior | ||
1036 | EXTERN t_parentwidgetbehavior *pd_getparentwidget(t_pd *x); | ||
1037 | |||
1038 | /* -------------------- classes -------------- */ | ||
1039 | |||
1040 | #define CLASS_DEFAULT 0 /* flags for new classes below */ | ||
1041 | #define CLASS_PD 1 | ||
1042 | #define CLASS_GOBJ 2 | ||
1043 | #define CLASS_PATCHABLE 3 | ||
1044 | #define CLASS_NOINLET 8 | ||
1045 | |||
1046 | #define CLASS_TYPEMASK 3 | ||
1047 | |||
1048 | |||
1049 | EXTERN t_class *class_new(t_symbol *name, t_newmethod newmethod, | ||
1050 | t_method freemethod, size_t size, int flags, t_atomtype arg1, ...); | ||
1051 | EXTERN void class_addcreator(t_newmethod newmethod, t_symbol *s, | ||
1052 | t_atomtype type1, ...); | ||
1053 | EXTERN void class_addmethod(t_class *c, t_method fn, t_symbol *sel, | ||
1054 | t_atomtype arg1, ...); | ||
1055 | EXTERN void class_addbang(t_class *c, t_method fn); | ||
1056 | EXTERN void class_addpointer(t_class *c, t_method fn); | ||
1057 | EXTERN void class_doaddfloat(t_class *c, t_method fn); | ||
1058 | EXTERN void class_addsymbol(t_class *c, t_method fn); | ||
1059 | EXTERN void class_addlist(t_class *c, t_method fn); | ||
1060 | EXTERN void class_addanything(t_class *c, t_method fn); | ||
1061 | EXTERN void class_sethelpsymbol(t_class *c, t_symbol *s); | ||
1062 | EXTERN void class_setwidget(t_class *c, t_widgetbehavior *w); | ||
1063 | EXTERN void class_setparentwidget(t_class *c, t_parentwidgetbehavior *w); | ||
1064 | EXTERN t_parentwidgetbehavior *class_parentwidget(t_class *c); | ||
1065 | EXTERN char *class_getname(t_class *c); | ||
1066 | EXTERN char *class_gethelpname(t_class *c); | ||
1067 | EXTERN void class_setdrawcommand(t_class *c); | ||
1068 | EXTERN int class_isdrawcommand(t_class *c); | ||
1069 | EXTERN void class_domainsignalin(t_class *c, int onset); | ||
1070 | #define CLASS_MAINSIGNALIN(c, type, field) \ | ||
1071 | class_domainsignalin(c, (char *)(&((type *)0)->field) - (char *)0) | ||
1072 | |||
1073 | /* prototype for functions to save Pd's to a binbuf */ | ||
1074 | typedef void (*t_savefn)(t_gobj *x, t_binbuf *b); | ||
1075 | EXTERN void class_setsavefn(t_class *c, t_savefn f); | ||
1076 | EXTERN t_savefn class_getsavefn(t_class *c); | ||
1077 | /* prototype for functions to open properties dialogs */ | ||
1078 | typedef void (*t_propertiesfn)(t_gobj *x, struct _glist *glist); | ||
1079 | EXTERN void class_setpropertiesfn(t_class *c, t_propertiesfn f); | ||
1080 | EXTERN t_propertiesfn class_getpropertiesfn(t_class *c); | ||
1081 | |||
1082 | #ifndef PD_CLASS_DEF | ||
1083 | #define class_addbang(x, y) class_addbang((x), (t_method)(y)) | ||
1084 | #define class_addpointer(x, y) class_addpointer((x), (t_method)(y)) | ||
1085 | #define class_addfloat(x, y) class_doaddfloat((x), (t_method)(y)) | ||
1086 | #define class_addsymbol(x, y) class_addsymbol((x), (t_method)(y)) | ||
1087 | #define class_addlist(x, y) class_addlist((x), (t_method)(y)) | ||
1088 | #define class_addanything(x, y) class_addanything((x), (t_method)(y)) | ||
1089 | #endif | ||
1090 | |||
1091 | /* ------------ printing --------------------------------- */ | ||
1092 | EXTERN void post(char *fmt, ...); | ||
1093 | EXTERN void startpost(char *fmt, ...); | ||
1094 | EXTERN void poststring(char *s); | ||
1095 | EXTERN void postfloat(float f); | ||
1096 | EXTERN void postatom(int argc, t_atom *argv); | ||
1097 | EXTERN void endpost(void); | ||
1098 | EXTERN void error(char *fmt, ...); | ||
1099 | EXTERN void bug(char *fmt, ...); | ||
1100 | EXTERN void pd_error(void *object, char *fmt, ...); | ||
1101 | EXTERN void sys_logerror(char *object, char *s); | ||
1102 | EXTERN void sys_unixerror(char *object); | ||
1103 | EXTERN void sys_ouch(void); | ||
1104 | |||
1105 | #ifdef __linux__ | ||
1106 | EXTERN char* sys_get_path( void); | ||
1107 | #endif | ||
1108 | EXTERN void sys_addpath(const char* p); | ||
1109 | |||
1110 | |||
1111 | /* ------------ system interface routines ------------------- */ | ||
1112 | EXTERN int sys_isreadablefile(const char *name); | ||
1113 | EXTERN void sys_bashfilename(const char *from, char *to); | ||
1114 | EXTERN void sys_unbashfilename(const char *from, char *to); | ||
1115 | EXTERN int open_via_path(const char *name, const char *ext, const char *dir, | ||
1116 | char *dirresult, char **nameresult, unsigned int size, int bin); | ||
1117 | EXTERN int sched_geteventno(void); | ||
1118 | EXTERN t_time sys_getrealtime(void); | ||
1119 | |||
1120 | |||
1121 | /* ------------ threading ------------------- */ | ||
1122 | /* T.Grill - see m_sched.c */ | ||
1123 | |||
1124 | EXTERN void sys_lock(void); | ||
1125 | EXTERN void sys_unlock(void); | ||
1126 | EXTERN int sys_trylock(void); | ||
1127 | |||
1128 | |||
1129 | /* --------------- signals ----------------------------------- */ | ||
1130 | |||
1131 | #define MAXLOGSIG 32 | ||
1132 | #define MAXSIGSIZE (1 << MAXLOGSIG) | ||
1133 | #ifndef FIXEDPOINT | ||
1134 | typedef float t_sample; | ||
1135 | #else | ||
1136 | #include "m_fixed.h" | ||
1137 | #endif | ||
1138 | |||
1139 | |||
1140 | typedef struct _signal | ||
1141 | { | ||
1142 | int s_n; /* number of points in the array */ | ||
1143 | t_sample *s_vec; /* the array */ | ||
1144 | float s_sr; /* sample rate */ | ||
1145 | int s_refcount; /* number of times used */ | ||
1146 | int s_isborrowed; /* whether we're going to borrow our array */ | ||
1147 | struct _signal *s_borrowedfrom; /* signal to borrow it from */ | ||
1148 | struct _signal *s_nextfree; /* next in freelist */ | ||
1149 | struct _signal *s_nextused; /* next in used list */ | ||
1150 | } t_signal; | ||
1151 | |||
1152 | |||
1153 | typedef t_int *(*t_perfroutine)(t_int *args); | ||
1154 | |||
1155 | EXTERN t_int *plus_perform(t_int *args); | ||
1156 | EXTERN t_int *zero_perform(t_int *args); | ||
1157 | EXTERN t_int *copy_perform(t_int *args); | ||
1158 | |||
1159 | EXTERN void dsp_add_plus(t_sample *in1, t_sample *in2, t_sample *out, int n); | ||
1160 | EXTERN void dsp_add_copy(t_sample *in, t_sample *out, int n); | ||
1161 | EXTERN void dsp_add_scalarcopy(t_sample *in, t_sample *out, int n); | ||
1162 | EXTERN void dsp_add_zero(t_sample *out, int n); | ||
1163 | |||
1164 | EXTERN int sys_getblksize(void); | ||
1165 | EXTERN float sys_getsr(void); | ||
1166 | EXTERN int sys_get_inchannels(void); | ||
1167 | EXTERN int sys_get_outchannels(void); | ||
1168 | |||
1169 | EXTERN void dsp_add(t_perfroutine f, int n, ...); | ||
1170 | EXTERN void dsp_addv(t_perfroutine f, int n, t_int *vec); | ||
1171 | EXTERN void pd_fft(float *buf, int npoints, int inverse); | ||
1172 | EXTERN int ilog2(int n); | ||
1173 | |||
1174 | EXTERN void mayer_fht(t_sample *fz, int n); | ||
1175 | EXTERN void mayer_fft(int n, t_sample *real, t_sample *imag); | ||
1176 | EXTERN void mayer_ifft(int n, t_sample *real, t_sample *imag); | ||
1177 | EXTERN void mayer_realfft(int n, t_sample *real); | ||
1178 | EXTERN void mayer_realifft(int n, t_sample *real); | ||
1179 | |||
1180 | //EXTERN t_sample cos_table[]; | ||
1181 | |||
1182 | #define LOGCOSTABSIZE 9 | ||
1183 | #define COSTABSIZE (1<<LOGCOSTABSIZE) | ||
1184 | |||
1185 | EXTERN int canvas_suspend_dsp(void); | ||
1186 | EXTERN void canvas_resume_dsp(int oldstate); | ||
1187 | EXTERN void canvas_update_dsp(void); | ||
1188 | |||
1189 | /* IOhannes { (up/downsampling) */ | ||
1190 | typedef struct _resample | ||
1191 | { | ||
1192 | int method; /* up/downsampling method ID */ | ||
1193 | |||
1194 | t_int downsample; /* downsampling factor */ | ||
1195 | t_int upsample; /* upsampling factor */ | ||
1196 | |||
1197 | t_sample *s_vec; /* here we hold the resampled data */ | ||
1198 | int s_n; | ||
1199 | |||
1200 | t_sample *coeffs; /* coefficients for filtering... */ | ||
1201 | int coefsize; | ||
1202 | |||
1203 | t_sample *buffer; /* buffer for filtering */ | ||
1204 | int bufsize; | ||
1205 | } t_resample; | ||
1206 | |||
1207 | EXTERN void resample_init(t_resample *x); | ||
1208 | EXTERN void resample_free(t_resample *x); | ||
1209 | |||
1210 | EXTERN void resample_dsp(t_resample *x, t_sample *in, int insize, t_sample *out, int outsize, int method); | ||
1211 | EXTERN void resamplefrom_dsp(t_resample *x, t_sample *in, int insize, int outsize, int method); | ||
1212 | EXTERN void resampleto_dsp(t_resample *x, t_sample *out, int insize, int outsize, int method); | ||
1213 | /* } IOhannes */ | ||
1214 | |||
1215 | /* ----------------------- utility functions for signals -------------- */ | ||
1216 | EXTERN float mtof(float); | ||
1217 | EXTERN float ftom(float); | ||
1218 | EXTERN float rmstodb(float); | ||
1219 | EXTERN float powtodb(float); | ||
1220 | EXTERN float dbtorms(float); | ||
1221 | EXTERN float dbtopow(float); | ||
1222 | |||
1223 | EXTERN float q8_sqrt(float); | ||
1224 | EXTERN float q8_rsqrt(float); | ||
1225 | #ifndef N32 | ||
1226 | EXTERN float qsqrt(float); /* old names kept for extern compatibility */ | ||
1227 | EXTERN float qrsqrt(float); | ||
1228 | #endif | ||
1229 | /* --------------------- data --------------------------------- */ | ||
1230 | |||
1231 | /* graphical arrays */ | ||
1232 | EXTERN_STRUCT _garray; | ||
1233 | #define t_garray struct _garray | ||
1234 | |||
1235 | EXTERN t_class *garray_class; | ||
1236 | EXTERN int garray_getfloatarray(t_garray *x, int *size, t_sample **vec); | ||
1237 | EXTERN float garray_get(t_garray *x, t_symbol *s, t_int indx); | ||
1238 | EXTERN void garray_redraw(t_garray *x); | ||
1239 | EXTERN int garray_npoints(t_garray *x); | ||
1240 | EXTERN char *garray_vec(t_garray *x); | ||
1241 | EXTERN void garray_resize(t_garray *x, t_floatarg f); | ||
1242 | EXTERN void garray_usedindsp(t_garray *x); | ||
1243 | EXTERN void garray_setsaveit(t_garray *x, int saveit); | ||
1244 | EXTERN t_class *scalar_class; | ||
1245 | |||
1246 | EXTERN t_float *value_get(t_symbol *s); | ||
1247 | EXTERN void value_release(t_symbol *s); | ||
1248 | EXTERN int value_getfloat(t_symbol *s, t_float *f); | ||
1249 | EXTERN int value_setfloat(t_symbol *s, t_float f); | ||
1250 | |||
1251 | /* ------- GUI interface - functions to send strings to TK --------- */ | ||
1252 | EXTERN void sys_vgui(char *fmt, ...); | ||
1253 | EXTERN void sys_gui(char *s); | ||
1254 | |||
1255 | /* dialog window creation and destruction */ | ||
1256 | EXTERN void gfxstub_new(t_pd *owner, void *key, const char *cmd); | ||
1257 | EXTERN void gfxstub_deleteforkey(void *key); | ||
1258 | |||
1259 | extern t_class *glob_pdobject; /* object to send "pd" messages */ | ||
1260 | |||
1261 | /*------------- Max 0.26 compatibility --------------------*/ | ||
1262 | |||
1263 | /* the following reflects the new way classes are laid out, with the class | ||
1264 | pointing to the messlist and not vice versa. Externs shouldn't feel it. */ | ||
1265 | typedef t_class *t_externclass; | ||
1266 | |||
1267 | EXTERN void c_extern(t_externclass *cls, t_newmethod newroutine, | ||
1268 | t_method freeroutine, t_symbol *name, size_t size, int tiny, \ | ||
1269 | t_atomtype arg1, ...); | ||
1270 | EXTERN void c_addmess(t_method fn, t_symbol *sel, t_atomtype arg1, ...); | ||
1271 | |||
1272 | #define t_getbytes getbytes | ||
1273 | #define t_freebytes freebytes | ||
1274 | #define t_resizebytes resizebytes | ||
1275 | #define typedmess pd_typedmess | ||
1276 | #define vmess pd_vmess | ||
1277 | |||
1278 | /* A definition to help gui objects straddle 0.34-0.35 changes. If this is | ||
1279 | defined, there is a "te_xpix" field in objects, not a "te_xpos" as before: */ | ||
1280 | |||
1281 | #define PD_USE_TE_XPIX | ||
1282 | |||
1283 | #if 0 | ||
1284 | /* a test for NANs and denormals. Should only be necessary on i386. */ | ||
1285 | #define PD_BADFLOAT(f) ((((*(unsigned int*)&(f))&0x7f800000)==0) || \ | ||
1286 | (((*(unsigned int*)&(f))&0x7f800000)==0x7f800000)) | ||
1287 | /* more stringent test: anything not between 1e-19 and 1e19 in absolute val */ | ||
1288 | #define PD_BIGORSMALL(f) ((((*(unsigned int*)&(f))&0x60000000)==0) || \ | ||
1289 | (((*(unsigned int*)&(f))&0x60000000)==0x60000000)) | ||
1290 | #else | ||
1291 | #define PD_BADFLOAT(f) 0 | ||
1292 | #define PD_BIGORSMALL(f) 0 | ||
1293 | #endif | ||
1294 | |||
1295 | #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) | ||
1296 | } | ||
1297 | #endif | ||
1298 | |||
1299 | #define __m_pd_h_ | ||
1300 | #endif /* __m_pd_h_ */ | ||