Mercurial > audlegacy
annotate libaudacious/vfs.h @ 2059:8aaf0f145578 trunk
[svn] - documentation fixups
author | nenolod |
---|---|
date | Mon, 04 Dec 2006 18:30:58 -0800 |
parents | 93c59698f5fd |
children | 53a3d5db6b58 |
rev | line source |
---|---|
1974 | 1 /* |
2 * Audacious | |
3 * Copyright (c) 2006 Audacious team | |
4 * | |
5 * This program is free software; you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License as published by | |
7 * the Free Software Foundation; either version 2 of the License, or | |
8 * (at your option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with this program; if not, write to the Free Software | |
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
18 */ | |
19 | |
0 | 20 #ifndef VFS_H |
21 #define VFS_H | |
22 | |
23 #include <glib.h> | |
24 #include <stdio.h> | |
25 | |
26 typedef struct _VFSFile VFSFile; | |
1975 | 27 typedef struct _VFSConstructor VFSConstructor; |
28 | |
29 struct _VFSFile { | |
30 gchar *uri; | |
31 gpointer handle; | |
32 VFSConstructor *base; | |
33 }; | |
0 | 34 |
1974 | 35 struct _VFSConstructor { |
36 gchar *uri_id; | |
37 VFSFile *(*vfs_fopen_impl)(const gchar *path, | |
38 const gchar *mode); | |
39 gint (*vfs_fclose_impl)(VFSFile * file); | |
40 size_t (*vfs_fread_impl)(gpointer ptr, size_t size, | |
41 size_t nmemb, VFSFile *file); | |
1975 | 42 size_t (*vfs_fwrite_impl)(gconstpointer ptr, size_t size, |
43 size_t nmemb, VFSFile *file); | |
44 gint (*vfs_getc_impl)(VFSFile *stream); | |
1974 | 45 gint (*vfs_ungetc_impl)(gint c, VFSFile *stream); |
46 gint (*vfs_fseek_impl)(VFSFile *file, glong offset, gint whence); | |
47 void (*vfs_rewind_impl)(VFSFile *file); | |
48 glong (*vfs_ftell_impl)(VFSFile *file); | |
49 gboolean (*vfs_feof_impl)(VFSFile *file); | |
50 gboolean (*vfs_truncate_impl)(VFSFile *file, glong length); | |
51 }; | |
52 | |
0 | 53 G_BEGIN_DECLS |
54 | |
55 /* Reserved for private use by BMP */ | |
830 | 56 extern gboolean vfs_init(void); |
0 | 57 |
830 | 58 extern VFSFile * vfs_fopen(const gchar * path, |
0 | 59 const gchar * mode); |
830 | 60 extern gint vfs_fclose(VFSFile * file); |
0 | 61 |
830 | 62 extern size_t vfs_fread(gpointer ptr, |
0 | 63 size_t size, |
64 size_t nmemb, | |
65 VFSFile * file); | |
830 | 66 extern size_t vfs_fwrite(gconstpointer ptr, |
0 | 67 size_t size, |
68 size_t nmemb, | |
69 VFSFile *file); | |
70 | |
1683
e9c24e35bd76
[svn] - File stream API for audacious vfs; uses real getc/ungetc functions for vfs_stdio and emulated functions for vfs_gnome
giacomo
parents:
1669
diff
changeset
|
71 extern gint vfs_getc(VFSFile *stream); |
e9c24e35bd76
[svn] - File stream API for audacious vfs; uses real getc/ungetc functions for vfs_stdio and emulated functions for vfs_gnome
giacomo
parents:
1669
diff
changeset
|
72 extern gint vfs_ungetc(gint c, |
e9c24e35bd76
[svn] - File stream API for audacious vfs; uses real getc/ungetc functions for vfs_stdio and emulated functions for vfs_gnome
giacomo
parents:
1669
diff
changeset
|
73 VFSFile *stream); |
1617 | 74 extern gchar *vfs_fgets(gchar *s, |
75 gint n, | |
76 VFSFile *stream); | |
77 | |
830 | 78 extern gint vfs_fseek(VFSFile * file, |
0 | 79 glong offset, |
80 gint whence); | |
830 | 81 extern void vfs_rewind(VFSFile * file); |
82 extern glong vfs_ftell(VFSFile * file); | |
83 extern gboolean vfs_feof(VFSFile * file); | |
0 | 84 |
830 | 85 extern gboolean vfs_file_test(const gchar * path, |
0 | 86 GFileTest test); |
811
86ca43d8a845
[svn] - implement vfs_feof() and vfs_ftell() and update the scrobbler plugin to reflect that,
nenolod
parents:
0
diff
changeset
|
87 |
830 | 88 extern gboolean vfs_is_writeable(const gchar * path); |
0 | 89 |
830 | 90 extern gboolean vfs_truncate(VFSFile * file, glong length); |
0 | 91 |
1669
07143b97314d
[svn] fprintf implementation in the VFS common layer by Luca Barbato. Use it in the Container plugins.
chainsaw
parents:
1617
diff
changeset
|
92 extern int vfs_fprintf(VFSFile *stream, gchar const *format, ...) |
07143b97314d
[svn] fprintf implementation in the VFS common layer by Luca Barbato. Use it in the Container plugins.
chainsaw
parents:
1617
diff
changeset
|
93 __attribute__ ((__format__ (__printf__, 2, 3))); |
0 | 94 |
1997 | 95 extern gboolean vfs_register_transport(VFSConstructor *vtable); |
96 | |
0 | 97 G_END_DECLS |
98 | |
99 #endif /* VFS_H */ |