Skip to content
Snippets Groups Projects
Commit 1a9bbd9c authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

use new name of graph_matrix_get_edge_g_sorted()

parent 6240d57e
No related branches found
No related tags found
No related merge requests found
...@@ -377,7 +377,7 @@ static void info_display_requiredby(char const *field, resolve_service_t *res) ...@@ -377,7 +377,7 @@ static void info_display_requiredby(char const *field, resolve_service_t *res)
} else { } else {
deps.len = 0 ; deps.len = 0 ;
r = graph_matrix_get_edge_g_sorted(&deps,&graph, res->sa.s + res->name, 1) ; r = graph_matrix_get_edge_g_sorted_sa(&deps,&graph, res->sa.s + res->name, 1) ;
if (r == -1) if (r == -1)
log_dieu(LOG_EXIT_SYS, "get the requiredby list") ; log_dieu(LOG_EXIT_SYS, "get the requiredby list") ;
...@@ -447,7 +447,7 @@ static void info_display_deps(char const *field, resolve_service_t *res) ...@@ -447,7 +447,7 @@ static void info_display_deps(char const *field, resolve_service_t *res)
} }
else else
{ {
r = graph_matrix_get_edge_g_sorted(&deps,&graph, res->sa.s + res->name, 0) ; r = graph_matrix_get_edge_g_sorted_sa(&deps,&graph, res->sa.s + res->name, 0) ;
if (r == -1) if (r == -1)
log_dieu(LOG_EXIT_SYS, "get the dependencies list") ; log_dieu(LOG_EXIT_SYS, "get the dependencies list") ;
......
...@@ -137,7 +137,8 @@ static void info_display_init(char const *field,char const *treename) ...@@ -137,7 +137,8 @@ static void info_display_init(char const *field,char const *treename)
if (!r) log_die_nomem("stralloc") ; if (!r) log_die_nomem("stralloc") ;
if (r == -1) log_die(LOG_EXIT_SYS,"live: ",live.s," must be an absolute path") ; if (r == -1) log_die(LOG_EXIT_SYS,"live: ",live.s," must be an absolute path") ;
init = tree_isinitialized(live.s, treename, OWNER) ; init = tree_isinitialized(base.s, treename) ;
if (init == -1) log_dieu(LOG_EXIT_SYS, "resolve file of tree: ", treename) ;
if (NOFIELD) info_display_field_name(field) ; if (NOFIELD) info_display_field_name(field) ;
if (!bprintf(buffer_1,"%s%s%s",init ? log_color->valid : log_color->warning, init ? "yes":"no",log_color->off)) if (!bprintf(buffer_1,"%s%s%s",init ? log_color->valid : log_color->warning, init ? "yes":"no",log_color->off))
...@@ -189,7 +190,7 @@ static void info_display_depends(char const *field, char const *treename) ...@@ -189,7 +190,7 @@ static void info_display_depends(char const *field, char const *treename)
if (!graph_build_g(&graph, base.s, treename, DATA_TREE)) if (!graph_build_g(&graph, base.s, treename, DATA_TREE))
log_dieu(LOG_EXIT_SYS,"build the graph") ; log_dieu(LOG_EXIT_SYS,"build the graph") ;
r = graph_matrix_get_edge_g_sorted(&sa, &graph, treename, 0) ; r = graph_matrix_get_edge_g_sorted_sa(&sa, &graph, treename, 0) ;
if (r < 0) if (r < 0)
log_dieu(LOG_EXIT_SYS, "get the dependencies list") ; log_dieu(LOG_EXIT_SYS, "get the dependencies list") ;
...@@ -250,7 +251,7 @@ static void info_display_requiredby(char const *field, char const *treename) ...@@ -250,7 +251,7 @@ static void info_display_requiredby(char const *field, char const *treename)
if (!graph_build_g(&graph, base.s, treename, DATA_TREE)) if (!graph_build_g(&graph, base.s, treename, DATA_TREE))
log_dieu(LOG_EXIT_SYS,"build the graph") ; log_dieu(LOG_EXIT_SYS,"build the graph") ;
r = graph_matrix_get_edge_g_sorted(&sa, &graph, treename, 1) ; r = graph_matrix_get_edge_g_sorted_sa(&sa, &graph, treename, 1) ;
if (r < 0) if (r < 0)
log_dieu(LOG_EXIT_SYS, "get the dependencies list") ; log_dieu(LOG_EXIT_SYS, "get the dependencies list") ;
......
...@@ -576,7 +576,7 @@ void tree_parse_seed(char const *treename, tree_seed_t *seed, tree_what_t *what) ...@@ -576,7 +576,7 @@ void tree_parse_seed(char const *treename, tree_seed_t *seed, tree_what_t *what)
if (tree_seed_isvalid(treename)) { if (tree_seed_isvalid(treename)) {
if (!tree_seed_setseed(seed, treename, 0)) if (!tree_seed_setseed(seed, treename))
log_dieu_nclean(LOG_EXIT_SYS, &cleanup, "parse seed file: ", treename) ; log_dieu_nclean(LOG_EXIT_SYS, &cleanup, "parse seed file: ", treename) ;
if (seed->depends) if (seed->depends)
...@@ -785,10 +785,14 @@ void tree_create(graph_t *g, ssexec_t *info, tree_what_t *what, char const *cons ...@@ -785,10 +785,14 @@ void tree_create(graph_t *g, ssexec_t *info, tree_what_t *what, char const *cons
if (!resolve_write(wres, solve, info->treename.s)) if (!resolve_write(wres, solve, info->treename.s))
log_dieu_nclean(LOG_EXIT_SYS, &cleanup, "write resolve file: ", solve, SS_RESOLVE, "/", info->treename.s) ; log_dieu_nclean(LOG_EXIT_SYS, &cleanup, "write resolve file: ", solve, SS_RESOLVE, "/", info->treename.s) ;
if (what->depends) /** check of the seed.sa.len: if the seed file is not parse at this point
* the seed.sa.s + seed.depends is empty which produce a segmentation fault
* when the -o options is passed at commandline. We have already passed
* through the tree_parse_options_depends anyway when it's the case */
if (what->depends && seed.sa.len)
tree_parse_options_depends(g, info, seed.sa.s + seed.depends, 0, what) ; tree_parse_options_depends(g, info, seed.sa.s + seed.depends, 0, what) ;
if (what->requiredby) if (what->requiredby && seed.sa.len)
tree_parse_options_depends(g, info, seed.sa.s + seed.requiredby, 1, what) ; tree_parse_options_depends(g, info, seed.sa.s + seed.requiredby, 1, what) ;
resolve_free(wres) ; resolve_free(wres) ;
...@@ -888,7 +892,7 @@ void tree_enable_disable_deps(graph_t *g,char const *base, char const *treename, ...@@ -888,7 +892,7 @@ void tree_enable_disable_deps(graph_t *g,char const *base, char const *treename,
size_t pos = 0, element = 0 ; size_t pos = 0, element = 0 ;
stralloc sa = STRALLOC_ZERO ; stralloc sa = STRALLOC_ZERO ;
if (graph_matrix_get_edge_g(&sa, g, treename, action ? 0 : 1) < 0) if (graph_matrix_get_edge_g_sa(&sa, g, treename, action ? 0 : 1) < 0)
log_dieu(LOG_EXIT_SYS, "get ", action ? "dependencies" : "required by" ," of: ", treename) ; log_dieu(LOG_EXIT_SYS, "get ", action ? "dependencies" : "required by" ," of: ", treename) ;
size_t len = sastr_nelement(&sa) ; size_t len = sastr_nelement(&sa) ;
...@@ -980,7 +984,7 @@ void tree_depends_requiredby(graph_t *g, char const *base, char const *treename, ...@@ -980,7 +984,7 @@ void tree_depends_requiredby(graph_t *g, char const *base, char const *treename,
auto_strings(solve, base, SS_SYSTEM) ; auto_strings(solve, base, SS_SYSTEM) ;
if (graph_matrix_get_edge_g_sorted(&sa, g, treename, requiredby) < 0) if (graph_matrix_get_edge_g_sorted_sa(&sa, g, treename, requiredby) < 0)
log_dieu(LOG_EXIT_SYS,"get sorted ", requiredby ? "required by" : "dependency", " list of tree: ", treename) ; log_dieu(LOG_EXIT_SYS,"get sorted ", requiredby ? "required by" : "dependency", " list of tree: ", treename) ;
size_t vlen = sastr_nelement(&sa) ; size_t vlen = sastr_nelement(&sa) ;
...@@ -1075,7 +1079,7 @@ void tree_depends_requiredby_deps(graph_t *g, char const *base, char const *tree ...@@ -1075,7 +1079,7 @@ void tree_depends_requiredby_deps(graph_t *g, char const *base, char const *tree
stralloc sa = STRALLOC_ZERO ; stralloc sa = STRALLOC_ZERO ;
char solve[baselen + SS_SYSTEM_LEN + 1] ; char solve[baselen + SS_SYSTEM_LEN + 1] ;
if (graph_matrix_get_edge_g_sorted(&sa, g, treename, requiredby) < 0) if (graph_matrix_get_edge_g_sorted_sa(&sa, g, treename, requiredby) < 0)
log_dieu(LOG_EXIT_SYS,"get sorted ", requiredby ? "required by" : "dependency", " list of tree: ", treename) ; log_dieu(LOG_EXIT_SYS,"get sorted ", requiredby ? "required by" : "dependency", " list of tree: ", treename) ;
size_t vlen = sastr_nelement(&sa) ; size_t vlen = sastr_nelement(&sa) ;
......
...@@ -268,7 +268,9 @@ int info_graph_display_tree(char const *name, char const *obj) ...@@ -268,7 +268,9 @@ int info_graph_display_tree(char const *name, char const *obj)
if (r <= 0) if (r <= 0)
goto freed ; goto freed ;
int init = tree_isinitialized(sa.s, name, owner) ; int init = tres.init ;
if (init < 0)
goto freed ;
int enabled = tree_isenabled(base, name) ; int enabled = tree_isenabled(base, name) ;
if (enabled < 0) if (enabled < 0)
...@@ -450,7 +452,7 @@ int info_walk(graph_t *g, char const *name, char const *obj, info_graph_func *fu ...@@ -450,7 +452,7 @@ int info_walk(graph_t *g, char const *name, char const *obj, info_graph_func *fu
} else { } else {
count = graph_matrix_get_edge_g_sorted(&sa, g, name, requiredby) ; count = graph_matrix_get_edge_g_sorted_sa(&sa, g, name, requiredby) ;
if (count == -1) { if (count == -1) {
stralloc_free(&sa) ; stralloc_free(&sa) ;
...@@ -479,7 +481,7 @@ int info_walk(graph_t *g, char const *name, char const *obj, info_graph_func *fu ...@@ -479,7 +481,7 @@ int info_walk(graph_t *g, char const *name, char const *obj, info_graph_func *fu
if (!info_graph_display(name, obj, func, depth, last, padding, style)) if (!info_graph_display(name, obj, func, depth, last, padding, style))
goto err ; goto err ;
if (graph_matrix_get_edge_g_sorted(&sa, g, name, requiredby) == -1) if (graph_matrix_get_edge_g_sorted_sa(&sa, g, name, requiredby) == -1)
goto err ; goto err ;
if (sa.len) if (sa.len)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment