Index: util_loclib.h =================================================================== --- util_loclib.h (revision 3836) +++ util_loclib.h (revision 3837) @@ -29,6 +29,7 @@ /* Utility functions for maintaining a local (per sheet) library */ #include +#include /* Return the group whose purpose matches purpose from under sheet's indirect group. If alloc is 1, and the group does not exist, it is @@ -35,3 +36,8 @@ created using src and *alloced is set to 1. */ csch_cgrp_t *csch_loclib_get_root(csch_sheet_t *sheet, const char *purpose, csch_source_arg_t *src, int alloc, int *alloced); + +/* Resolve library root dir and indirect root group for a local lib master. + If alloc==1, create it using src when missing. Returns 0 on success. On + failure there's no root dir in indirect. */ +int csch_loclib_get_roots(csch_lib_t **root_dir_out, const csch_cgrp_t **root_grp_out, csch_lib_master_t *master, csch_sheet_t *sheet, const csch_source_arg_t *src, int alloc, int *alloced);