Mercurial > audlegacy-plugins
comparison src/wma/libffwma/file.c @ 1978:fa9f85cebade
s/vfs_/aud_vfs_/g
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Sun, 07 Oct 2007 00:25:33 -0500 |
parents | 2ebeb7816c5e |
children | 6e2070ea35e7 |
comparison
equal
deleted
inserted
replaced
1977:5a6b60ceaa0f | 1978:fa9f85cebade |
---|---|
29 static int file_open(URLContext *h, const char *filename, int flags) | 29 static int file_open(URLContext *h, const char *filename, int flags) |
30 { | 30 { |
31 VFSFile *file; | 31 VFSFile *file; |
32 | 32 |
33 if (flags & URL_WRONLY) { | 33 if (flags & URL_WRONLY) { |
34 file = vfs_fopen(filename, "wb"); | 34 file = aud_vfs_fopen(filename, "wb"); |
35 } else { | 35 } else { |
36 file = vfs_fopen(filename, "rb"); | 36 file = aud_vfs_fopen(filename, "rb"); |
37 } | 37 } |
38 | 38 |
39 if (file == NULL) | 39 if (file == NULL) |
40 return -ENOENT; | 40 return -ENOENT; |
41 h->priv_data = file; | 41 h->priv_data = file; |
44 | 44 |
45 static int file_read(URLContext *h, unsigned char *buf, int size) | 45 static int file_read(URLContext *h, unsigned char *buf, int size) |
46 { | 46 { |
47 VFSFile *file; | 47 VFSFile *file; |
48 file = h->priv_data; | 48 file = h->priv_data; |
49 return vfs_fread(buf, 1, size, file); | 49 return aud_vfs_fread(buf, 1, size, file); |
50 } | 50 } |
51 | 51 |
52 static int file_write(URLContext *h, unsigned char *buf, int size) | 52 static int file_write(URLContext *h, unsigned char *buf, int size) |
53 { | 53 { |
54 VFSFile *file; | 54 VFSFile *file; |
55 file = h->priv_data; | 55 file = h->priv_data; |
56 return vfs_fwrite(buf, 1, size, file); | 56 return aud_vfs_fwrite(buf, 1, size, file); |
57 } | 57 } |
58 | 58 |
59 /* XXX: use llseek */ | 59 /* XXX: use llseek */ |
60 static offset_t file_seek(URLContext *h, offset_t pos, int whence) | 60 static offset_t file_seek(URLContext *h, offset_t pos, int whence) |
61 { | 61 { |
62 int result = 0; | 62 int result = 0; |
63 VFSFile *file; | 63 VFSFile *file; |
64 file = h->priv_data; | 64 file = h->priv_data; |
65 result = vfs_fseek(file, pos, whence); | 65 result = aud_vfs_fseek(file, pos, whence); |
66 if (result == 0) | 66 if (result == 0) |
67 result = vfs_ftell(file); | 67 result = aud_vfs_ftell(file); |
68 else | 68 else |
69 result = -1; | 69 result = -1; |
70 return result; | 70 return result; |
71 } | 71 } |
72 | 72 |
73 static int file_close(URLContext *h) | 73 static int file_close(URLContext *h) |
74 { | 74 { |
75 VFSFile *file; | 75 VFSFile *file; |
76 file = h->priv_data; | 76 file = h->priv_data; |
77 return vfs_fclose(file); | 77 return aud_vfs_fclose(file); |
78 } | 78 } |
79 | 79 |
80 URLProtocol file_protocol = { | 80 URLProtocol file_protocol = { |
81 "file", | 81 "file", |
82 file_open, | 82 file_open, |