|
| void | log_series_init (log_series_set_t *set) |
| | Every folder's numbering forgotten: the next take walks its folder.
|
| void | log_series_forget_all (void) |
| | Every set forgets every folder's numbering before its next take: the card's files were changed by another hand than the logger's (FILES' copy, move, rename, new entry or delete), so a folder may hold a higher number than a set handed out last.
|
| static bool | same_dir (const char *a, const char *b) |
| | Whether a and b name one folder: FAT compares without case.
|
| bool | log_series_follow (log_series_set_t *set, char *took, const char *want) |
| | One kind of file follows its folder setting: want is the folder of its next take, and took (CARD_DIR_MAX bytes) the folder of the last one.
|
| log_series_t * | log_series_of (log_series_set_t *set, const char *dir) |
| | The numbering of folder dir, case folded: its slot, or a free one, or the slot set gives up next, cleared.
|
| static void | take_highest (const char *name, void *ctx) |
| | The highest number a walk sees, under any prefix, a folder's name too: a folder called MOTOR003.CSV takes that number as a file does, because no file of that name can be created beside it.
|
| static card_dir_t | take_level (void *ctx, const char *level) |
| | One level of the folder, through the caller's make_dir().
|
| static bool | number_free (const log_take_io_t *io, const char *dir, int n) |
| | None of number n's LOG_NAME_FORMS names is in dir.
|
| log_take_t | log_take (log_series_set_t *set, const log_take_io_t *io, const char *dir, log_prefix_t prefix, bool report, int *number) |
| | Make folder dir, take the next free number of its series and create the run's file under prefix: the CSV, or with report the TXT. number takes the number on LOG_TAKE_OK and -1 otherwise.
|
| bool | log_marks_busy (const log_marks_t *marks, const char *dir, const char *name) |
| | Whether name in folder dir is a file the logger is still writing, or one whose deletion would remove such a file (log_name_busy()), by the marks of that folder alone: an open USER/LOGS/ATEST005.CSV does not hold back BENCH/LOGS/SERVO005.CSV.
|
Taking a run's number in a folder of the card.
SPDX-License-Identifier: MIT
| bool log_series_follow |
( |
log_series_set_t * | set, |
|
|
char * | took, |
|
|
const char * | want ) |
One kind of file follows its folder setting: want is the folder of its next take, and took (CARD_DIR_MAX bytes) the folder of the last one.
A folder other than took, case folded, is copied into it and forgets every folder's numbering in set, so the next take of each kind walks its folder and numbers from what that folder holds. A file already open stays in the folder it was opened in. True when the folder changed; false for the same folder, a NULL or a want that does not fit.
- Parameters
-
| set | The numbering set. |
| took | The folder of the last take, CARD_DIR_MAX bytes. |
| want | The folder of the next take. |
- Returns
- true when the folder changed.
| void log_series_forget_all |
( |
void | | ) |
|
Every set forgets every folder's numbering before its next take: the card's files were changed by another hand than the logger's (FILES' copy, move, rename, new entry or delete), so a folder may hold a higher number than a set handed out last.
A count, safe to call from any task: log_take() compares it with the set's own and walks the folder when it moved.