pure-data/src/x_array.c

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

/* The "array" object. */

#include "m_pd.h"
#include "g_canvas.h"
#include "m_imp.h"
#include <string.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef _WIN32
#include <io.h>
#endif

#include "m_private_utils.h"

#define TEXT_NGETBYTE

/* -- "table" - classic "array define" object by Guenter Geiger --*/

static int tabcount =;

static void *table_donew(t_symbol *s, int size, int save, int savesize,
    int xpix, int ypix)
{}

static void *table_new(t_symbol *s, t_floatarg f)
{}

    /* return true if the "canvas" object is a "table". */
int canvas_istable(const t_canvas *x)
{}

t_class *array_define_class;

static void array_define_yrange(t_glist *x, t_floatarg ylo, t_floatarg yhi)
{}

static void *array_define_new(t_symbol *s, int argc, t_atom *argv)
{}

void garray_savecontentsto(t_garray *x, t_binbuf *b);

void array_define_save(t_gobj *z, t_binbuf *bb)
{}

t_scalar *garray_getscalar(t_garray *x);

    /* send a pointer to the scalar that owns this array to
    whomever is bound to the given symbol */
static void array_define_send(t_glist *x, t_symbol *s)
{}

void garray_properties(t_garray *x);

static void array_define_done_popup(t_glist*x, t_float which, t_float xpos, t_float ypos)
{}

static void array_define_bang(t_glist *x)
{}

    /* just forward any messages to the garray */
static void array_define_anything(t_glist *x,
    t_symbol *s, int argc, t_atom *argv)
{}

    /* ignore messages like "editmode" */
static void array_define_ignore(t_glist *x,
    t_symbol *s, int argc, t_atom *argv)
{}

/* ---  array_client - common code for objects that refer to arrays -- */

t_array_client;

#define x_sym
#define x_struct
#define x_field
#define x_gp

    /* find the array for this object.  Prints an error  message and returns
        0 on failure. */
static t_array *array_client_getbuf(t_array_client *x, t_glist **glist)
{}

static void array_client_senditup(t_array_client *x)
{}

static void array_client_free(t_array_client *x)
{}

/* ----------  array size : get or set size of an array ---------------- */
static t_class *array_size_class;

t_array_size;
#define x_outlet

static void *array_size_new(t_symbol *s, int argc, t_atom *argv)
{}

static void array_size_bang(t_array_size *x)
{}

static void array_size_float(t_array_size *x, t_floatarg f)
{}

/* ------  range operations - act on a specifiable range in an array ----- */
static t_class *array_sum_class;

t_array_rangeop;

    /* generic creator for operations on ranges (array {get,set,sum,random,
        quantile,search,...}  "onsetin" and "nin" are true if we should make
        inlets for onset and n - if no inlet for 'n' we also won't allow
        it to be specified as an argument.  Everything can take an onset but
        sometimes we don't need an inlet because it's the inlet itself.  In
        any case we allow onset to be specified as an argument (even if it's
        the 'hot inlet') -- for the same reason as in the 'delay' object.
        Finally we can optionally warn if there are extra arguments; some
        specific arguments (e.g., search) allow them but most don't. */
static void *array_rangeop_new(t_class *class,
    t_symbol *s, int *argcp, t_atom **argvp,
    int onsetin, int nin, int warnextra)
{}

static int array_rangeop_getrange(t_array_rangeop *x,
    char **firstitemp, int *nitemp, int *stridep, int *arrayonsetp)
{}

/* --------  specific operations on ranges of arrays -------- */

/* ----------------  array sum -- add them up ------------------- */
static t_class *array_sum_class;

#define t_array_sum

static void *array_sum_new(t_symbol *s, int argc, t_atom *argv)
{}

static void array_sum_bang(t_array_rangeop *x)
{}

static void array_sum_float(t_array_rangeop *x, t_floatarg f)
{}

/* ----------------  array get -- output as list ------------------- */
static t_class *array_get_class;

#define t_array_get

static void *array_get_new(t_symbol *s, int argc, t_atom *argv)
{}

static void array_get_bang(t_array_rangeop *x)
{}

static void array_get_float(t_array_rangeop *x, t_floatarg f)
{}

/* --------------  array set -- copy list to array -------------- */
static t_class *array_set_class;

#define t_array_set

static void *array_set_new(t_symbol *s, int argc, t_atom *argv)
{}

static void array_set_list(t_array_rangeop *x, t_symbol *s,
    int argc, t_atom *argv)
{}

/* -----  array quantile -- output quantile for input from 0 to 1 ------- */
static t_class *array_quantile_class;

#define t_array_quantile

static void *array_quantile_new(t_symbol *s, int argc, t_atom *argv)
{}

static void array_quantile_float(t_array_rangeop *x, t_floatarg f)
{}

/* ----  array random -- output random value with array as distribution ---- */
static t_class *array_random_class;

t_array_random;

static void *array_random_new(t_symbol *s, int argc, t_atom *argv)
{}

static void array_random_seed(t_array_random *x, t_floatarg f)
{}

static void array_random_bang(t_array_random *x)
{}

static void array_random_float(t_array_random *x, t_floatarg f)
{}

/* ----  array max -- output largest value and its index ------------ */
static t_class *array_max_class;

t_array_max;

static void *array_max_new(t_symbol *s, int argc, t_atom *argv)
{}

static void array_max_bang(t_array_max *x)
{}

static void array_max_float(t_array_max *x, t_floatarg f)
{}

/* ----  array min -- output largest value and its index ------------ */
static t_class *array_min_class;

t_array_min;

static void *array_min_new(t_symbol *s, int argc, t_atom *argv)
{}

static void array_min_bang(t_array_min *x)
{}

static void array_min_float(t_array_min *x, t_floatarg f)
{}

/* overall creator for "array" objects - dispatch to "array define" etc */
static void *arrayobj_new(t_symbol *s, int argc, t_atom *argv)
{}

void canvas_add_for_class(t_class *c);

/* ---------------- global setup function -------------------- */

void x_array_setup(void)
{}