Update of /cvsroot/pure-data/externals/zexy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18372
Modified Files: makefile.linux z_lp.c z_skeleton_tilde.c Log Message: added first configure support
Index: z_skeleton_tilde.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/z_skeleton_tilde.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** z_skeleton_tilde.c 9 Oct 2002 10:19:04 -0000 1.1 --- z_skeleton_tilde.c 21 Jul 2004 15:57:33 -0000 1.2 *************** *** 50,54 **** }
! void z_skeleton_setup(void) { skeleton_class = class_new(gensym("skeleton~"), (t_newmethod)skeleton_new, 0, --- 50,54 ---- }
! void z_skeleton_tilde_setup(void) { skeleton_class = class_new(gensym("skeleton~"), (t_newmethod)skeleton_new, 0,
Index: makefile.linux =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/makefile.linux,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** makefile.linux 1 Dec 2003 15:09:03 -0000 1.9 --- makefile.linux 21 Jul 2004 15:57:33 -0000 1.10 *************** *** 16,20 **** # by default DESTDIR = ! INSTALL_PREFIX = /usr PDLIBDIR = /lib/pd #these were the user adjustables --- 16,20 ---- # by default DESTDIR = ! INSTALL_PREFIX = /usr/local PDLIBDIR = /lib/pd #these were the user adjustables
Index: z_lp.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/z_lp.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** z_lp.c 8 Aug 2003 03:54:05 -0000 1.4 --- z_lp.c 21 Jul 2004 15:57:33 -0000 1.5 *************** *** 1,11 **** /* ! (c) 2005:forum::für::umläute:2000
write to the parallel port extended to write to any port (if we do have permissions) - */ - #ifdef __i386__ - #define BASE0 0x3bc #define BASE1 0x378 --- 1,8 ---- /* ! (c) 2000:forum::für::umläute:2004
write to the parallel port extended to write to any port (if we do have permissions) */ #define BASE0 0x3bc #define BASE1 0x378 *************** *** 17,30 **** #include "zexy.h"
! #include <sys/io.h> ! #include <stdlib.h> ! ! /* ----------------------- lp --------------------- */
static int count_iopl = 0;
- static t_class *lp_class;
! typedef struct _lp { t_object x_obj; --- 14,29 ---- #include "zexy.h"
! /* ----------------------- lpt --------------------- */
+ #ifdef Z_WANT_LPT + # include <sys/io.h> + # include <stdlib.h> static int count_iopl = 0; + #endif
! static t_class *lpt_class; ! ! typedef struct _lpt { t_object x_obj; *************** *** 33,50 ****
int mode; // MODE_IOPERM, MODE_IOPL ! } t_lp;
! static void lp_float(t_lp *x, t_floatarg f) { if (x->port) { unsigned char b = f; outb(b, x->port); } }
! static void *lp_new(t_symbol *s, int argc, t_atom *argv) { ! t_lp *x = (t_lp *)pd_new(lp_class);
x->port = 0;
--- 32,54 ----
int mode; // MODE_IOPERM, MODE_IOPL ! } t_lpt;
! static void lpt_float(t_lpt *x, t_floatarg f) { + #ifdef Z_WANT_LPT if (x->port) { unsigned char b = f; outb(b, x->port); } + #endif /* Z_WANT_LPT */ }
! static void *lpt_new(t_symbol *s, int argc, t_atom *argv) { ! t_lpt *x = (t_lpt *)pd_new(lpt_class); ! if(s==gensym("lp")) ! error("lpt: the use of 'lp' has been deprecated; use 'lpt' instead");
+ #ifdef Z_WANT_LPT x->port = 0;
*************** *** 62,66 **** break; default: ! error("lp : only lp0, lp1 and lp2 are accessible"); x->port = 0; return (x); --- 66,70 ---- break; default: ! error("lpt : only lpt0, lpt1 and lpt2 are accessible"); x->port = 0; return (x); *************** *** 75,79 ****
if (!x->port || x->port>65535){ ! post("lp : bad port %x", x->port); x->port = 0; return (x); --- 79,83 ----
if (!x->port || x->port>65535){ ! post("lpt : bad port %x", x->port); x->port = 0; return (x); *************** *** 82,86 **** if (x->port && x->port < 0x400){ if (ioperm(x->port, 8, 1)) { ! error("lp : couldn't get write permissions"); x->port = 0; return (x); --- 86,90 ---- if (x->port && x->port < 0x400){ if (ioperm(x->port, 8, 1)) { ! error("lpt : couldn't get write permissions"); x->port = 0; return (x); *************** *** 89,93 **** } else { if (iopl(3)){ ! error("lp : couldn't get write permissions"); x->port = 0; return (x); --- 93,97 ---- } else { if (iopl(3)){ ! error("lpt : couldn't get write permissions"); x->port = 0; return (x); *************** *** 100,136 **** post("connected to port %x in mode '%s'", x->port, (x->mode==MODE_IOPL)?"iopl":"ioperm"); if (x->mode==MODE_IOPL)post("warning: this might seriously damage your pc..."); ! return (x); }
! static void lp_free(t_lp *x) { if (x->port) { ! if (x->mode==MODE_IOPERM && ioperm(x->port, 8, 0)) error("lp: couldn't clean up device"); else if (x->mode==MODE_IOPL && (!--count_iopl) && iopl(0)) ! error("lp: couldn't clean up device"); } }
! static void helper(t_lp *x) { ! post("\n%c lp :: direct access to the parallel port", HEARTSYMBOL); post("<byte>\t: write byte to the parallel-port"); ! post("\ncreation:\t"lp [<port>]": connect to parallel port <port> (0..2)"); ! post("\t\t"lp <portaddr>": connect to port @ <portaddr> (hex)"); }
! void z_lp_setup(void) { ! lp_class = class_new(gensym("lp"), ! (t_newmethod)lp_new, (t_method)lp_free, ! sizeof(t_lp), 0, A_GIMME, 0);
! class_addfloat(lp_class, (t_method)lp_float);
! class_addmethod(lp_class, (t_method)helper, gensym("help"), 0); ! class_sethelpsymbol(lp_class, gensym("zexy/lp")); }
! #endif /* __i386__ */ --- 104,148 ---- post("connected to port %x in mode '%s'", x->port, (x->mode==MODE_IOPL)?"iopl":"ioperm"); if (x->mode==MODE_IOPL)post("warning: this might seriously damage your pc..."); ! #else ! error("zexy has been compiled without [lpt]!"); ! #endif /* Z_WANT_LPT */ ! return (x); }
! static void lpt_free(t_lpt *x) { + #ifdef Z_WANT_LPT if (x->port) { ! if (x->mode==MODE_IOPERM && ioperm(x->port, 8, 0)) error("lpt: couldn't clean up device"); else if (x->mode==MODE_IOPL && (!--count_iopl) && iopl(0)) ! error("lpt: couldn't clean up device"); } + #endif /* Z_WANT_LPT */ }
! static void helper(t_lpt *x) { ! post("\n%c lpt :: direct access to the parallel port", HEARTSYMBOL); post("<byte>\t: write byte to the parallel-port"); ! post("\ncreation:\t"lpt [<port>]": connect to parallel port <port> (0..2)"); ! post("\t\t"lpt <portaddr>": connect to port @ <portaddr> (hex)"); }
! void z_lpt_setup(void) { ! lpt_class = class_new(gensym("lpt"), ! (t_newmethod)lpt_new, (t_method)lpt_free, ! sizeof(t_lpt), 0, A_GIMME, 0); ! class_addcreator((t_newmethod)lpt_new, gensym("lp"), A_GIMME, 0);
! class_addfloat(lpt_class, (t_method)lpt_float);
! class_addmethod(lpt_class, (t_method)helper, gensym("help"), 0); ! class_sethelpsymbol(lpt_class, gensym("zexy/lpt")); }
! void z_lp_setup(void){ ! z_lpt_setup(); ! }