comparison src/audacious/vfs_buffered_file.h @ 2341:02a850a2533b trunk

[svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
author nenolod
date Mon, 15 Jan 2007 18:33:42 -0800
parents
children 4e2fc64d95ef
comparison
equal deleted inserted replaced
2340:eb71fec30e9a 2341:02a850a2533b
1 /* Audacious
2 * Copyright (c) 2006-2007 William Pitcock
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; under version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19 #ifndef AUDACIOUS_VFS_BUFFERED_FILE_H
20 #define AUDACIOUS_VFS_BUFFERED_FILE_H
21
22 #include <glib.h>
23 #include "vfs.h"
24 #include "vfs_buffer.h"
25
26 G_BEGIN_DECLS
27
28 /**
29 * VFSBufferedFile:
30 * @fd: The VFS handle for the active FD.
31 * @buffer: The first 32kb read from the FD.
32 * @mem: The memory for the buffer.
33 * @which: Whether to use the live FD or the buffer.
34 *
35 * Private data for the VFS memorybuffer class.
36 **/
37
38 typedef struct {
39 VFSFile *fd;
40 VFSFile *buffer;
41 gchar *mem;
42 gboolean which;
43 } VFSBufferedFile;
44
45 /**
46 * vfs_buffered_file_new_from_uri:
47 * @uri: The location to read from.
48 *
49 * Creates a VFSBufferedFile. VFSBufferedFile is read-only.
50 *
51 * Return value: A VFSFile handle for the VFSBufferedFile.
52 **/
53 VFSFile *vfs_buffered_file_new_from_uri(gchar *uri);
54
55 G_END_DECLS
56
57 #endif