MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / toml_write_atomic

Function toml_write_atomic

src/cli/config_toml_edit.c:768–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766}
767
768static int toml_write_atomic(const char *requested_path, const char *old_data, size_t old_len,
769 const char *new_data, size_t new_len,
770 const toml_file_snapshot_t *snapshot) {
771 cbm_config_edit_target_t target;
772 if (cbm_config_edit_target_open(requested_path, &target) < 0) {
773 return TOML_EDIT_ERR;
774 }
775 int result = toml_write_atomic_at(&target, old_data, old_len, new_data, new_len, snapshot);
776 cbm_config_edit_target_close(&target);
777 return result;
778}
779
780#ifdef CBM_TOML_EDIT_ENABLE_TEST_API
781void cbm_toml_set_precommit_hook_for_testing(cbm_toml_precommit_test_hook_t hook, void *context) {

Calls 3

toml_write_atomic_atFunction · 0.85

Tested by

no test coverage detected