Build all 4 node index B-trees. Returns 0 on success, ERR_SORT_FAILED on failure. */
| 1911 | |
| 1912 | /* Build all 4 node index B-trees. Returns 0 on success, ERR_SORT_FAILED on failure. */ |
| 1913 | static int build_node_indexes(FILE *fp, uint32_t *next_page, CBMDumpNode *nodes, int node_count, |
| 1914 | SortJob *nsorts, uint32_t *label_root, uint32_t *name_root, |
| 1915 | uint32_t *file_root, uint32_t *qn_root) { |
| 1916 | *label_root = |
| 1917 | build_node_index_sorted(fp, next_page, nodes, node_count, nsorts[0].perm, ncol_label); |
| 1918 | *name_root = build_node_index_sorted(fp, next_page, nodes, node_count, nsorts[NSORT_NAME].perm, |
| 1919 | ncol_name); |
| 1920 | *file_root = build_node_index_sorted(fp, next_page, nodes, node_count, nsorts[NSORT_FILE].perm, |
| 1921 | ncol_file); |
| 1922 | *qn_root = |
| 1923 | build_node_index_sorted(fp, next_page, nodes, node_count, nsorts[NSORT_QN].perm, ncol_qn); |
| 1924 | if (node_count > 0 && (!*label_root || !*name_root || !*file_root || !*qn_root)) { |
| 1925 | return ERR_SORT_FAILED; |
| 1926 | } |
| 1927 | return 0; |
| 1928 | } |
| 1929 | |
| 1930 | /* Build all 7 edge index B-trees. Returns 0 on success, ERR_SORT_FAILED on failure. */ |
| 1931 | static int build_edge_indexes(FILE *fp, uint32_t *next_page, CBMDumpEdge *edges, int edge_count, |
no test coverage detected