mptree
struct mptree *mptree;
struct mptree *mptree;
mptree = cbd->mptree;
if (!mptree[mp].child)
for (i = mptree[mp].child; i; i = mptree[i].sibling)
if (mptree[i].compl == compl && !strncmp(mptree[i].comp, compstr, compl))
dirmap[dn] = mptree[mp > 0 ? mp : -mp].mountpoint;
propagate_mountpoints(struct mptree *mptree, int pos, Id mountpoint)
if (mptree[pos].mountpoint == -1)
mptree[pos].mountpoint = mountpoint;
mountpoint = mptree[pos].mountpoint;
for (i = mptree[pos].child; i; i = mptree[i].sibling)
propagate_mountpoints(mptree, i, mountpoint);
struct mptree *mptree;
mptree = solv_extend_resize(0, 1, sizeof(struct mptree), MPTREE_BLOCK);
mptree[0].sibling = 0;
mptree[0].child = 0;
mptree[0].comp = 0;
mptree[0].compl = 0;
mptree[0].mountpoint = -1;
for (i = mptree[pos].child; i; i = mptree[i].sibling)
if (mptree[i].compl == compl && !strncmp(mptree[i].comp, compstr, compl))
mptree = solv_extend(mptree, nmptree, 1, sizeof(struct mptree), MPTREE_BLOCK);
mptree[i].sibling = mptree[pos].child;
mptree[i].child = 0;
mptree[i].comp = compstr;
mptree[i].compl = compl;
mptree[i].mountpoint = -1;
mptree[pos].child = i;
mptree[pos].mountpoint = mp;
propagate_mountpoints(mptree, 0, mptree[0].mountpoint);
printf("#%d sibling: %d\n", i, mptree[i].sibling);
printf("#%d child: %d\n", i, mptree[i].child);
printf("#%d comp: %s\n", i, mptree[i].comp);
printf("#%d compl: %d\n", i, mptree[i].compl);
printf("#%d mountpont: %d\n", i, mptree[i].mountpoint);
cbd.mptree = mptree;
solv_free(mptree);