version 1.4, 2019/04/28 20:26:49 |
version 1.5, 2019/05/01 09:02:25 |
|
|
*/ |
*/ |
|
|
static void |
static void |
reorg_root(struct pnode *root) |
reorg_root(struct pnode *root, const char *sec) |
{ |
{ |
struct pnode *date, *info, *name, *vol, *nc; |
struct pnode *date, *info, *name, *vol, *nc; |
|
|
Line 53 reorg_root(struct pnode *root) |
|
Line 53 reorg_root(struct pnode *root) |
|
pnode_alloc_text(name, |
pnode_alloc_text(name, |
pnode_getattr_raw(root, ATTRKEY_ID, "UNKNOWN")); |
pnode_getattr_raw(root, ATTRKEY_ID, "UNKNOWN")); |
} |
} |
if (vol == NULL) { |
if (vol == NULL || sec != NULL) { |
|
pnode_unlink(vol); |
vol = pnode_alloc(NULL); |
vol = pnode_alloc(NULL); |
vol->node = NODE_MANVOLNUM; |
vol->node = NODE_MANVOLNUM; |
vol->parent = root; |
vol->parent = root; |
pnode_alloc_text(vol, "1"); |
pnode_alloc_text(vol, sec == NULL ? "1" : sec); |
} |
} |
|
|
/* Insert prologue information at the beginning. */ |
/* Insert prologue information at the beginning. */ |
Line 271 reorg_recurse(struct pnode *n) |
|
Line 272 reorg_recurse(struct pnode *n) |
|
} |
} |
|
|
void |
void |
ptree_reorg(struct ptree *tree) |
ptree_reorg(struct ptree *tree, const char *sec) |
{ |
{ |
reorg_root(tree->root); |
reorg_root(tree->root, sec); |
reorg_recurse(tree->root); |
reorg_recurse(tree->root); |
} |
} |