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

Function yaml_write_atomic

src/cli/config_yaml_edit.c:1031–1042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1029}
1030
1031static int yaml_write_atomic(const char *requested_path, const char *data, size_t len,
1032 const char *expected_data, size_t expected_len,
1033 const yaml_file_snapshot_t *expected_snapshot) {
1034 cbm_config_edit_target_t target;
1035 if (cbm_config_edit_target_open(requested_path, &target) < 0) {
1036 return YAML_ERROR;
1037 }
1038 int result =
1039 yaml_write_atomic_at(&target, data, len, expected_data, expected_len, expected_snapshot);
1040 cbm_config_edit_target_close(&target);
1041 return result;
1042}
1043
1044#ifdef CBM_YAML_ENABLE_TEST_API
1045void cbm_yaml_set_precommit_hook_for_testing(cbm_yaml_precommit_test_hook_t hook, void *context) {

Callers 1

yaml_commit_if_changedFunction · 0.85

Calls 3

yaml_write_atomic_atFunction · 0.85

Tested by

no test coverage detected