Mercurial > audlegacy-plugins
comparison src/mms/mms.c @ 1978:fa9f85cebade
s/vfs_/aud_vfs_/g
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Sun, 07 Oct 2007 00:25:33 -0500 |
parents | e8ea3a76a84e |
children | 3134a0987162 |
comparison
equal
deleted
inserted
replaced
1977:5a6b60ceaa0f | 1978:fa9f85cebade |
---|---|
39 mms_t *mms; | 39 mms_t *mms; |
40 GSList *charstack; | 40 GSList *charstack; |
41 } MMSHandle; | 41 } MMSHandle; |
42 | 42 |
43 VFSFile * | 43 VFSFile * |
44 mms_vfs_fopen_impl(const gchar * path, | 44 mms_aud_vfs_fopen_impl(const gchar * path, |
45 const gchar * mode) | 45 const gchar * mode) |
46 { | 46 { |
47 VFSFile *file; | 47 VFSFile *file; |
48 MMSHandle *handle; | 48 MMSHandle *handle; |
49 | 49 |
70 | 70 |
71 return file; | 71 return file; |
72 } | 72 } |
73 | 73 |
74 gint | 74 gint |
75 mms_vfs_fclose_impl(VFSFile * file) | 75 mms_aud_vfs_fclose_impl(VFSFile * file) |
76 { | 76 { |
77 gint ret = 0; | 77 gint ret = 0; |
78 | 78 |
79 if (file == NULL) | 79 if (file == NULL) |
80 return -1; | 80 return -1; |
90 | 90 |
91 return ret; | 91 return ret; |
92 } | 92 } |
93 | 93 |
94 size_t | 94 size_t |
95 mms_vfs_fread_impl(gpointer ptr, | 95 mms_aud_vfs_fread_impl(gpointer ptr, |
96 size_t size, | 96 size_t size, |
97 size_t nmemb, | 97 size_t nmemb, |
98 VFSFile * file) | 98 VFSFile * file) |
99 { | 99 { |
100 MMSHandle *handle; | 100 MMSHandle *handle; |
115 | 115 |
116 return ret; | 116 return ret; |
117 } | 117 } |
118 | 118 |
119 size_t | 119 size_t |
120 mms_vfs_fwrite_impl(gconstpointer ptr, | 120 mms_aud_vfs_fwrite_impl(gconstpointer ptr, |
121 size_t size, | 121 size_t size, |
122 size_t nmemb, | 122 size_t nmemb, |
123 VFSFile * file) | 123 VFSFile * file) |
124 { | 124 { |
125 return -1; | 125 return -1; |
126 } | 126 } |
127 | 127 |
128 gint | 128 gint |
129 mms_vfs_getc_impl(VFSFile *stream) | 129 mms_aud_vfs_getc_impl(VFSFile *stream) |
130 { | 130 { |
131 MMSHandle *handle = (MMSHandle *) stream->handle; | 131 MMSHandle *handle = (MMSHandle *) stream->handle; |
132 guchar c; | 132 guchar c; |
133 | 133 |
134 if (handle->charstack != NULL) | 134 if (handle->charstack != NULL) |
145 | 145 |
146 return EOF; | 146 return EOF; |
147 } | 147 } |
148 | 148 |
149 gint | 149 gint |
150 mms_vfs_ungetc_impl(gint c, VFSFile *stream) | 150 mms_aud_vfs_ungetc_impl(gint c, VFSFile *stream) |
151 { | 151 { |
152 MMSHandle *handle = (MMSHandle *) stream->handle; | 152 MMSHandle *handle = (MMSHandle *) stream->handle; |
153 | 153 |
154 handle->charstack = g_slist_append(handle->charstack, GUINT_TO_POINTER(c)); | 154 handle->charstack = g_slist_append(handle->charstack, GUINT_TO_POINTER(c)); |
155 | 155 |
158 | 158 |
159 return EOF; | 159 return EOF; |
160 } | 160 } |
161 | 161 |
162 gint | 162 gint |
163 mms_vfs_fseek_impl(VFSFile * file, | 163 mms_aud_vfs_fseek_impl(VFSFile * file, |
164 glong offset, | 164 glong offset, |
165 gint whence) | 165 gint whence) |
166 { | 166 { |
167 return -1; | 167 return -1; |
168 } | 168 } |
169 | 169 |
170 void | 170 void |
171 mms_vfs_rewind_impl(VFSFile * file) | 171 mms_aud_vfs_rewind_impl(VFSFile * file) |
172 { | 172 { |
173 return; | 173 return; |
174 } | 174 } |
175 | 175 |
176 glong | 176 glong |
177 mms_vfs_ftell_impl(VFSFile * file) | 177 mms_aud_vfs_ftell_impl(VFSFile * file) |
178 { | 178 { |
179 MMSHandle *handle = (MMSHandle *) file->handle; | 179 MMSHandle *handle = (MMSHandle *) file->handle; |
180 | 180 |
181 return mms_get_current_pos(handle->mms); | 181 return mms_get_current_pos(handle->mms); |
182 } | 182 } |
183 | 183 |
184 gboolean | 184 gboolean |
185 mms_vfs_feof_impl(VFSFile * file) | 185 mms_aud_vfs_feof_impl(VFSFile * file) |
186 { | 186 { |
187 MMSHandle *handle = (MMSHandle *) file->handle; | 187 MMSHandle *handle = (MMSHandle *) file->handle; |
188 | 188 |
189 return (gboolean) (mms_get_current_pos(handle->mms) == | 189 return (gboolean) (mms_get_current_pos(handle->mms) == |
190 mms_get_length(handle->mms)); | 190 mms_get_length(handle->mms)); |
191 } | 191 } |
192 | 192 |
193 gint | 193 gint |
194 mms_vfs_truncate_impl(VFSFile * file, glong size) | 194 mms_aud_vfs_truncate_impl(VFSFile * file, glong size) |
195 { | 195 { |
196 return -1; | 196 return -1; |
197 } | 197 } |
198 | 198 |
199 off_t | 199 off_t |
200 mms_vfs_fsize_impl(VFSFile * file) | 200 mms_aud_vfs_fsize_impl(VFSFile * file) |
201 { | 201 { |
202 return -1; | 202 return -1; |
203 } | 203 } |
204 | 204 |
205 VFSConstructor mms_const = { | 205 VFSConstructor mms_const = { |
206 "mms://", | 206 "mms://", |
207 mms_vfs_fopen_impl, | 207 mms_aud_vfs_fopen_impl, |
208 mms_vfs_fclose_impl, | 208 mms_aud_vfs_fclose_impl, |
209 mms_vfs_fread_impl, | 209 mms_aud_vfs_fread_impl, |
210 mms_vfs_fwrite_impl, | 210 mms_aud_vfs_fwrite_impl, |
211 mms_vfs_getc_impl, | 211 mms_aud_vfs_getc_impl, |
212 mms_vfs_ungetc_impl, | 212 mms_aud_vfs_ungetc_impl, |
213 mms_vfs_fseek_impl, | 213 mms_aud_vfs_fseek_impl, |
214 mms_vfs_rewind_impl, | 214 mms_aud_vfs_rewind_impl, |
215 mms_vfs_ftell_impl, | 215 mms_aud_vfs_ftell_impl, |
216 mms_vfs_feof_impl, | 216 mms_aud_vfs_feof_impl, |
217 mms_vfs_truncate_impl, | 217 mms_aud_vfs_truncate_impl, |
218 mms_vfs_fsize_impl | 218 mms_aud_vfs_fsize_impl |
219 }; | 219 }; |
220 | 220 |
221 static void init(void) | 221 static void init(void) |
222 { | 222 { |
223 vfs_register_transport(&mms_const); | 223 aud_vfs_register_transport(&mms_const); |
224 } | 224 } |
225 | 225 |
226 static void cleanup(void) | 226 static void cleanup(void) |
227 { | 227 { |
228 #if 0 | 228 #if 0 |
229 vfs_unregister_transport(&mms_const); | 229 aud_vfs_unregister_transport(&mms_const); |
230 #endif | 230 #endif |
231 } | 231 } |
232 | 232 |
233 DECLARE_PLUGIN(mms, init, cleanup, NULL, NULL, NULL, NULL, NULL, NULL); | 233 DECLARE_PLUGIN(mms, init, cleanup, NULL, NULL, NULL, NULL, NULL, NULL); |