librsync  2.3.4
buf.h
Go to the documentation of this file.
1 /*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*-
2  *
3  * librsync -- the library for network deltas
4  *
5  * Copyright (C) 2000, 2001 by Martin Pool <mbp@sourcefrog.net>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this program; if not, write to the Free Software
19  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 
22 /** \file buf.h
23  * Buffers that map between stdio file streams and librsync streams.
24  *
25  * As the stream consumes input and produces output, it is refilled from
26  * appropriate input and output FILEs. A dynamically allocated buffer of
27  * configurable size is used as an intermediary.
28  *
29  * \todo Perhaps be more efficient by filling the buffer on every call even if
30  * not yet completely empty. Check that it's really our buffer, and shuffle
31  * remaining data down to the front.
32  *
33  * \todo Perhaps expose a routine for shuffling the buffers. */
34 #ifndef BUF_H
35 # define BUF_H
36 
37 # include <stdio.h>
38 # include "librsync.h"
39 
40 typedef struct rs_filebuf rs_filebuf_t;
41 
42 rs_filebuf_t *rs_filebuf_new(FILE *f, size_t buf_len);
43 
44 void rs_filebuf_free(rs_filebuf_t *fb);
45 
46 rs_result rs_infilebuf_fill(rs_job_t *, rs_buffers_t *buf, void *fb);
47 
48 rs_result rs_outfilebuf_drain(rs_job_t *, rs_buffers_t *, void *fb);
49 
50 #endif /* !BUF_H */
Description of input and output buffers.
Definition: librsync.h:328
Definition: buf.c:37
Public header for librsync.
rs_result
Return codes from nonblocking rsync operations.
Definition: librsync.h:180
The contents of this structure are private.
Definition: job.h:47