Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18512
Modified Files:
Tag: desiredata
m_class.c s_inter.c
Log Message:
removed #ifdef DESIRE
Index: s_inter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v
retrieving revision 1.5.4.10.2.25
retrieving revision 1.5.4.10.2.25.2.1
diff -C2 -d -r1.5.4.10.2.25 -r1.5.4.10.2.25.2.1
*** s_inter.c 28 Nov 2006 20:52:05 -0000 1.5.4.10.2.25
--- s_inter.c 30 Nov 2006 03:34:23 -0000 1.5.4.10.2.25.2.1
***************
*** 11,17 ****
#include "s_stuff.h"
#include "m_imp.h"
- #ifndef DESIRE
- #include "g_canvas.h"
- #endif
#ifdef UNISTD
#include <unistd.h>
--- 11,14 ----
***************
*** 523,529 ****
void sys_exit(void);
- #ifdef DESIRE
void binbuf_eval_from_client(t_binbuf *b);
- #endif
void socketreceiver_read(t_socketreceiver *x, int fd)
--- 520,524 ----
***************
*** 586,594 ****
(*x->sr_socketreceivefn)(x->sr_owner, inbinbuf);
else {
- #ifdef DESIRE
binbuf_eval_from_client(inbinbuf);
- #else
- binbuf_eval(inbinbuf, 0, 0, 0);
- #endif
}
}
--- 581,585 ----
***************
*** 1011,1241 ****
else /* default behavior: start up the GUI ourselves. */
{
- #ifdef DESIRE
fprintf(stderr,
"PureData in DesireData mode does not currently support starting without\n"
"a -guiport option. Please start using the command 'wish desire.tk' instead.\n");
exit(1);
- #else
- #ifdef MSW
- char scriptbuf[MAXPDSTRING+30], wishbuf[MAXPDSTRING+30], portbuf[80];
- int spawnret;
-
- #endif
- #ifdef MSW
- char intarg;
- #else
- int intarg;
- #endif
-
- /* create a socket */
- xsock = socket(AF_INET, SOCK_STREAM, 0);
- if (xsock < 0) sys_sockerror("socket");
- #if 0
- intarg = 0;
- if (setsockopt(xsock, SOL_SOCKET, SO_SNDBUF,
- &intarg, sizeof(intarg)) < 0)
- post("setsockopt (SO_RCVBUF) failed\n");
- intarg = 0;
- if (setsockopt(xsock, SOL_SOCKET, SO_RCVBUF,
- &intarg, sizeof(intarg)) < 0)
- post("setsockopt (SO_RCVBUF) failed\n");
- #endif
- intarg = 1;
- if (setsockopt(xsock, IPPROTO_TCP, TCP_NODELAY,
- &intarg, sizeof(intarg)) < 0)
- #ifndef _WIN32
- post("setsockopt (TCP_NODELAY) failed\n")
- #endif /* not _WIN32 */
- ;
-
-
- server.sin_family = AF_INET;
- server.sin_addr.s_addr = INADDR_ANY;
-
- /* assign server port number */
- server.sin_port = htons((unsigned short)portno);
-
- /* name the socket */
- while (bind(xsock, (struct sockaddr *)&server, sizeof(server)) < 0)
- {
- #ifdef _WIN32
- int err = WSAGetLastError();
- #else
- int err = errno;
- #endif /* _WIN32 */
- if ((ntry++ > 20) || (err != EADDRINUSE))
- {
- perror("bind");
- fprintf(stderr,
- "Pd needs your machine to be configured with\n");
- fprintf(stderr,
- "'networking' turned on (see Pd's html doc for details.)\n");
- exit(1);
- }
- portno++;
- server.sin_port = htons((unsigned short)(portno));
- }
-
- if (sys_verbose) fprintf(stderr, "port %d\n", portno);
-
-
- #ifdef UNISTD
- childpid = fork();
- if (childpid < 0)
- {
- if (errno) perror("sys_startgui");
- else fprintf(stderr, "sys_startgui failed\n");
- return (1);
- }
- else if (!childpid) /* we're the child */
- {
- setuid(getuid()); /* lose setuid priveliges */
- #ifndef __APPLE__
- /* the wish process in Unix will make a wish shell and
- read/write standard in and out unless we close the
- file descriptors. Somehow this doesn't make the MAC OSX
- version of Wish happy...*/
- if (pipe(stdinpipe) < 0)
- sys_sockerror("pipe");
- else
- {
- if (stdinpipe[0] != 0)
- {
- close (0);
- dup2(stdinpipe[0], 0);
- close(stdinpipe[0]);
- }
- }
- #endif
- if (!sys_guicmd)
- {
- #ifdef __APPLE__
- char *homedir = getenv("HOME"), filename[250];
- struct stat statbuf;
-
- /* First look for non-renamed Wish Shells */
- sprintf(filename, "%s/../Frameworks/Tk.framework/Resources/Wish Shell.app/Contents/MacOS/Wish Shell", guidir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- sprintf(filename, "%s/../MacOS/Wish", guidir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- sprintf(filename, "%s/../MacOS/Wish Shell", guidir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
-
- /* Then look for wish (renamed "Pd") in bundled tk.framework */
- sprintf(filename, "%s/../Frameworks/Tk.framework/Resources/Pd", guidir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- sprintf(filename, "%s/../Frameworks/Pd", guidir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- /* also look for standalone Wish bundled with and renamed "Pd" */
- sprintf(filename, "%s/../../MacOS/Pd", guidir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
-
- if (!homedir || strlen(homedir) > 150)
- goto nohomedir;
- /* Look for Wish in user's Applications. Might or might
- not be names "Wish Shell", and might or might not be
- in "Utilities" subdir. */
- sprintf(filename,
- "%s/Applications/Utilities/Wish shell.app/Contents/MacOS/Wish Shell",
- homedir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- sprintf(filename,
- "%s/Applications/Utilities/Wish.app/Contents/MacOS/Wish",
- homedir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- sprintf(filename,
- "%s/Applications/Wish shell.app/Contents/MacOS/Wish Shell",
- homedir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- sprintf(filename,
- "%s/Applications/Wish.app/Contents/MacOS/Wish",
- homedir);
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- nohomedir:
- /* Perform the same search among system applications. */
- strcpy(filename,
- "/Applications/Utilities/Wish Shell.app/Contents/MacOS/Wish Shell");
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- strcpy(filename,
- "/Applications/Utilities/Wish.app/Contents/MacOS/Wish");
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- strcpy(filename,
- "/Applications/Wish Shell.app/Contents/MacOS/Wish Shell");
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- strcpy(filename,
- "/Library/Frameworks/Tk.Framework/Resources/Wish Shell.app/Contents/MacOS/Wish Shell");
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- strcpy(filename,
- "/System/Library/Frameworks/Tk.Framework/Resources/Wish Shell.app/Contents/MacOS/Wish Shell");
- if (stat(filename, &statbuf) >= 0)
- goto foundit;
- strcpy(filename,
- "/Applications/Wish.app/Contents/MacOS/Wish");
- foundit:
- #ifndef DESIRE
- sprintf(cmdbuf, "\"%s\" %s/pd.tk %d\n", filename, guidir, portno);
- #else
- sprintf(cmdbuf, "\"%s\" %s/desire.tk %d\n", filename, guidir, portno);
- #endif
- #else
- sprintf(cmdbuf,
- "TCL_LIBRARY=\"%s/tcl/library\" TK_LIBRARY=\"%s/tk/library\" \
- \"%s/pd-gui\" %d\n",
- sys_libdir->s_name, sys_libdir->s_name, guidir, portno);
- #endif
- sys_guicmd = cmdbuf;
- }
- if (sys_verbose) fprintf(stderr, "%s", sys_guicmd);
- execl("/bin/sh", "sh", "-c", sys_guicmd, (char*)0);
- perror("pd: exec");
- _exit(1);
- }
- #endif /* UNISTD */
-
- #ifdef _WIN32
- /* in WIN32 land "guipath" is unused; we just do everything from
- the libdir. */
- /* fprintf(stderr, "%s\n", sys_libdir->s_name); */
-
- strcpy(scriptbuf, "\"");
- strcat(scriptbuf, sys_libdir->s_name);
- strcat(scriptbuf, "/" PDBINDIR "pd.tk\"");
- sys_bashfilename(scriptbuf, scriptbuf);
-
- sprintf(portbuf, "%d", portno);
-
- /* try WISHAPP in PD path */
- strcpy(wishbuf, sys_libdir->s_name);
- strcat(wishbuf, "/" PDBINDIR WISHAPP);
- sys_bashfilename(wishbuf, wishbuf);
-
- spawnret = _spawnl(P_NOWAIT, wishbuf, WISHAPP, scriptbuf, portbuf, 0);
- if(spawnret >= 0) goto ok;
-
- /* try WISHAPP in system path */
- spawnret = _spawnlp(P_NOWAIT, WISHAPP, WISHAPP, scriptbuf, portbuf, 0);
- if(spawnret >= 0) goto ok;
-
- perror("spawnl");
- fprintf(stderr, "%s: couldn't load TCL\n", wishbuf);
- exit(1);
- ok:
- ;
- #endif /* MSW */
- #endif /* DESIRE */
}
--- 1002,1009 ----
Index: m_class.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_class.c,v
retrieving revision 1.3.4.7.2.22
retrieving revision 1.3.4.7.2.22.2.1
diff -C2 -d -r1.3.4.7.2.22 -r1.3.4.7.2.22.2.1
*** m_class.c 28 Nov 2006 21:12:59 -0000 1.3.4.7.2.22
--- m_class.c 30 Nov 2006 03:34:23 -0000 1.3.4.7.2.22.2.1
***************
*** 27,33 ****
#endif
- #ifdef DESIRE
t_hash *class_table=0;
- #endif
static t_symbol *class_loadsym; /* name under which an extern is invoked */
--- 27,31 ----
***************
*** 162,168 ****
how this is handled. */
- #ifndef DESIRE
- extern t_widgetbehavior text_widgetbehavior;
- #endif
extern void text_save(t_gobj *z, t_binbuf *b);
--- 160,163 ----
***************
*** 237,250 ****
c->c_listmethod = pd_defaultlist;
c->c_anymethod = pd_defaultanything;
- #ifndef DESIRE
- c->c_wb = (typeflag == CLASS_PATCHABLE ? &text_widgetbehavior : 0);
- #endif
c->c_pwb = 0;
c->c_firstin = ((flags & CLASS_NOINLET) == 0);
c->c_firsttip = gensym("?");
- #ifdef DESIRE
c->c_fields = (t_symbol **)malloc(sizeof(t_symbol *)*31);
c->c_nfields = 0;
- #endif
c->c_patchable = (typeflag == CLASS_PATCHABLE);
c->c_gobj = (typeflag >= CLASS_GOBJ);
--- 232,240 ----
***************
*** 253,259 ****
c->c_externdir = class_extern_dir;
c->c_savefn = (typeflag == CLASS_PATCHABLE ? text_save : class_nosavefn);
- #if 0
- post("class: %s", c->c_name->s_name);
- #endif
#ifdef QUALIFIED_NAME
--- 243,246 ----
***************
*** 266,273 ****
#endif
- #ifdef DESIRE
hash_set(class_table, c->c_name, c);
! #endif
! return (c);
}
--- 253,258 ----
#endif
hash_set(class_table, c->c_name, c);
! return c;
}
***************
*** 314,320 ****
vec[0], vec[1], vec[2], vec[3], vec[4], vec[5]);
#endif
- #ifdef DESIRE
hash_set(class_table,s,0);
- #endif
}
--- 299,303 ----
***************
*** 428,438 ****
}
- #ifndef DESIRE
- void class_setwidget(t_class *c, t_widgetbehavior *w)
- {
- c->c_wb = w;
- }
- #endif
-
void class_setparentwidget(t_class *c, t_parentwidgetbehavior *pw)
{
--- 411,414 ----
***************
*** 470,480 ****
}
- #ifdef DESIRE
void class_setnotice(t_class *c, t_notice notice)
{
c->c_notice = notice;
}
- #endif
-
static void pd_floatforsignal(t_pd *x, t_float f)
--- 446,453 ----
***************
*** 525,540 ****
}
- #ifndef DESIRE
- void class_setpropertiesfn(t_class *c, t_propertiesfn f)
- {
- c->c_propertiesfn = f;
- }
-
- t_propertiesfn class_getpropertiesfn(t_class *c)
- {
- return (c->c_propertiesfn);
- }
- #endif
-
/* ---------------- the symbol table ------------------------ */
--- 498,501 ----
***************
*** 784,790 ****
t_floatarg d1, t_floatarg d2, t_floatarg d3, t_floatarg d4, t_floatarg d5);
- #ifdef DESIRE
void pd_set_newest(t_pd *x);
- #endif
void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv)
--- 745,749 ----
***************
*** 836,844 ****
{
if (x == &pd_objectmaker)
- #ifdef DESIRE
pd_set_newest(((t_newgimme)(m->me_fun))(s, argc, argv));
- #else
- newest = (*((t_newgimme)(m->me_fun)))(s, argc, argv);
- #endif
else (*((t_messgimme)(m->me_fun)))(x, s, argc, argv);
return;
--- 795,799 ----
***************
*** 922,930 ****
}
if (x == &pd_objectmaker)
- #ifdef DESIRE
pd_set_newest(bonzo);
- #else
- newest = bonzo;
- #endif
return;
}
--- 877,881 ----
***************
*** 1019,1023 ****
}
- #ifdef DESIRE
/* ---------------------------------------------------------------- */
/* desiredata-specific stuff */
--- 970,973 ----
***************
*** 1074,1078 ****
sys_vgui("}]; %s %s %s\n",cb_recv->s_name, cb_sel->s_name, s->s_name);
}
-
-
- #endif
--- 1024,1025 ----