81#define FM_CHUNK 16384u
117typedef size_t (*
fm_fill_fn)(
void *ctx, uint64_t at, uint8_t *dst,
165 const char *src_dir,
const char *name,
166 const char *dst_dir);
181 const char *src_dir,
const char *name,
bool is_dir,
182 const char *dst_dir);
199 unsigned mount,
const char *dir,
const char *name,
200 bool is_dir,
const char *new_name);
213 unsigned mount,
const char *dir,
const char *name,
226 const char *dir,
const char *name);
238 unsigned mount,
const char *dir,
const char *name);
254 const char *dir,
const char *name, uint64_t len,
270 const char *dir,
const char *name, uint8_t *buf,
The card as the file manager's core sees it: a table of functions the caller supplies,...
fm_err_t
What a call of the core or of the card came to. FM_OK is 0; every other value is a refusal or a failu...
Definition fm_io.h:51
#define FM_PATH_SIZE
Room for a path and its terminator.
Definition fm_name.h:54
fm_err_t fm_job_copy(fm_job_t *job, const fm_bench_t *bench, unsigned mount, const char *src_dir, const char *name, const char *dst_dir)
Copy file name of folder src_dir into folder dst_dir under the same name.
Definition fm_ops.c:99
fm_job_state_t fm_job_state(const fm_job_t *job, uint64_t *done, uint64_t *total)
Where the job stands.
Definition fm_ops.c:820
fm_err_t fm_job_save(fm_job_t *job, const fm_bench_t *bench, unsigned mount, const char *dir, const char *name, uint64_t len, fm_fill_fn fill, void *fill_ctx)
Write len bytes from fill as file name of folder dir, through "<name>.NEW" (the file's comment).
Definition fm_ops.c:287
fm_err_t fm_job_load(fm_job_t *job, const fm_bench_t *bench, unsigned mount, const char *dir, const char *name, uint8_t *buf, size_t cap)
Read file name of folder dir into buf. A read: the gate does not stop it.
Definition fm_ops.c:315
fm_err_t fm_job_move(fm_job_t *job, const fm_bench_t *bench, unsigned mount, const char *src_dir, const char *name, bool is_dir, const char *dst_dir)
Move file or empty folder name of src_dir into dst_dir.
Definition fm_ops.c:162
fm_err_t fm_job_mkdir(fm_job_t *job, const fm_bench_t *bench, unsigned mount, const char *dir, const char *name)
Make folder name in folder dir.
Definition fm_ops.c:267
fm_err_t fm_job_create(fm_job_t *job, const fm_bench_t *bench, unsigned mount, const char *dir, const char *name)
Make the empty file name in folder dir.
Definition fm_ops.c:277
fm_err_t fm_job_delete(fm_job_t *job, const fm_bench_t *bench, unsigned mount, const char *dir, const char *name, bool is_dir)
Delete file or empty folder name of folder dir.
Definition fm_ops.c:215
void fm_job_cancel(fm_job_t *job)
Ask the job to stop at its next chunk. A single call that has started finishes.
Definition fm_ops.c:813
fm_err_t fm_job_rename(fm_job_t *job, const fm_bench_t *bench, unsigned mount, const char *dir, const char *name, bool is_dir, const char *new_name)
Give entry name of folder dir the name new_name.
Definition fm_ops.c:189
fm_job_state_t fm_job_step(fm_job_t *job, const fm_io_t *io, const fm_bench_t *bench, uint8_t *chunk, size_t size)
Run the job's next step.
Definition fm_ops.c:772
fm_job_state_t
Where a job stands.
Definition fm_ops.h:101
@ FM_JOB_DONE
Definition fm_ops.h:104
@ FM_JOB_STOPPED
Definition fm_ops.h:105
@ FM_JOB_IDLE
Definition fm_ops.h:102
@ FM_JOB_RUNNING
Definition fm_ops.h:103
@ FM_JOB_FAILED
Definition fm_ops.h:106
fm_job_kind_t
What a job does.
Definition fm_ops.h:86
size_t(*) fm_fill_fn(void *ctx, uint64_t at, uint8_t *dst, size_t cap)
The bytes a save writes, asked for one chunk at a time.
Definition fm_ops.h:117
What the file manager may do to a name: the places the bench keeps, the files the logger writes,...
The bench as the rules see it, filled by the caller each time it asks. Every pointer may be NULL.
Definition fm_rules.h:101
The card: every function set, each answering FM_OK or the reason it failed. ctx is passed to each of ...
Definition fm_io.h:117
One job. The fields are the job's; the screen reads them through fm_job_state().
Definition fm_ops.h:124
bool is_dir
Definition fm_ops.h:131
char tmp[FM_PATH_SIZE]
Definition fm_ops.h:138
fm_job_state_t state
Definition fm_ops.h:126
bool cancel
Definition fm_ops.h:130
fm_fill_fn fill
Definition fm_ops.h:144
unsigned mount
Definition fm_ops.h:129
char dst[FM_PATH_SIZE]
Definition fm_ops.h:137
bool dst_was
Definition fm_ops.h:133
uint8_t * buf
Definition fm_ops.h:146
uint64_t total
Definition fm_ops.h:143
fm_err_t err
Definition fm_ops.h:127
int step
Definition fm_ops.h:128
fm_job_kind_t kind
Definition fm_ops.h:125
void * out
Definition fm_ops.h:141
bool note_restart
Definition fm_ops.h:134
char src[FM_PATH_SIZE]
Definition fm_ops.h:136
size_t cap
Definition fm_ops.h:147
uint64_t done
Definition fm_ops.h:142
void * in
Definition fm_ops.h:140
void * fill_ctx
Definition fm_ops.h:145