return (0);
}
-int construct_new_graph(t_parse_tree_node *parse_tree, __attribute__((unused)) t_vec *nodes, __attribute__((unused)) t_vec *mosfets)
+int construct_new_graph(t_parse_tree_node *parse_tree, t_vec *nodes, t_vec *mosfets)
{
t_catalog part_catalog;
+ int res;
- init_catalog(&part_catalog);
- extract_used_names(&part_catalog, parse_tree);
- rebind_names_to_parts(&part_catalog);
- build_main_graph(&part_catalog);
- transfer_main(&part_catalog, nodes, mosfets);
+ res = 0;
+ res = res || (init_catalog(&part_catalog) != success);
+ res = res || extract_used_names(&part_catalog, parse_tree);
+ res = res || rebind_names_to_parts(&part_catalog);
+ res = res || build_main_graph(&part_catalog);
+ res = res || transfer_main(&part_catalog, nodes, mosfets);
free_catalog(&part_catalog);
- return (0);
+ return (res);
}
int rewrite_graph(t_parse_tree_node *parse_tree, t_vec *nodes, t_vec *mosfets)