long fx_disp_lookup_window::on_cmd_save_userlib(FXObject *, FXSelector, void *) { const int i = selected_component; disp_lookup *lookup = &disp->disp.lookup; disp_t *d = disp_copy(lookup->component[i].disp); disp_list_add(user_lib, d, NULL); return 1; }
obj_t * toplevel_obj_copy (obj_t *obj) { obj_t *res = emalloc (sizeof(obj_t)); memcpy (res, obj, sizeof(obj_t)); switch (obj->type) { case TL_TYPE_DISP: obj->cont.disp = disp_copy (res->cont.disp); break; case TL_TYPE_STACK: obj->cont.stack = stack_copy (res->cont.stack); break; case TL_TYPE_SAMPLE: obj->cont.sample_info = sample_info_copy (res->cont.sample_info); break; default: /* not needed */ assert (0); } return res; }