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

Function journal_is_hot

tests/test_runtime_settings.c:554–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552}
553
554static bool journal_is_hot(const char *path) {
555 static const unsigned char magic[8] = {0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd7};
556 unsigned char header[12] = {0};
557 FILE *file = cbm_fopen(path, "rb");
558 bool read = file && fread(header, 1, sizeof(header), file) == sizeof(header);
559 if (file)
560 fclose(file);
561 unsigned records = ((unsigned)header[8] << 24) | ((unsigned)header[9] << 16) |
562 ((unsigned)header[10] << 8) | (unsigned)header[11];
563 return read && memcmp(header, magic, sizeof(magic)) == 0 && records > 0;
564}
565
566static bool leave_hot_journal(const char *cache, const char *update_sql) {
567 char db_path[512], journal_path[512], db_copy[512], journal_copy[512];

Callers 1

leave_hot_journalFunction · 0.85

Calls 2

cbm_fopenFunction · 0.85
freadFunction · 0.85

Tested by

no test coverage detected