librsync  2.0.1
Functions
job.c File Reference

Generic state-machine interface. More...

Go to the source code of this file.

Functions

rs_job_trs_job_new (char const *job_name, rs_result(*statefn)(rs_job_t *))
 
void rs_job_check (rs_job_t *job)
 
rs_result rs_job_free (rs_job_t *job)
 Deallocate job state. More...
 
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). More...
 
const rs_stats_trs_job_statistics (rs_job_t *job)
 Return a pointer to the statistics in a job. More...
 
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. More...
 

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
Streaming jobs
rs_job_iter()
rs_job

Definition in file job.c.

Function Documentation

rs_result rs_job_free ( rs_job_t job)

Deallocate job state.

Definition at line 90 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
jobDescription of job state.
buffersPointer 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
Streaming jobs.

Definition at line 133 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 200 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 215 of file job.c.