diff --git a/pd/src/g_canvas.h b/pd/src/g_canvas.h index 63c28c0f7e32d0705edb278afb5ef6d308426fc4..6c0e9d0486e062f202995c70cde3a1ab676c0a76 100644 --- a/pd/src/g_canvas.h +++ b/pd/src/g_canvas.h @@ -252,7 +252,8 @@ typedef struct _dataslot { int ds_type; t_symbol *ds_name; - t_symbol *ds_arraytemplate; /* filled in for arrays only */ + t_symbol *ds_fieldtemplate; /* filled in for arrays only */ + t_binbuf *ds_canvas; /* binbuf of an abstraction to be loaded */ } t_dataslot; typedef struct _template diff --git a/pd/src/g_readwrite.c b/pd/src/g_readwrite.c index 157a10a04e5b17ef186cccabeafb00cf154ed756..10f6741c4f2f619ba9a52c2213f1fea6b665dfe6 100644 --- a/pd/src/g_readwrite.c +++ b/pd/src/g_readwrite.c @@ -71,7 +71,7 @@ static void glist_readatoms(t_glist *x, int natoms, t_atom *vec, { t_array *a = w[i].w_array; int elemsize = a->a_elemsize, nitems = 0; - t_symbol *arraytemplatesym = template->t_vec[i].ds_arraytemplate; + t_symbol *arraytemplatesym = template->t_vec[i].ds_fieldtemplate; t_template *arraytemplate = template_findbyname(arraytemplatesym); if (!arraytemplate) @@ -420,7 +420,7 @@ void canvas_writescalar(t_symbol *templatesym, t_word *w, t_binbuf *b, int j; t_array *a = w[i].w_array; int elemsize = a->a_elemsize, nitems = a->a_n; - t_symbol *arraytemplatesym = template->t_vec[i].ds_arraytemplate; + t_symbol *arraytemplatesym = template->t_vec[i].ds_fieldtemplate; for (j = 0; j < nitems; j++) canvas_writescalar(arraytemplatesym, (t_word *)(((char *)a->a_vec) + elemsize * j), b, 1); @@ -467,7 +467,7 @@ static void canvas_addtemplatesforscalar(t_symbol *templatesym, int j; t_array *a = w->w_array; int elemsize = a->a_elemsize, nitems = a->a_n; - t_symbol *arraytemplatesym = ds->ds_arraytemplate; + t_symbol *arraytemplatesym = ds->ds_fieldtemplate; canvas_doaddtemplate(arraytemplatesym, p_ntemplates, p_templatevec); for (j = 0; j < nitems; j++) canvas_addtemplatesforscalar(arraytemplatesym, @@ -492,7 +492,7 @@ static void canvas_addtemplatesforstruct(t_template *template, { if (ds->ds_type == DT_ARRAY) { - t_symbol *arraytemplatesym = ds->ds_arraytemplate; + t_symbol *arraytemplatesym = ds->ds_fieldtemplate; t_template *arraytemplate = template_findbyname(arraytemplatesym); if (arraytemplate) { @@ -562,7 +562,7 @@ t_binbuf *glist_writetobinbuf(t_glist *x, int wholething) } if (template->t_vec[j].ds_type == DT_ARRAY) binbuf_addv(b, "sss;", type, template->t_vec[j].ds_name, - gensym(template->t_vec[j].ds_arraytemplate->s_name + 3)); + gensym(template->t_vec[j].ds_fieldtemplate->s_name + 3)); else binbuf_addv(b, "ss;", type, template->t_vec[j].ds_name); } binbuf_addsemi(b); @@ -737,7 +737,7 @@ static void canvas_savetemplatesto(t_canvas *x, t_binbuf *b, int wholething) } if (template->t_vec[j].ds_type == DT_ARRAY) binbuf_addv(b, "sss", type, template->t_vec[j].ds_name, - gensym(template->t_vec[j].ds_arraytemplate->s_name + 3)); + gensym(template->t_vec[j].ds_fieldtemplate->s_name + 3)); else binbuf_addv(b, "ss", type, template->t_vec[j].ds_name); } binbuf_addsemi(b); diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c index a2f873dbb2e2c590782b2f1a3f9bb2a18c17dd8e..a0b2f7d33056e438488179b55e2f91e43acb3df9 100644 --- a/pd/src/g_scalar.c +++ b/pd/src/g_scalar.c @@ -29,7 +29,7 @@ void word_init(t_word *wp, t_template *template, t_gpointer *gp) wp->w_symbol = &s_symbol; else if (type == DT_ARRAY) { - wp->w_array = array_new(datatypes->ds_arraytemplate, gp); + wp->w_array = array_new(datatypes->ds_fieldtemplate, gp); } else if (type == DT_LIST) { @@ -167,19 +167,19 @@ int template_check_array_fields(t_symbol *structname, t_template *template) { if (datatypes->ds_type == DT_ARRAY) { - elemtemplate = template_findbyname(datatypes->ds_arraytemplate); + elemtemplate = template_findbyname(datatypes->ds_fieldtemplate); if (!(elemtemplate)) { t_object *ob = template_getstruct(template); pd_error(ob, "%s: no such template", - datatypes->ds_arraytemplate->s_name); + datatypes->ds_fieldtemplate->s_name); return (-1); } else if (elemtemplate->t_sym == structname) { t_object *ob = template_getstruct(template); pd_error(ob, "%s: circular dependency", - datatypes->ds_arraytemplate->s_name); + datatypes->ds_fieldtemplate->s_name); return (0); } else @@ -276,7 +276,7 @@ int template_has_elemtemplate(t_template *t, t_template *elemtemplate) { if (d->ds_type == DT_ARRAY) { - if (d->ds_arraytemplate == elemtemplate->t_sym) + if (d->ds_fieldtemplate == elemtemplate->t_sym) { returnval = 1; break; @@ -284,7 +284,7 @@ int template_has_elemtemplate(t_template *t, t_template *elemtemplate) else { returnval = template_has_elemtemplate( - template_findbyname(d->ds_arraytemplate), + template_findbyname(d->ds_fieldtemplate), elemtemplate); } } diff --git a/pd/src/g_template.c b/pd/src/g_template.c index d75d14742de416c6a9405401d1f3775f9d06c99a..9678bc0a66b26dca78a9157cac16b3288b0ff415 100644 --- a/pd/src/g_template.c +++ b/pd/src/g_template.c @@ -58,7 +58,7 @@ static int dataslot_matches(t_dataslot *ds1, t_dataslot *ds2, return ((!nametoo || ds1->ds_name == ds2->ds_name) && ds1->ds_type == ds2->ds_type && (ds1->ds_type != DT_ARRAY || - ds1->ds_arraytemplate == ds2->ds_arraytemplate)); + ds1->ds_fieldtemplate == ds2->ds_fieldtemplate)); } /* -- templates, the active ingredient in gtemplates defined below. ------- */ @@ -108,7 +108,7 @@ t_template *template_new(t_symbol *templatesym, int argc, t_atom *argv) x->t_n = newn; x->t_vec[oldn].ds_type = newtype; x->t_vec[oldn].ds_name = newname; - x->t_vec[oldn].ds_arraytemplate = newarraytemplate; + x->t_vec[oldn].ds_fieldtemplate = newarraytemplate; bad: argc -= 2; argv += 2; } @@ -141,7 +141,7 @@ int template_find_field(t_template *x, t_symbol *name, int *p_onset, { *p_onset = i * sizeof(t_word); *p_type = x->t_vec[i].ds_type; - *p_arraytype = x->t_vec[i].ds_arraytemplate; + *p_arraytype = x->t_vec[i].ds_fieldtemplate; return (1); } return (0); @@ -329,7 +329,7 @@ static t_scalar *template_conformscalar(t_template *tfrom, t_template *tto, } else if (ds->ds_type == DT_ARRAY) { - t_symbol *arraytemplate = ds->ds_arraytemplate; + t_symbol *arraytemplate = ds->ds_fieldtemplate; if (arraytemplate == tfrom->t_sym || arraytemplate == tto->t_sym) {