annotate src/audacious/vfs_buffered_file.h @ 2861:7d3beedf1db8 trunk

BSD relicensing (pass 2).
author William Pitcock <nenolod@atheme.org>
date Sat, 23 Jun 2007 22:31:46 -0500
parents ea470384e752
children 51dda959be4d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2861
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
1 /*
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
2 * audacious: Cross-platform multimedia player.
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
3 * vfs_buffered_file.h: VFS Buffered I/O support.
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
4 *
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
5 * Copyright (c) 2005-2007 Audacious development team.
2341
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
6 *
2861
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
7 * Redistribution and use in source and binary forms, with or without
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
8 * modification, are permitted provided that the following conditions are
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
9 * met:
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
10 *
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
11 * 1. Redistributions of source code must retain the above copyright notice,
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
12 * this list of conditions and the following disclaimer.
2341
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
13 *
2861
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
14 * 2. Redistributions in binary form must reproduce the above copyright
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
15 * notice, this list of conditions and the following disclaimer in the
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
16 * documentation and/or other materials provided with the distribution.
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
17 *
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
18 * 3. The name of the author may not be used to endorse or promote products
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
19 * derived from this software without specific prior written permission.
2341
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
20 *
2861
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
24 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
7d3beedf1db8 BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents: 2589
diff changeset
31 * POSSIBILITY OF SUCH DAMAGE.
2341
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
32 */
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
33
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
34 #ifndef AUDACIOUS_VFS_BUFFERED_FILE_H
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
35 #define AUDACIOUS_VFS_BUFFERED_FILE_H
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
36
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
37 #include <glib.h>
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
38 #include "vfs.h"
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
39 #include "vfs_buffer.h"
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
40
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
41 G_BEGIN_DECLS
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
42
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
43 /**
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
44 * VFSBufferedFile:
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
45 * @fd: The VFS handle for the active FD.
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
46 * @buffer: The first 32kb read from the FD.
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
47 * @mem: The memory for the buffer.
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
48 * @which: Whether to use the live FD or the buffer.
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
49 *
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
50 * Private data for the VFS memorybuffer class.
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
51 **/
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
52
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
53 typedef struct {
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
54 VFSFile *fd;
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
55 VFSFile *buffer;
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
56 gchar *mem;
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
57 gboolean which;
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
58 } VFSBufferedFile;
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
59
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
60 /**
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
61 * vfs_buffered_file_new_from_uri:
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
62 * @uri: The location to read from.
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
63 *
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
64 * Creates a VFSBufferedFile. VFSBufferedFile is read-only.
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
65 *
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
66 * Return value: A VFSFile handle for the VFSBufferedFile.
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
67 **/
2430
4e2fc64d95ef [svn] - make vfs_buffered_file_new_from_uri declaration const
nenolod
parents: 2341
diff changeset
68 VFSFile *vfs_buffered_file_new_from_uri(const gchar *uri);
2341
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
69
2589
ea470384e752 [svn] - add vfs_buffered_file_release_live_fd().
nenolod
parents: 2430
diff changeset
70 VFSFile *vfs_buffered_file_release_live_fd(VFSFile *fd);
ea470384e752 [svn] - add vfs_buffered_file_release_live_fd().
nenolod
parents: 2430
diff changeset
71
ea470384e752 [svn] - add vfs_buffered_file_release_live_fd().
nenolod
parents: 2430
diff changeset
72
2341
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
73 G_END_DECLS
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
74
02a850a2533b [svn] - automatically buffering deriv-class of VFSFile. will be used to speed up probing of network sources.
nenolod
parents:
diff changeset
75 #endif