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

Function t_mtime_ns

tests/test_artifact.c:723–735  ·  view source on GitHub ↗

Portable local mtime_ns for assertions (mirrors artifact.c's art_stat_mtime_ns * and pipeline_incremental.c's stat_mtime_ns — all three must agree or a * restamped row would never match the incremental classifier). */

Source from the content-addressed store, hash-verified

721 * and pipeline_incremental.c's stat_mtime_ns — all three must agree or a
722 * restamped row would never match the incremental classifier). */
723static int64_t t_mtime_ns(const char *path) {
724 struct stat st;
725 if (stat(path, &st) != 0) {
726 return -1;
727 }
728#ifdef __APPLE__
729 return (int64_t)st.st_mtimespec.tv_sec * 1000000000LL + (int64_t)st.st_mtimespec.tv_nsec;
730#elif defined(_WIN32)
731 return (int64_t)st.st_mtime * 1000000000LL;
732#else
733 return (int64_t)st.st_mtim.tv_sec * 1000000000LL + (int64_t)st.st_mtim.tv_nsec;
734#endif
735}
736
737/* True iff <repo>/.codebase-memory/artifact.json contains substr. */
738static bool meta_contains(const char *repo, const char *substr) {

Callers 1

test_artifact.cFile · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected