MCPcopy Create free account
hub / github.com/WiseLibs/better-sqlite3 / FindMainFileByPrefix

Method FindMainFileByPrefix

src/util/fd-vfs.cpp:257–264  ·  view source on GitHub ↗

Returns the open main database File whose name is the first name_length characters of the given name, or NULL. This must be called while holding Mutex().

Source from the content-addressed store, hash-verified

255 // name_length characters of the given name, or NULL. This must be called
256 // while holding Mutex().
257 static File* FindMainFileByPrefix(const char* name, size_t name_length) {
258 for (File* file : MainFiles()) {
259 if (strlen(file->name) == name_length && strncmp(file->name, name, name_length) == 0) {
260 return file;
261 }
262 }
263 return NULL;
264 }
265
266 // Given the name of a journal, returns the main database File that it
267 // belongs to, or NULL. This must be called while holding Mutex().

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected