pure-data/src/m_obj.c

/* Copyright (c) 1997-1999 Miller Puckette.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.  */

/* this file handles Max-style patchable objects, i.e., objects which
can interconnect via inlets and outlets; also, the (terse) generic
behavior for "gobjs" appears at the end of this file.  */

#include "m_pd.h"
#include "m_imp.h"
#include "s_stuff.h"
#include <string.h>

#include "m_private_utils.h"

#if defined(_MSC_VER)
#define INLINE
#elif defined(__GNUC__)
#define INLINE
#else
#define INLINE
#endif

inletunion;

struct _inlet
{};

#define i_symto
#define i_pointerslot
#define i_floatslot
#define i_symslot

static t_class *inlet_class, *pointerinlet_class, *floatinlet_class,
    *symbolinlet_class;

#define ISINLET(pd)

/* --------------------- generic inlets ala max ------------------ */

t_inlet *inlet_new(t_object *owner, t_pd *dest, t_symbol *s1, t_symbol *s2)
{}

t_inlet *signalinlet_new(t_object *owner, t_float f)
{}

static void inlet_wrong(t_inlet *x, t_symbol *s)
{}
static void _inlet_wrong(t_inlet *x, t_symbol *s, int argc, t_atom*argv)
{}

static void inlet_list(t_inlet *x, t_symbol *s, int argc, t_atom *argv);
extern t_class *vinlet_class;

    /* LATER figure out how to make these efficient: */
static void inlet_bang(t_inlet *x)
{}

static void inlet_pointer(t_inlet *x, t_gpointer *gp)
{}

static void inlet_float(t_inlet *x, t_float f)
{}

static void inlet_symbol(t_inlet *x, t_symbol *s)
{}

    /* forward a message to an inlet~ object */
static void inlet_fwd(t_inlet *x, t_symbol *s, int argc, t_atom *argv)
{}

static void inlet_list(t_inlet *x, t_symbol *s, int argc, t_atom *argv)
{}

static void inlet_anything(t_inlet *x, t_symbol *s, int argc, t_atom *argv)
{}

void inlet_free(t_inlet *x)
{}

/* ----- pointerinlets, floatinlets, syminlets: optimized inlets ------- */

static void pointerinlet_pointer(t_inlet *x, t_gpointer *gp)
{}

t_inlet *pointerinlet_new(t_object *owner, t_gpointer *gp)
{}

static void floatinlet_float(t_inlet *x, t_float f)
{}

t_inlet *floatinlet_new(t_object *owner, t_float *fp)
{}

static void symbolinlet_symbol(t_inlet *x, t_symbol *s)
{}

t_inlet *symbolinlet_new(t_object *owner, t_symbol **sp)
{}

/* ---------------------- routine to handle lists ---------------------- */

    /* objects interpret lists by feeding them to the individual inlets.
    Before you call this check that the object doesn't have a more
    specific way to handle lists. */
void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv)
{}

/* --------------------------- outlets ------------------------------ */


struct _outconnect
{};

struct _outlet
{};

/* ------- backtracer - keep track of stack for backtracing  --------- */
#define NARGS
t_msgstack;

t_backtracer;

static t_msgstack *backtracer_stack;
int backtracer_cantrace =;
int backtracer_tracing;
t_class *backtracer_class;

static PERTHREAD int stackcount =; /* iteration counter */
static PERTHREAD int overflow =;
#define STACKITER

static PERTHREAD int outlet_eventno;

    /* initialize stack depth count on each incoming event that can set off
    messages so that  the outlet functions can check to prevent stack overflow]
    from message recursion.  Also count message initiations. */

static INLINE int stackcount_add(void)
{}

static INLINE void stackcount_release(void)
{}

void outlet_setstacklim(void)
{}

    /* get a number unique to the (clock, MIDI, GUI, etc.) event we're on */
int sched_geteventno(void)
{}

    /* get pointer to connection list for an outlet (for editing/traversing) */
static t_outconnect **outlet_getconnectionpointer(t_outlet *x)
{}

static void backtracer_printmsg(t_pd *who, t_symbol *s,
    int argc, t_atom *argv)
{}

static void backtracer_anything(t_backtracer *x, t_symbol *s,
    int argc, t_atom *argv)
{}

t_backtracer *backtracer_new(t_pd *owner)
{}

int backtracer_settracing(void *x, int tracing)
{}

void canvas_settracing(int onoff);
static t_clock *backtrace_unsetclock;

static void backtrace_dounsettracing(void *dummy)
{}

    /* globally turn tracing on and off. */
void glob_settracing(void *dummy, t_float f)
{}

    /* this is called on every object, via canvas_settracing() call above */
void obj_dosettracing(t_object *ob, int onoff)
{}

t_outlet *outlet_new(t_object *owner, t_symbol *s)
{}

static void outlet_stackerror(t_outlet *x)
{}

void outlet_bang(t_outlet *x)
{}

void outlet_pointer(t_outlet *x, t_gpointer *gp)
{}

void outlet_float(t_outlet *x, t_float f)
{}

void outlet_symbol(t_outlet *x, t_symbol *s)
{}

void outlet_list(t_outlet *x, t_symbol *s, int argc, t_atom *argv)
{}

void outlet_anything(t_outlet *x, t_symbol *s, int argc, t_atom *argv)
{}

    /* get the outlet's declared symbol */
t_symbol *outlet_getsymbol(t_outlet *x)
{}

void outlet_free(t_outlet *x)
{}

    /* connect an outlet of one object to an inlet of another.  The receiving
    "pd" is usually a patchable object, but this may be used to add a
    non-patchable pd to an outlet by specifying the 0th inlet. */
t_outconnect *obj_connect(t_object *source, int outno,
    t_object *sink, int inno)
{}

void obj_disconnect(t_object *source, int outno, t_object *sink, int inno)
{}

/* ------ traversal routines for code that can't see our structures ------ */

int obj_noutlets(const t_object *x)
{}

int obj_ninlets(const t_object *x)
{}

t_outconnect *obj_starttraverseoutlet(const t_object *x, t_outlet **op, int nout)
{}

t_outconnect *obj_nexttraverseoutlet(t_outconnect *lastconnect,
    t_object **destp, t_inlet **inletp, int *whichp)
{}

    /* this one checks that a pd is indeed a patchable object, and returns
    it, correctly typed, or zero if the check failed. */
t_object *pd_checkobject(t_pd *x)
{}

    /* move an inlet or outlet to the head of the list */
void obj_moveinletfirst(t_object *x, t_inlet *i)
{}

void obj_moveoutletfirst(t_object *x, t_outlet *o)
{}

    /* routines for DSP sorting, which are used in d_ugen.c and g_canvas.c */
    /* LATER try to consolidate all the slightly different routines. */

int obj_nsiginlets(const t_object *x)
{}

    /* get the index, among signal inlets, of the mth inlet overall */
int obj_siginletindex(const t_object *x, int m)
{}

int obj_issignalinlet(const t_object *x, int m)
{}

int obj_nsigoutlets(const t_object *x)
{}

int obj_sigoutletindex(const t_object *x, int m)
{}

int obj_issignaloutlet(const t_object *x, int m)
{}

    /* return a pointer to a scalar holding the inlet's value.  If we
    can't find a value, return a pointer to a fixed location holding zero.
    This should only happen for a left-hand signal inlet for which no
    "MAINSIGNALIN" has been provided, in which case the object won't
    promote scalars correctly.  Nonetheless we provide it so that at least
    such a badly written object won't crash Pd. */
t_float *obj_findsignalscalar(const t_object *x, int m)
{}

/* and these are only used in g_io.c... */

int inlet_getsignalindex(t_inlet *x)
{}

int outlet_getsignalindex(t_outlet *x)
{}

void obj_saveformat(const t_object *x, t_binbuf *bb)
{}

/* this one only in g_clone.c -- LATER consider sending the message
without having to chase the linked list every time? */
void obj_sendinlet(t_object *x, int n, t_symbol *s, int argc, t_atom *argv)
{}

/* ------------------- setup routine, somewhat misnamed */
void obj_init(void)
{}