comparison libaudacious/vfs.h @ 1975:976da06332df trunk

[svn] - newvfs code, part 1
author nenolod
date Thu, 16 Nov 2006 11:20:07 -0800
parents 9f6c17f1cc93
children 93c59698f5fd
comparison
equal deleted inserted replaced
1974:9f6c17f1cc93 1975:976da06332df
22 22
23 #include <glib.h> 23 #include <glib.h>
24 #include <stdio.h> 24 #include <stdio.h>
25 25
26 typedef struct _VFSFile VFSFile; 26 typedef struct _VFSFile VFSFile;
27 typedef struct _VFSConstructor VFSConstructor;
28
29 struct _VFSFile {
30 gchar *uri;
31 gpointer handle;
32 VFSConstructor *base;
33 };
27 34
28 struct _VFSConstructor { 35 struct _VFSConstructor {
29 gchar *uri_id; 36 gchar *uri_id;
30 VFSFile *(*vfs_fopen_impl)(const gchar *path, 37 VFSFile *(*vfs_fopen_impl)(const gchar *path,
31 const gchar *mode); 38 const gchar *mode);
32 gint (*vfs_fclose_impl)(VFSFile * file); 39 gint (*vfs_fclose_impl)(VFSFile * file);
33 size_t (*vfs_fread_impl)(gpointer ptr, size_t size, 40 size_t (*vfs_fread_impl)(gpointer ptr, size_t size,
34 size_t nmemb, VFSFile *file); 41 size_t nmemb, VFSFile *file);
42 size_t (*vfs_fwrite_impl)(gconstpointer ptr, size_t size,
43 size_t nmemb, VFSFile *file);
44 gint (*vfs_getc_impl)(VFSFile *stream);
35 gint (*vfs_ungetc_impl)(gint c, VFSFile *stream); 45 gint (*vfs_ungetc_impl)(gint c, VFSFile *stream);
36 gint (*vfs_fseek_impl)(VFSFile *file, glong offset, gint whence); 46 gint (*vfs_fseek_impl)(VFSFile *file, glong offset, gint whence);
37 void (*vfs_rewind_impl)(VFSFile *file); 47 void (*vfs_rewind_impl)(VFSFile *file);
38 glong (*vfs_ftell_impl)(VFSFile *file); 48 glong (*vfs_ftell_impl)(VFSFile *file);
39 gboolean (*vfs_feof_impl)(VFSFile *file); 49 gboolean (*vfs_feof_impl)(VFSFile *file);
40 gboolean (*vfs_truncate_impl)(VFSFile *file, glong length); 50 gboolean (*vfs_truncate_impl)(VFSFile *file, glong length);
41 }; 51 };
42
43 typedef struct _VFSConstructor VFSConstructor;
44 52
45 G_BEGIN_DECLS 53 G_BEGIN_DECLS
46 54
47 /* Reserved for private use by BMP */ 55 /* Reserved for private use by BMP */
48 extern gboolean vfs_init(void); 56 extern gboolean vfs_init(void);