librsync  2.3.4
Typedefs | Functions
buf.h File Reference

Buffers that map between stdio file streams and librsync streams. More...

Include dependency graph for buf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct rs_filebuf rs_filebuf_t
 

Functions

rs_filebuf_trs_filebuf_new (FILE *f, size_t buf_len)
 
void rs_filebuf_free (rs_filebuf_t *fb)
 
rs_result rs_infilebuf_fill (rs_job_t *, rs_buffers_t *buf, void *fb)
 
rs_result rs_outfilebuf_drain (rs_job_t *, rs_buffers_t *, void *fb)
 

Detailed Description

Buffers that map between stdio file streams and librsync streams.

As the stream consumes input and produces output, it is refilled from appropriate input and output FILEs. A dynamically allocated buffer of configurable size is used as an intermediary.

Todo:
Perhaps be more efficient by filling the buffer on every call even if not yet completely empty. Check that it's really our buffer, and shuffle remaining data down to the front.
Todo:
Perhaps expose a routine for shuffling the buffers.

Definition in file buf.h.

Typedef Documentation

◆ rs_filebuf_t

typedef struct rs_filebuf rs_filebuf_t

Definition at line 40 of file buf.h.

Function Documentation

◆ rs_filebuf_new()

rs_filebuf_t * rs_filebuf_new ( FILE *  f,
size_t  buf_len 
)

Definition at line 43 of file buf.c.

◆ rs_filebuf_free()

void rs_filebuf_free ( rs_filebuf_t fb)

Definition at line 53 of file buf.c.

◆ rs_infilebuf_fill()

rs_result rs_infilebuf_fill ( rs_job_t job,
rs_buffers_t buf,
void *  fb 
)

Definition at line 63 of file buf.c.

◆ rs_outfilebuf_drain()

rs_result rs_outfilebuf_drain ( rs_job_t job,
rs_buffers_t buf,
void *  fb 
)

Definition at line 103 of file buf.c.