63 int modifier_num,
int *mstate) {
74 int *workpatch_pos =
xmalloc((
size_t)patch_size *
sizeof(
int));
75 int *extract_pos =
xmalloc((
size_t)patch_size *
sizeof(
int));
82 for (
int im = 0; im < modifier_num; im++) {
93 if (intersection_size > patch_size)
die(
"xt_idxmod_new: internal error: (intersection_size > patch_size)");
102 if (missing)
die(
"xt_idxmod_new: internal error: cannot locate all intersection positions (1)");
111 if (missing)
die(
"xt_idxmod_new: internal error: cannot locate all intersection positions (2)");
118 if (undef_num)
die(
"xt_idxmod_new: internal error: failed access: m->subst is too small");
128 if ( mstate != NULL &&
mask != 0) {
130 for (
int i=0; i<intersection_size; i++) {
131 p = workpatch_pos[i];
132 workpatch_idx[p] = subst_idx[i];
136 for (
int i=0; i<intersection_size; i++) {
137 p = workpatch_pos[i];
138 workpatch_idx[p] = subst_idx[i];
141 workpatch_idxlist =
xt_idxvec_new(workpatch_idx, patch_size);
151 return workpatch_idxlist;
add versions of standard API functions not returning on error
Xt_idxlist extract
idx values
base definitions header file
int xt_idxlist_get_num_indices(Xt_idxlist idxlist)
int xt_idxlist_get_positions_of_indices(Xt_idxlist idxlist, const Xt_int *indices, int num_indices, int *positions, int single_match_only)
void xt_idxlist_get_indices(Xt_idxlist idxlist, Xt_int *indices)
int xt_idxlist_get_indices_at_positions(Xt_idxlist idxlist, const int *positions, int num_pos, Xt_int *indices, Xt_int undef_idx)
Xt_idxlist xt_idxlist_get_intersection(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst)
Xt_idxlist xt_idxlist_copy(Xt_idxlist idxlist)
const Xt_int * xt_idxlist_get_indices_const(Xt_idxlist idxlist)
void xt_idxlist_delete(Xt_idxlist idxlist)
Xt_idxlist xt_idxmod_new(Xt_idxlist patch_idxlist, struct Xt_modifier *modifier, int modifier_num, int *mstate)
generates a new index list based on an index list and a sequence of modifiers
Xt_idxlist xt_idxvec_new(const Xt_int *idxlist, int num_indices)