Build all 4 node index B-trees. Returns 0 on success, ERR_SORT_FAILED on failure. */
| 2046 | |
| 2047 | /* Build all 4 node index B-trees. Returns 0 on success, ERR_SORT_FAILED on failure. */ |
| 2048 | static int build_node_indexes(FILE *fp, uint32_t *next_page, CBMDumpNode *nodes, int node_count, |
| 2049 | SortJob *nsorts, uint32_t *label_root, uint32_t *name_root, |
| 2050 | uint32_t *file_root, uint32_t *qn_root) { |
| 2051 | *label_root = |
| 2052 | build_node_index_sorted(fp, next_page, nodes, node_count, nsorts[0].perm, ncol_label); |
| 2053 | *name_root = build_node_index_sorted(fp, next_page, nodes, node_count, nsorts[NSORT_NAME].perm, |
| 2054 | ncol_name); |
| 2055 | *file_root = build_node_index_sorted(fp, next_page, nodes, node_count, nsorts[NSORT_FILE].perm, |
| 2056 | ncol_file); |
| 2057 | *qn_root = |
| 2058 | build_node_index_sorted(fp, next_page, nodes, node_count, nsorts[NSORT_QN].perm, ncol_qn); |
| 2059 | if (node_count > 0 && (!*label_root || !*name_root || !*file_root || !*qn_root)) { |
| 2060 | return ERR_SORT_FAILED; |
| 2061 | } |
| 2062 | return 0; |
| 2063 | } |
| 2064 | |
| 2065 | /* Build all 7 edge index B-trees. Returns 0 on success, ERR_SORT_FAILED on failure. */ |
| 2066 | static int build_edge_indexes(FILE *fp, uint32_t *next_page, CBMDumpEdge *edges, int edge_count, |
no test coverage detected