示例#1
0
文件: x_list.c 项目: Angeldude/pd
void alist_clone(t_alist *x, t_alist *y)
{
    int i;
    y->l_pd = alist_class;
    y->l_n = x->l_n;
    y->l_npointer = x->l_npointer;
    if (!(y->l_vec = (t_listelem *)getbytes(y->l_n * sizeof(*y->l_vec))))
    {
        y->l_n = 0;
        error("list_alloc: out of memory");
    }
    else for (i = 0; i < x->l_n; i++)
    {
        y->l_vec[i].l_a = x->l_vec[i].l_a;
        if (y->l_vec[i].l_a.a_type == A_POINTER)
        {
            gpointer_copy(y->l_vec[i].l_a.a_w.w_gpointer, &y->l_vec[i].l_p);
            y->l_vec[i].l_a.a_w.w_gpointer = &y->l_vec[i].l_p;
        }
    }
}
示例#2
0
文件: m_obj.c 项目: 4nykey/rockbox
void outlet_pointer(t_outlet *x, t_gpointer *gp)
{
    t_outconnect *oc;
    t_gpointer gpointer;
    char c;
    if (&c < stacklimit)
    	outlet_stackerror(x);
    else
    {
#if 0
    	gpointer_copy(gp, &gpointer);
    	for (oc = x->o_connections; oc; oc = oc->oc_next)
    	    pd_pointer(oc->oc_to, &gpointer);
    	gpointer_unset(&gpointer);
#else
    	gpointer = *gp;
    	for (oc = x->o_connections; oc; oc = oc->oc_next)
    	    pd_pointer(oc->oc_to, &gpointer);
#endif
    }
}
示例#3
0
文件: x_list.c 项目: Angeldude/pd
void alist_list(t_alist *x, t_symbol *s, int argc, t_atom *argv)
{
    int i;
    alist_clear(x);
    if (!(x->l_vec = (t_listelem *)getbytes(argc * sizeof(*x->l_vec))))
    {
        x->l_n = 0;
        error("list_alloc: out of memory");
        return;
    }
    x->l_n = argc;
    x->l_npointer = 0;
    for (i = 0; i < argc; i++)
    {
        x->l_vec[i].l_a = argv[i];
        if (x->l_vec[i].l_a.a_type == A_POINTER)
        {
            x->l_npointer++;
            gpointer_copy(x->l_vec[i].l_a.a_w.w_gpointer, &x->l_vec[i].l_p);
            x->l_vec[i].l_a.a_w.w_gpointer = &x->l_vec[i].l_p;
        }
    }
}