64 int modifier_num,
int *mstate) {
75 int *workpatch_pos =
xmalloc((
size_t)patch_size *
sizeof(
int));
76 int *extract_pos =
xmalloc((
size_t)patch_size *
sizeof(
int));
83 for (
int im = 0; im < modifier_num; im++) {
94 if (intersection_size > patch_size)
die(
"xt_idxmod_new: internal error: (intersection_size > patch_size)");
103 if (missing)
die(
"xt_idxmod_new: internal error: cannot locate all intersection positions (1)");
112 if (missing)
die(
"xt_idxmod_new: internal error: cannot locate all intersection positions (2)");
119 if (undef_num)
die(
"xt_idxmod_new: internal error: failed access: m->subst is too small");
129 if ( mstate != NULL &&
mask != 0) {
131 for (
int i=0; i<intersection_size; i++) {
132 p = workpatch_pos[i];
133 workpatch_idx[p] = subst_idx[i];
137 for (
int i=0; i<intersection_size; i++) {
138 p = workpatch_pos[i];
139 workpatch_idx[p] = subst_idx[i];
142 workpatch_idxlist =
xt_idxvec_new(workpatch_idx, patch_size);
152 return workpatch_idxlist;
add versions of standard API functions not returning on error
Xt_idxlist extract
idx values
base definitions header file
struct Xt_idxlist_ * Xt_idxlist
int xt_idxlist_get_positions_of_indices(Xt_idxlist idxlist, const Xt_int *indices, int num_indices, int *positions, int single_match_only)
const Xt_int * xt_idxlist_get_indices_const(Xt_idxlist idxlist)
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)
void xt_idxlist_delete(Xt_idxlist idxlist)
Provide non-public declarations common to all index lists.
#define xt_idxlist_get_num_indices(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)