rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
fm_req.c File Reference

The runner of the FILES screen's requests on the card's task (fm_req.h). More...

#include "fm_req.h"
#include <string.h>

Data Structures

struct  info_walk_t
 What one walk of a folder counts for INFO. More...

Functions

static void info_take (const fm_dirent_t *e, void *vctx)
 Count one entry of a folder INFO looks into.
void fm_req_bench (const fm_req_t *req, fm_bench_t *live)
 The bench the rules read for req: live, the bench as it stands, with the log folders the request carries.
static void bench_now (const fm_req_t *req, const fm_runner_t *run, fm_bench_t *bench)
 The bench as it stands, with the request's log folders.
static fm_err_t info (fm_req_t *req, const fm_io_t *io)
 INFO: the entry's size and time; for a folder its entries and their bytes from one walk.
static fm_err_t job (fm_req_t *req, const fm_runner_t *run)
 JOB: the job stepped until it stops, the bench and CANCEL asked before each step.
fm_err_t fm_req_run (fm_req_t *req, const fm_runner_t *run)
 Answer req: every card call it needs, to its end.

Detailed Description

The runner of the FILES screen's requests on the card's task (fm_req.h).

SPDX-License-Identifier: MIT

Function Documentation

◆ bench_now()

void bench_now ( const fm_req_t * req,
const fm_runner_t * run,
fm_bench_t * bench )
static

The bench as it stands, with the request's log folders.

Parameters
reqthe request
runthe runner
benchtakes the bench

◆ fm_req_bench()

void fm_req_bench ( const fm_req_t * req,
fm_bench_t * live )

The bench the rules read for req: live, the bench as it stands, with the log folders the request carries.

Parameters
reqthe request
livethe bench now, filled by the runner's bench()

◆ fm_req_run()

fm_err_t fm_req_run ( fm_req_t * req,
const fm_runner_t * run )

Answer req: every card call it needs, to its end.

A JOB is stepped until it is no longer FM_JOB_RUNNING, with the bench and CANCEL asked before each step; its answer is FM_OK when it is FM_JOB_DONE and the job's err otherwise. A JOB that is not running when it arrives, a refusal of its start, keeps that answer.

Parameters
reqthe request
runthe card and the rest; run->io and run->bench set
Returns
the answer, also in req->err; FM_ERR_ARG for a NULL or an unknown kind

◆ info()

fm_err_t info ( fm_req_t * req,
const fm_io_t * io )
static

INFO: the entry's size and time; for a folder its entries and their bytes from one walk.

Parameters
reqthe request, which takes the answer
iothe card
Returns
FM_OK or why not

◆ info_take()

void info_take ( const fm_dirent_t * e,
void * vctx )
static

Count one entry of a folder INFO looks into.

Parameters
ethe entry, borrowed for the call
vctxthe walk's info_walk_t

◆ job()

fm_err_t job ( fm_req_t * req,
const fm_runner_t * run )
static

JOB: the job stepped until it stops, the bench and CANCEL asked before each step.

Parameters
reqthe request
runthe runner
Returns
FM_OK for a job done, else the job's err