diff --git a/src/66/66-intree.c b/src/66/66-intree.c index 065df952330c99a5313048ccc55c5d5afd54a796..268077304ad56e95e0814589abcc663113ce48e2 100644 --- a/src/66/66-intree.c +++ b/src/66/66-intree.c @@ -204,6 +204,42 @@ static void info_display_enabled(char const *field,char const *treename) strerr_diefu1sys(111,"write to stdout") ; } +static void info_get_graph_src(ss_resolve_graph_t *graph,char const *src,unsigned int reverse) +{ + + size_t srclen = strlen(src), pos ; + stralloc sa = STRALLOC_ZERO ; + ss_resolve_t res = RESOLVE_ZERO ; + char solve[srclen + 1 + SS_SYM_SVC_LEN + SS_SRC_LEN + 1] ; + memcpy(solve,src,srclen) ; + memcpy(solve + srclen,"/" SS_SYM_DB, SS_SYM_DB_LEN + 1) ; + memcpy(solve + srclen + 1 + SS_SYM_DB_LEN,SS_SRC,SS_SRC_LEN) ; + solve[srclen + 1 + SS_SYM_DB_LEN + SS_SRC_LEN] = 0 ; + + if (!sastr_dir_get(&sa,solve,"",S_IFDIR)) + strerr_diefu2sys(111,"get source service file at: ",solve) ; + + memcpy(solve + srclen,"/" SS_SYM_SVC,SS_SYM_SVC_LEN + 1) ; + solve[srclen + 1 + SS_SYM_SVC_LEN] = 0 ; + + if (!sastr_dir_get(&sa,solve,"",S_IFDIR)) + strerr_diefu2sys(111,"get source service file at: ",solve) ; + + for (pos = 0 ;pos < sa.len; pos += strlen(sa.s + pos) + 1) + { + char *name = sa.s + pos ; + if (!ss_resolve_check(src,name)) + strerr_diefu2x(111,"get resolve of: ",name) ; + if (!ss_resolve_read(&res,src,name)) + strerr_diefu2x(111,"read resolve file of: ",name) ; + if (!ss_resolve_graph_build(graph,&res,src,reverse)) + strerr_diefu2x(111,"build the graph from: ",src) ; + } + + stralloc_free(&sa) ; + ss_resolve_free(&res) ; +} + static void info_display_contains(char const *field, char const *treename) { int r ; @@ -216,8 +252,7 @@ static void info_display_contains(char const *field, char const *treename) !stralloc_cats(&src,SS_SVDIRS) || !stralloc_0(&src)) exitstralloc("display_contains") ; - r = ss_resolve_graph_src(&graph,src.s,0,2) ; - if (!r) strerr_diefu2x(111,"resolve source of graph for tree: ",treename) ; + info_get_graph_src(&graph,src.s,0) ; padding = info_display_field_name(field) ;