summaryrefslogtreecommitdiff
path: root/apps/plugins/pdbox/PDa/src/x_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pdbox/PDa/src/x_interface.c')
-rw-r--r--apps/plugins/pdbox/PDa/src/x_interface.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/apps/plugins/pdbox/PDa/src/x_interface.c b/apps/plugins/pdbox/PDa/src/x_interface.c
index f6ab350a91..227ca0f4fd 100644
--- a/apps/plugins/pdbox/PDa/src/x_interface.c
+++ b/apps/plugins/pdbox/PDa/src/x_interface.c
@@ -76,81 +76,4 @@ void x_interface_setup(void)
76{ 76{
77 print_setup(); 77 print_setup();
78} 78}
79/* Copyright (c) 1997-1999 Miller Puckette.
80* For information on usage and redistribution, and for a DISCLAIMER OF ALL
81* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
82
83/* interface objects */
84
85#include "m_pd.h"
86
87/* -------------------------- print ------------------------------ */
88static t_class *print_class;
89
90typedef struct _print
91{
92 t_object x_obj;
93 t_symbol *x_sym;
94} t_print;
95
96static void *print_new(t_symbol *s)
97{
98 t_print *x = (t_print *)pd_new(print_class);
99 if (*s->s_name) x->x_sym = s;
100 else x->x_sym = gensym("");
101 return (x);
102}
103
104static void print_bang(t_print *x)
105{
106 post("%sbang", x->x_sym->s_name);
107}
108
109static void print_pointer(t_print *x, t_gpointer *gp)
110{
111 post("%s(gpointer)", x->x_sym->s_name);
112}
113
114static void print_float(t_print *x, t_float f)
115{
116 post("%s%g", x->x_sym->s_name, f);
117}
118 79
119static void print_list(t_print *x, t_symbol *s, int argc, t_atom *argv)
120{
121 int i;
122 char buf[80];
123 if (argc && argv->a_type != A_SYMBOL) startpost("%s:", x->x_sym->s_name);
124 else startpost("%s%s", x->x_sym->s_name,
125 (argc > 1 ? s_list.s_name : (argc == 1 ? s_symbol.s_name :
126 s_bang.s_name)));
127 postatom(argc, argv);
128 endpost();
129}
130
131static void print_anything(t_print *x, t_symbol *s, int argc, t_atom *argv)
132{
133 int i;
134 char buf[80];
135 startpost("%s%s", x->x_sym->s_name, s->s_name);
136 postatom(argc, argv);
137 endpost();
138}
139
140static void print_setup(void)
141{
142 print_class = class_new(gensym("print"), (t_newmethod)print_new, 0,
143 sizeof(t_print), 0, A_DEFSYM, 0);
144 class_addbang(print_class, print_bang);
145 class_addfloat(print_class, print_float);
146 class_addpointer(print_class, print_pointer);
147 class_addlist(print_class, print_list);
148 class_addanything(print_class, print_anything);
149}
150
151
152
153void x_interface_setup(void)
154{
155 print_setup();
156}