$treeview $search $mathjax $extrastylesheet
librsync  2.0.2
$projectbrief
$projectbrief
$searchbox

job.c File Reference

Generic state-machine interface. More...

Go to the source code of this file.

Functions

static rs_result rs_job_work (rs_job_t *job, rs_buffers_t *buffers)
rs_job_trs_job_new (char const *job_name, rs_result(*statefn)(rs_job_t *))
rs_result rs_job_free (rs_job_t *job)
 Deallocate job state.
static rs_result rs_job_complete (rs_job_t *job, rs_result result)
rs_result rs_job_iter (rs_job_t *job, rs_buffers_t *buffers)
 Run a rs_job state machine until it blocks (RS_BLOCKED), returns an error, or completes (RS_DONE).
const rs_stats_trs_job_statistics (rs_job_t *job)
 Return a pointer to the statistics in a job.
int rs_job_input_is_ending (rs_job_t *job)
rs_result rs_job_drive (rs_job_t *job, rs_buffers_t *buf, rs_driven_cb in_cb, void *in_opaque, rs_driven_cb out_cb, void *out_opaque)
 Actively process a job, by making callbacks to fill and empty the buffers until the job is done.

Detailed Description

Generic state-machine interface.

The point of this is that we need to be able to suspend and resume processing at any point at which the buffers may block.

See also:
api_streaming
rs_job_iter()
rs_job

Definition in file job.c.


Function Documentation

rs_result rs_job_free ( rs_job_t  ) 

Deallocate job state.

Definition at line 69 of file job.c.

rs_result rs_job_iter ( rs_job_t job,
rs_buffers_t buffers 
)

Run a rs_job state machine until it blocks (RS_BLOCKED), returns an error, or completes (RS_DONE).

Parameters:
job Description of job state.
buffers Pointer to structure describing input and output buffers.
Returns:
The rs_result that caused iteration to stop.

buffers->eof_in should be true if there is no more data after what's in the input buffer. The final block checksum will run across whatever's in there, without trying to accumulate anything else.

See also:
api_streaming

Definition at line 96 of file job.c.

const rs_stats_t* rs_job_statistics ( rs_job_t job  ) 

Return a pointer to the statistics in a job.

Definition at line 145 of file job.c.

rs_result rs_job_drive ( rs_job_t job,
rs_buffers_t buf,
rs_driven_cb  in_cb,
void *  in_opaque,
rs_driven_cb  out_cb,
void *  out_opaque 
)

Actively process a job, by making callbacks to fill and empty the buffers until the job is done.

Definition at line 155 of file job.c.