- Reestructuración de ficheros y directorios general
- merge v0.01 --> Añadido fileselector - Añadidas fuentes de Gem y Pure Data - pix2jpg incluído en Gem. Archivos de construcción de Gem modificados. - Añadido fichero ompiling.txt con instrucciones de compilación
This commit is contained in:
parent
c9adfd020b
commit
e85d191b46
3100 changed files with 775434 additions and 3073 deletions
50
pd-0.44-2/extra/stdout/stdout.c
Normal file
50
pd-0.44-2/extra/stdout/stdout.c
Normal file
|
@ -0,0 +1,50 @@
|
|||
/* stdout -- write messages to standard output.
|
||||
|
||||
Copyright 2008 Miller Puckette
|
||||
BSD license; see README.txt in this distribution for details.
|
||||
*/
|
||||
|
||||
#include "m_pd.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
static t_class *stdout_class;
|
||||
|
||||
typedef struct _stdout
|
||||
{
|
||||
t_object x_obj;
|
||||
} t_stdout;
|
||||
|
||||
static void *stdout_new(t_float fnonrepeat)
|
||||
{
|
||||
t_stdout *x = (t_stdout *)pd_new(stdout_class);
|
||||
return (x);
|
||||
}
|
||||
|
||||
static void stdout_anything(t_stdout *x, t_symbol *s, int argc, t_atom *argv)
|
||||
{
|
||||
char msgbuf[MAXPDSTRING], *sp, *ep = msgbuf+MAXPDSTRING;
|
||||
msgbuf[0] = 0;
|
||||
strncpy(msgbuf, s->s_name, MAXPDSTRING);
|
||||
msgbuf[MAXPDSTRING-1] = 0;
|
||||
sp = msgbuf + strlen(msgbuf);
|
||||
while (argc--)
|
||||
{
|
||||
if (sp < ep-1)
|
||||
sp[0] = ' ', sp[1] = 0, sp++;
|
||||
atom_string(argv++, sp, ep-sp);
|
||||
sp += strlen(sp);
|
||||
}
|
||||
printf("%s;\n", msgbuf);
|
||||
}
|
||||
|
||||
static void stdout_free(t_stdout *x)
|
||||
{
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void stdout_setup(void)
|
||||
{
|
||||
stdout_class = class_new(gensym("stdout"), (t_newmethod)stdout_new,
|
||||
(t_method)stdout_free, sizeof(t_stdout), 0, 0);
|
||||
class_addanything(stdout_class, stdout_anything);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue