annotate audacious/vfs_buffer.h @ 2304:b0e49d195c64 trunk

[svn] Fuck, I forgot to quote the $ in the commit msg, so my home was in the ChangeLog.
author js
date Tue, 09 Jan 2007 14:53:19 -0800
parents 329fb2453c87
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2068
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
1 /* Audacious
2253
329fb2453c87 [svn] More copyright notice updates
kiyoshi
parents: 2146
diff changeset
2 * Copyright (c) 2006-2007 William Pitcock
2068
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
3 *
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
2105
f18a5b617c34 [svn] - move to GPLv2-only. Based on my interpretation of the license, we are
nenolod
parents: 2075
diff changeset
6 * the Free Software Foundation; under version 2 of the License.
2068
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
7 *
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
8 * This program is distributed in the hope that it will be useful,
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
11 * GNU General Public License for more details.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
12 *
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
13 * You should have received a copy of the GNU General Public License
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
14 * along with this program; if not, write to the Free Software
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
16 * 02110-1301, USA.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
17 */
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
18
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
19 #ifndef AUDACIOUS_VFS_BUFFER_H
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
20 #define AUDACIOUS_VFS_BUFFER_H
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
21
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
22 #include <glib.h>
2075
2b93747d7b04 [svn] - build fix
yaz
parents: 2068
diff changeset
23 #include "vfs.h"
2068
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
24
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
25 G_BEGIN_DECLS
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
26
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
27 /**
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
28 * VFSBuffer:
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
29 * @data: The data inside the VFSBuffer.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
30 * @iter: The current position of the VFS buffer iterator.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
31 * @begin: The beginning of the memory segment that the VFS buffer uses.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
32 * @end: The end of the memory segment that the VFS buffer uses.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
33 * @size: The size of the memory segment.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
34 *
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
35 * Private data for the VFS memorybuffer class.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
36 **/
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
37
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
38 typedef struct {
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
39 guchar *data;
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
40 guchar *iter;
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
41 guchar *end;
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
42 gsize size;
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
43 } VFSBuffer;
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
44
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
45 /**
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
46 * vfs_buffer_new:
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
47 * @data: Pointer to data to use.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
48 * @size: Size of data to use.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
49 *
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
50 * Creates a VFS buffer for reading/writing to a memory segment.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
51 *
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
52 * Return value: A VFSFile handle for the memory segment's stream
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
53 * representation.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
54 **/
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
55 VFSFile *vfs_buffer_new(gpointer data, gsize size);
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
56
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
57 /**
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
58 * vfs_buffer_new_from_string:
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
59 * @str: String to use.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
60 *
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
61 * Creates a VFS buffer for reading/writing to a string.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
62 *
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
63 * Return value: A VFSFile handle for the memory segment's stream
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
64 * representation.
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
65 **/
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
66 VFSFile *vfs_buffer_new_from_string(gchar *str);
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
67
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
68 G_END_DECLS
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
69
31b5c59ed31b [svn] - add VFSBuffer, equivilant to fmemopen().
nenolod
parents:
diff changeset
70 #endif