Mercurial > audlegacy
annotate src/audacious/vfs_buffer.h @ 2861:7d3beedf1db8 trunk
BSD relicensing (pass 2).
| author | William Pitcock <nenolod@atheme.org> |
|---|---|
| date | Sat, 23 Jun 2007 22:31:46 -0500 |
| parents | 3149d4b1a9a9 |
| children | 51dda959be4d |
| rev | line source |
|---|---|
|
2861
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
1 /* |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
2 * audacious: Cross-platform multimedia player. |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
3 * vfs_buffer.h: VFS operations on blocks of memory. |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
4 * |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
5 * Copyright (c) 2005-2007 Audacious development team. |
| 2313 | 6 * |
|
2861
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
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:
2313
diff
changeset
|
8 * modification, are permitted provided that the following conditions are |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
9 * met: |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
10 * |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
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:
2313
diff
changeset
|
12 * this list of conditions and the following disclaimer. |
| 2313 | 13 * |
|
2861
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
14 * 2. Redistributions in binary form must reproduce the above copyright |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
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:
2313
diff
changeset
|
16 * documentation and/or other materials provided with the distribution. |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
17 * |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
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:
2313
diff
changeset
|
19 * derived from this software without specific prior written permission. |
| 2313 | 20 * |
|
2861
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
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:
2313
diff
changeset
|
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
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:
2313
diff
changeset
|
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
diff
changeset
|
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
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:
2313
diff
changeset
|
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
|
7d3beedf1db8
BSD relicensing (pass 2).
William Pitcock <nenolod@atheme.org>
parents:
2313
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:
2313
diff
changeset
|
31 * POSSIBILITY OF SUCH DAMAGE. |
| 2313 | 32 */ |
| 33 | |
| 34 #ifndef AUDACIOUS_VFS_BUFFER_H | |
| 35 #define AUDACIOUS_VFS_BUFFER_H | |
| 36 | |
| 37 #include <glib.h> | |
| 38 #include "vfs.h" | |
| 39 | |
| 40 G_BEGIN_DECLS | |
| 41 | |
| 42 /** | |
| 43 * VFSBuffer: | |
| 44 * @data: The data inside the VFSBuffer. | |
| 45 * @iter: The current position of the VFS buffer iterator. | |
| 46 * @begin: The beginning of the memory segment that the VFS buffer uses. | |
| 47 * @end: The end of the memory segment that the VFS buffer uses. | |
| 48 * @size: The size of the memory segment. | |
| 49 * | |
| 50 * Private data for the VFS memorybuffer class. | |
| 51 **/ | |
| 52 | |
| 53 typedef struct { | |
| 54 guchar *data; | |
| 55 guchar *iter; | |
| 56 guchar *end; | |
| 57 gsize size; | |
| 58 } VFSBuffer; | |
| 59 | |
| 60 /** | |
| 61 * vfs_buffer_new: | |
| 62 * @data: Pointer to data to use. | |
| 63 * @size: Size of data to use. | |
| 64 * | |
| 65 * Creates a VFS buffer for reading/writing to a memory segment. | |
| 66 * | |
| 67 * Return value: A VFSFile handle for the memory segment's stream | |
| 68 * representation. | |
| 69 **/ | |
| 70 VFSFile *vfs_buffer_new(gpointer data, gsize size); | |
| 71 | |
| 72 /** | |
| 73 * vfs_buffer_new_from_string: | |
| 74 * @str: String to use. | |
| 75 * | |
| 76 * Creates a VFS buffer for reading/writing to a string. | |
| 77 * | |
| 78 * Return value: A VFSFile handle for the memory segment's stream | |
| 79 * representation. | |
| 80 **/ | |
| 81 VFSFile *vfs_buffer_new_from_string(gchar *str); | |
| 82 | |
| 83 G_END_DECLS | |
| 84 | |
| 85 #endif |
