| 2361 | } |
| 2362 | |
| 2363 | int cbm_write_db(const char *path, const char *project, const char *root_path, |
| 2364 | const char *indexed_at, CBMDumpNode *nodes, int node_count, CBMDumpEdge *edges, |
| 2365 | int edge_count, CBMDumpVector *vectors, int vector_count, |
| 2366 | CBMDumpTokenVec *token_vecs, int token_vec_count) { |
| 2367 | /* One-shot = open + append all nodes in a single batch + finalize. |
| 2368 | * Produces byte-identical output to the former monolithic writer. */ |
| 2369 | cbm_db_writer_t *w = cbm_writer_open(path); |
| 2370 | if (!w) { |
| 2371 | return CBM_NOT_FOUND; |
| 2372 | } |
| 2373 | (void)cbm_writer_append_nodes(w, nodes, |
| 2374 | node_count); /* error recorded in w, handled by finalize */ |
| 2375 | return cbm_writer_finalize(w, project, root_path, indexed_at, nodes, node_count, edges, |
| 2376 | edge_count, vectors, vector_count, token_vecs, token_vec_count); |
| 2377 | } |
no test coverage detected