Given the name of a journal, returns the main database File that it belongs to, or NULL. This must be called while holding Mutex().
| 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(). |
| 268 | static File* FindMainFile(const char* journal_name) { |
| 269 | size_t length = strlen(journal_name); |
| 270 | size_t suffix_length = strlen(JOURNAL_SUFFIX); |
| 271 | if (length <= suffix_length) return NULL; |
| 272 | size_t name_length = length - suffix_length; |
| 273 | if (strcmp(journal_name + name_length, JOURNAL_SUFFIX) != 0) return NULL; |
| 274 | return FindMainFileByPrefix(journal_name, name_length); |
| 275 | } |
| 276 | |
| 277 | // Records an error message on the given main database File (see |
| 278 | // TakeErrorMessage()). The File's connection must be the caller (so we're |
nothing calls this directly
no outgoing calls
no test coverage detected