47#define LOG_TAKE_TRIES 3u
83 bool (*
exists)(
void *
ctx,
const char *dir,
const char *name);
90 bool (*
create)(
void *
ctx,
const char *dir,
const char *name,
int number);
105#define LOG_SERIES_SLOTS 2
The folders of the panel's SD (Secure Digital) card, and the files in them with a fixed name.
#define CARD_DIR_MAX
Room for a folder path and its terminator: two folders of 8 characters and the "/" between them are 1...
Definition card_tree.h:113
Run log names on the card, and which entries a bounded list keeps.
log_prefix_t
Which writer a run's name says made it.
Definition log_name.h:83
void log_series_init(log_series_set_t *set)
Every folder's numbering forgotten: the next take walks its folder.
Definition log_take.c:18
void(*) log_take_visit_fn(const char *name, void *visit_ctx)
Receives one directory entry's name; it does not outlive the call.
Definition log_take.h:52
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_...
Definition log_take.c:43
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 ...
Definition log_take.c:199
void log_series_forget_all(void)
Every set forgets every folder's numbering before its next take: the card's files were changed by ano...
Definition log_take.c:25
#define LOG_SERIES_SLOTS
The folders a run can be written to: the auto logs' and the user's.
Definition log_take.h:105
log_take_t
What a take came to.
Definition log_take.h:167
@ LOG_TAKE_NO_FOLDER
Definition log_take.h:171
@ LOG_TAKE_ARG
Definition log_take.h:169
@ LOG_TAKE_FULL
Definition log_take.h:173
@ LOG_TAKE_UNREADABLE
Definition log_take.h:172
@ LOG_TAKE_NO_CARD
Definition log_take.h:170
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,...
Definition log_take.c:54
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 ...
Definition log_take.c:134
The files the logger has open, each with the folder it is in: the automatic log's run in run_dir,...
Definition log_take.h:203
unsigned run
Definition log_take.h:205
const char * run_dir
Definition log_take.h:204
const char * test_dir
Definition log_take.h:206
unsigned txt
Definition log_take.h:208
unsigned test
Definition log_take.h:207
Numbering of the folders a run can be written to.
Definition log_take.h:108
unsigned evict
Definition log_take.h:110
log_series_t slot[LOG_SERIES_SLOTS]
Definition log_take.h:109
unsigned edits
Definition log_take.h:111
One folder's numbering.
Definition log_take.h:96
char dir[CARD_DIR_MAX]
Definition log_take.h:97
bool numbered
Definition log_take.h:99
int next
Definition log_take.h:98
The card. dir is a path from the root, CARD_ROOT the root itself.
Definition log_take.h:59
bool(*) make_dir(void *ctx, const char *dir)
Make dir a folder.
Definition log_take.h:71
bool(*) exists(void *ctx, const char *dir, const char *name)
Whether dir holds an entry named name, in any case.
Definition log_take.h:83
void * ctx
Definition log_take.h:60
bool(*) mounted(void *ctx)
Whether a card is mounted.
Definition log_take.h:64
bool(*) create(void *ctx, const char *dir, const char *name, int number)
Create name in dir as the file of run number and keep it open for the caller.
Definition log_take.h:90
bool(*) walk(void *ctx, const char *dir, log_take_visit_fn visit, void *visit_ctx)
Hand the name of every entry of dir, files and folders, to visit.
Definition log_take.h:78