# HG changeset patch # User William Pitcock # Date 1191734733 18000 # Node ID fa9f85cebade8f77bb6bfa933a8aab00b9115bb7 # Parent 5a6b60ceaa0f0243e77f464725210ac059558e60 s/vfs_/aud_vfs_/g diff -r 5a6b60ceaa0f -r fa9f85cebade src/OSS4/configure.c --- a/src/OSS4/configure.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/OSS4/configure.c Sun Oct 07 00:25:33 2007 -0500 @@ -101,8 +101,8 @@ menu = gtk_menu_new(); - if ((file = vfs_fopen("/dev/sndstat", "r"))) { - while (vfs_fgets(buffer, 255, file)) { + if ((file = aud_vfs_fopen("/dev/sndstat", "r"))) { + while (aud_vfs_fgets(buffer, 255, file)) { if (found && buffer[0] == '\n') break; if (buffer[strlen(buffer) - 1] == '\n') @@ -132,7 +132,7 @@ found = 1; } - vfs_fclose(file); + aud_vfs_fclose(file); } else { item = gtk_menu_item_new_with_label(_("Default")); diff -r 5a6b60ceaa0f -r fa9f85cebade src/aac/libmp4.c --- a/src/aac/libmp4.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/aac/libmp4.c Sun Oct 07 00:25:33 2007 -0500 @@ -16,7 +16,7 @@ #define MP4_VERSION VERSION #define SBR_DEC -extern VFSFile *vfs_buffered_file_new_from_uri(gchar *uri); +extern VFSFile *aud_vfs_buffered_file_new_from_uri(gchar *uri); /* * BUFFER_SIZE is the highest amount of memory that can be pulled. @@ -62,7 +62,7 @@ .get_song_info = mp4_get_song_title_len, .get_song_tuple = mp4_get_song_tuple, .is_our_file_from_vfs = mp4_is_our_fd, - .vfs_extensions = fmts, + .aud_vfs_extensions = fmts, }; InputPlugin *mp4_iplist[] = { &mp4_ip, NULL }; @@ -90,7 +90,7 @@ if (data == NULL || buffer == NULL) return -1; - return vfs_fread(buffer, 1, len, (VFSFile *) data); + return aud_vfs_fread(buffer, 1, len, (VFSFile *) data); } static guint32 mp4_seek_callback(void *data, guint64 pos) @@ -98,7 +98,7 @@ if (data == NULL) return -1; - return vfs_fseek((VFSFile *) data, pos, SEEK_SET); + return aud_vfs_fseek((VFSFile *) data, pos, SEEK_SET); } static void mp4_init(void) @@ -162,28 +162,28 @@ off_t init, probed; static guchar buf[8]; - init = probed = vfs_ftell(stream); + init = probed = aud_vfs_ftell(stream); while(probed-init <= 32768 && cnt < 8) { c = 0; while(probed-init <= 32768 && c != 0xFF) { - c = vfs_getc(stream); + c = aud_vfs_getc(stream); if(c < 0) return FALSE; - probed = vfs_ftell(stream); + probed = aud_vfs_ftell(stream); } buf[0] = 0xFF; - if(vfs_fread(&(buf[1]), 1, 7, stream) < 7) + if(aud_vfs_fread(&(buf[1]), 1, 7, stream) < 7) return FALSE; len = aac_parse_frame(buf, &srate, &num); if(len > 0) { cnt++; - vfs_fseek(stream, len - 8, SEEK_CUR); + aud_vfs_fseek(stream, len - 8, SEEK_CUR); } - probed = vfs_ftell(stream); + probed = aud_vfs_ftell(stream); } if(cnt < 8) @@ -227,15 +227,15 @@ memset(magic, '\0', 8); extension = strrchr(filename, '.'); - if ((file = vfs_fopen(filename, "rb"))) { - vfs_fread(magic, 1, 8, file); - vfs_rewind(file); + if ((file = aud_vfs_fopen(filename, "rb"))) { + aud_vfs_fread(magic, 1, 8, file); + aud_vfs_rewind(file); if (parse_aac_stream(file) == TRUE) { - vfs_fclose(file); + aud_vfs_fclose(file); return TRUE; } if (!memcmp(magic, "ID3", 3)) { // ID3 tag bolted to the front, obfuscated magic bytes - vfs_fclose(file); + aud_vfs_fclose(file); if (extension &&( !strcasecmp(extension, ".mp4") || // official extension !strcasecmp(extension, ".m4a") || // Apple mp4 extension @@ -246,10 +246,10 @@ return 0; } if (!memcmp(&magic[4], "ftyp", 4)) { - vfs_fclose(file); + aud_vfs_fclose(file); return 1; } - vfs_fclose(file); + aud_vfs_fclose(file); } return 0; } @@ -260,8 +260,8 @@ gchar magic[8]; extension = strrchr(filename, '.'); - vfs_fread(magic, 1, 8, file); - vfs_rewind(file); + aud_vfs_fread(magic, 1, 8, file); + aud_vfs_rewind(file); if (parse_aac_stream(file) == TRUE) return 1; if (!memcmp(&magic[4], "ftyp", 4)) @@ -325,17 +325,17 @@ { g_free(mp4cb); - aud_tuple_associate_string(ti, FIELD_TITLE, NULL, vfs_get_metadata(mp4fh, "track-name")); - aud_tuple_associate_string(ti, FIELD_ALBUM, NULL, vfs_get_metadata(mp4fh, "stream-name")); + aud_tuple_associate_string(ti, FIELD_TITLE, NULL, aud_vfs_get_metadata(mp4fh, "track-name")); + aud_tuple_associate_string(ti, FIELD_ALBUM, NULL, aud_vfs_get_metadata(mp4fh, "stream-name")); aud_tuple_associate_string(ti, FIELD_CODEC, NULL, "Advanced Audio Coding (AAC)"); aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy"); - vfs_fclose(mp4fh); + aud_vfs_fclose(mp4fh); return ti; } - vfs_rewind(mp4fh); + aud_vfs_rewind(mp4fh); mp4cb->read = mp4_read_callback; mp4cb->seek = mp4_seek_callback; @@ -343,7 +343,7 @@ if (!(mp4file = mp4ff_open_read(mp4cb))) { g_free(mp4cb); - vfs_fclose(mp4fh); + aud_vfs_fclose(mp4fh); } else { gint mp4track= getAACTrack(mp4file); gint numSamples = mp4ff_num_samples(mp4file, mp4track); @@ -426,7 +426,7 @@ aud_tuple_associate_string(ti, FIELD_QUALITY, NULL, "lossy"); free (mp4cb); - vfs_fclose(mp4fh); + aud_vfs_fclose(mp4fh); } return ti; @@ -439,7 +439,7 @@ gboolean remote = str_has_prefix_nocase(filename, "http:") || str_has_prefix_nocase(filename, "https:"); - mp4fh = remote ? vfs_buffered_file_new_from_uri(filename) : vfs_fopen(filename, "rb"); + mp4fh = remote ? aud_vfs_buffered_file_new_from_uri(filename) : aud_vfs_fopen(filename, "rb"); tuple = mp4_get_song_aud_tuple_base(filename, mp4fh); @@ -629,18 +629,18 @@ gboolean remote = str_has_prefix_nocase(filename, "http:") || str_has_prefix_nocase(filename, "https:"); - vfs_rewind(file); + aud_vfs_rewind(file); if((decoder = faacDecOpen()) == NULL){ g_print("AAC: Open Decoder Error\n"); - vfs_fclose(file); + aud_vfs_fclose(file); buffer_playing = FALSE; playback->playing = 0; g_static_mutex_unlock(&mutex); return; } - if((buffervalid = vfs_fread(streambuffer, 1, BUFFER_SIZE, file))==0){ + if((buffervalid = aud_vfs_fread(streambuffer, 1, BUFFER_SIZE, file))==0){ g_print("AAC: Error reading file\n"); - vfs_fclose(file); + aud_vfs_fclose(file); buffer_playing = FALSE; playback->playing = 0; faacDecClose(decoder); @@ -650,15 +650,15 @@ if(!strncmp((char*)streambuffer, "ID3", 3)){ gint size = 0; - vfs_fseek(file, 0, SEEK_SET); + aud_vfs_fseek(file, 0, SEEK_SET); size = (streambuffer[6]<<21) | (streambuffer[7]<<14) | (streambuffer[8]<<7) | streambuffer[9]; size+=10; - vfs_fread(streambuffer, 1, size, file); - buffervalid = vfs_fread(streambuffer, 1, BUFFER_SIZE, file); + aud_vfs_fread(streambuffer, 1, size, file); + buffervalid = aud_vfs_fread(streambuffer, 1, BUFFER_SIZE, file); } - ttemp = vfs_get_metadata(file, "stream-name"); + ttemp = aud_vfs_get_metadata(file, "stream-name"); if (ttemp != NULL) { @@ -672,7 +672,7 @@ if(bufferconsumed) { buffervalid -= bufferconsumed; memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid); - buffervalid += vfs_fread(&streambuffer[buffervalid], 1, + buffervalid += aud_vfs_fread(&streambuffer[buffervalid], 1, BUFFER_SIZE-buffervalid, file); bufferconsumed = 0; } @@ -688,7 +688,7 @@ if(playback->output->open_audio(FMT_S16_NE,samplerate,channels) == FALSE){ g_print("AAC: Output Error\n"); faacDecClose(decoder); - vfs_fclose(file); + aud_vfs_fclose(file); playback->output->close_audio(); g_free(xmmstitle); buffer_playing = FALSE; @@ -710,14 +710,14 @@ { buffervalid -= bufferconsumed; memmove(streambuffer, &streambuffer[bufferconsumed], buffervalid); - buffervalid += vfs_fread(&streambuffer[buffervalid], 1, + buffervalid += aud_vfs_fread(&streambuffer[buffervalid], 1, BUFFER_SIZE-buffervalid, file); bufferconsumed = 0; - ttemp = vfs_get_metadata(file, "stream-name"); + ttemp = aud_vfs_get_metadata(file, "stream-name"); if (ttemp != NULL) - stemp = vfs_get_metadata(file, "track-name"); + stemp = aud_vfs_get_metadata(file, "track-name"); if (stemp != NULL) { @@ -754,7 +754,7 @@ memmove(streambuffer, &streambuffer[1], buffervalid); if(buffervalid < BUFFER_SIZE) { buffervalid += - vfs_fread(&streambuffer[buffervalid], 1, BUFFER_SIZE-buffervalid, file); + aud_vfs_fread(&streambuffer[buffervalid], 1, BUFFER_SIZE-buffervalid, file); } bufferconsumed = aac_probe(streambuffer, buffervalid); if(bufferconsumed) { @@ -782,7 +782,7 @@ playback->playing = 0; faacDecClose(decoder); g_free(xmmstitle); - vfs_fclose(file); + aud_vfs_fclose(file); seekPosition = -1; buffer_playing = FALSE; @@ -800,7 +800,7 @@ InputPlayback *playback = args; char *filename = playback->filename; - mp4fh = vfs_buffered_file_new_from_uri(filename); + mp4fh = aud_vfs_buffered_file_new_from_uri(filename); g_static_mutex_lock(&mutex); seekPosition= -1; @@ -813,10 +813,10 @@ ret = parse_aac_stream(mp4fh); if( ret == TRUE ) - vfs_fseek(mp4fh, 0, SEEK_SET); + aud_vfs_fseek(mp4fh, 0, SEEK_SET); else { - vfs_fclose(mp4fh); - mp4fh = vfs_fopen(filename, "rb"); + aud_vfs_fclose(mp4fh); + mp4fh = aud_vfs_fopen(filename, "rb"); } mp4cb->read = mp4_read_callback; diff -r 5a6b60ceaa0f -r fa9f85cebade src/adplug/adplug-xmms.cc --- a/src/adplug/adplug-xmms.cc Sun Oct 07 00:23:19 2007 -0500 +++ b/src/adplug/adplug-xmms.cc Sun Oct 07 00:25:33 2007 -0500 @@ -94,7 +94,7 @@ static InputPlayback *playback; // XXX: this function is not in the public API yet. -extern "C" VFSFile * vfs_buffered_file_new_from_uri (gchar * uri); +extern "C" VFSFile * aud_vfs_buffered_file_new_from_uri (gchar * uri); /***** Debugging *****/ @@ -508,7 +508,7 @@ adplug_info_box (char *filename) { CSilentopl tmpopl; - VFSFile *fd = vfs_buffered_file_new_from_uri (filename); + VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename); if (!fd) return; @@ -681,7 +681,7 @@ adplug_get_tuple (char *filename) { CSilentopl tmpopl; - VFSFile *fd = vfs_buffered_file_new_from_uri (filename); + VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename); if (!fd) return NULL; @@ -760,7 +760,7 @@ // we use VfsBufferedFile class here because adplug does a lot of // probing. a short delay before probing begins is better than // a lot of delay during probing. - VFSFile *fd = vfs_buffered_file_new_from_uri (playback->filename); + VFSFile *fd = aud_vfs_buffered_file_new_from_uri (playback->filename); if (!fd) { @@ -888,7 +888,7 @@ free (sndbuf); plr.playing = false; // important! XMMS won't get a self-ended song without it. dbg_printf (".\n"); - vfs_fclose (fd); + aud_vfs_fclose (fd); return (NULL); } @@ -921,7 +921,7 @@ adplug_is_our_file (char *filename) { CSilentopl tmpopl; - VFSFile *fd = vfs_buffered_file_new_from_uri (filename); + VFSFile *fd = aud_vfs_buffered_file_new_from_uri (filename); if (!fd) return FALSE; diff -r 5a6b60ceaa0f -r fa9f85cebade src/adplug/core/adplug.cxx --- a/src/adplug/core/adplug.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/adplug/core/adplug.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -149,7 +149,7 @@ if (fp.extension (fd->uri, (*i)->get_extension (j))) { AdPlug_LogWrite ("Trying direct hit: %s\n", (*i)->filetype.c_str ()); - vfs_rewind (fd); + aud_vfs_rewind (fd); if ((p = (*i)->factory (opl))) if (p->load (fd, fp)) { diff -r 5a6b60ceaa0f -r fa9f85cebade src/adplug/core/adtrack.cxx --- a/src/adplug/core/adtrack.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/adplug/core/adtrack.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -70,12 +70,12 @@ AdPlug_LogWrite ("CadtrackLoader::load(,\"%s\"): Checking for \"%s\"...\n", filename.c_str (), instfilename.c_str ()); - VFSFile *instfd = vfs_fopen (instfilename.c_str (), "rb"); + VFSFile *instfd = aud_vfs_fopen (instfilename.c_str (), "rb"); instf = fp.open (instfd); if (!instf || fp.filesize (instf) != 468) { fp.close (f); - vfs_fclose (instfd); + aud_vfs_fclose (instfd); return false; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/adplug/core/binio_virtual.h --- a/src/adplug/core/binio_virtual.h Sun Oct 07 00:23:19 2007 -0500 +++ b/src/adplug/core/binio_virtual.h Sun Oct 07 00:25:33 2007 -0500 @@ -27,24 +27,24 @@ }; vfsistream(const char *file) { - this->fd = vfs_fopen(file, "rb"); + this->fd = aud_vfs_fopen(file, "rb"); }; vfsistream(std::string &file) { - this->fd = vfs_fopen(file.c_str(), "rb"); + this->fd = aud_vfs_fopen(file.c_str(), "rb"); }; void open(const char *file) { - this->fd = vfs_fopen(file, "rb"); + this->fd = aud_vfs_fopen(file, "rb"); }; void open(std::string &file) { - this->fd = vfs_fopen(file.c_str(), "rb"); + this->fd = aud_vfs_fopen(file.c_str(), "rb"); }; // XXX: this sucks because binio won't let us do sanity checking Byte getByte(void) { - int c = vfs_getc(this->fd); + int c = aud_vfs_getc(this->fd); if (c == EOF) err |= Eof; @@ -55,21 +55,21 @@ switch (offs) { case Add: - vfs_fseek(this->fd, pos, SEEK_CUR); + aud_vfs_fseek(this->fd, pos, SEEK_CUR); break; case End: - vfs_fseek(this->fd, pos, SEEK_END); + aud_vfs_fseek(this->fd, pos, SEEK_END); break; case Set: default: - vfs_fseek(this->fd, pos, SEEK_SET); + aud_vfs_fseek(this->fd, pos, SEEK_SET); break; } } long pos(void) { - return vfs_ftell(this->fd); + return aud_vfs_ftell(this->fd); } }; @@ -87,45 +87,45 @@ }; vfsostream(const char *file) { - this->fd = vfs_fopen(file, "wb"); + this->fd = aud_vfs_fopen(file, "wb"); }; vfsostream(std::string &file) { - this->fd = vfs_fopen(file.c_str(), "wb"); + this->fd = aud_vfs_fopen(file.c_str(), "wb"); }; void open(const char *file) { - this->fd = vfs_fopen(file, "wb"); + this->fd = aud_vfs_fopen(file, "wb"); }; void open(std::string &file) { - this->fd = vfs_fopen(file.c_str(), "wb"); + this->fd = aud_vfs_fopen(file.c_str(), "wb"); }; // XXX: this sucks because binio won't let us do sanity checking void putByte(Byte b) { - vfs_fwrite(&b, 1, 1, this->fd); + aud_vfs_fwrite(&b, 1, 1, this->fd); }; void seek(long pos, Offset offs = Set) { switch (offs) { case Add: - vfs_fseek(this->fd, pos, SEEK_CUR); + aud_vfs_fseek(this->fd, pos, SEEK_CUR); break; case End: - vfs_fseek(this->fd, pos, SEEK_END); + aud_vfs_fseek(this->fd, pos, SEEK_END); break; case Set: default: - vfs_fseek(this->fd, pos, SEEK_SET); + aud_vfs_fseek(this->fd, pos, SEEK_SET); break; } } long pos(void) { - return vfs_ftell(this->fd); + return aud_vfs_ftell(this->fd); } }; diff -r 5a6b60ceaa0f -r fa9f85cebade src/adplug/core/ksm.cxx --- a/src/adplug/core/ksm.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/adplug/core/ksm.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -67,7 +67,7 @@ break; strcpy (fn + i + 1, "insts.dat"); AdPlug_LogWrite ("Instruments file: \"%s\"\n", fn); - VFSFile *instfd = vfs_fopen (fn, "rb"); + VFSFile *instfd = aud_vfs_fopen (fn, "rb"); f = fp.open (instfd); delete[]fn; if (!f) @@ -78,7 +78,7 @@ } loadinsts (f); fp.close (f); - vfs_fclose (instfd); + aud_vfs_fclose (instfd); f = fp.open (fd); if (!f) diff -r 5a6b60ceaa0f -r fa9f85cebade src/adplug/core/mid.cxx --- a/src/adplug/core/mid.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/adplug/core/mid.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -214,12 +214,12 @@ } sprintf (pfilename + j + 3, "patch.003"); - VFSFile *instfd = vfs_fopen (pfilename, "rb"); + VFSFile *instfd = aud_vfs_fopen (pfilename, "rb"); f = fp.open (instfd); free (pfilename); if (!f) { - vfs_fclose (instfd); + aud_vfs_fclose (instfd); return false; } @@ -259,7 +259,7 @@ } fp.close (f); - vfs_fclose (instfd); + aud_vfs_fclose (instfd); memcpy (smyinsbank, myinsbank, 128 * 16); return true; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/adplug/core/rol.cxx --- a/src/adplug/core/rol.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/adplug/core/rol.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -469,7 +469,7 @@ bool CrolPlayer::load_voice_data( binistream *f, std::string const &bnk_filename, const CFileProvider &fp ) { SBnkHeader bnk_header; - VFSFile *fd = vfs_fopen(bnk_filename.c_str(), "rb"); + VFSFile *fd = aud_vfs_fopen(bnk_filename.c_str(), "rb"); binistream *bnk_file = fp.open(fd); if( bnk_file ) @@ -492,7 +492,7 @@ } fp.close(bnk_file); - vfs_fclose(fd); + aud_vfs_fclose(fd); return true; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/alac/plugin.c --- a/src/alac/plugin.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/alac/plugin.c Sun Oct 07 00:25:33 2007 -0500 @@ -148,14 +148,14 @@ VFSFile *input_file; stream_t *input_stream; - input_file = vfs_fopen(filename, "rb"); + input_file = aud_vfs_fopen(filename, "rb"); input_stream = stream_create_file(input_file, 1); set_endian(); if (!input_stream) { - vfs_fclose(input_file); + aud_vfs_fclose(input_file); return NULL; } @@ -164,12 +164,12 @@ if (!qtmovie_read(input_stream, &demux_res)) { stream_destroy(input_stream); - vfs_fclose(input_file); + aud_vfs_fclose(input_file); return NULL; } stream_destroy(input_stream); - vfs_fclose(input_file); + aud_vfs_fclose(input_file); return build_aud_tuple_from_demux(&demux_res, filename); } @@ -303,7 +303,7 @@ .seek = seek, .get_song_tuple = build_tuple, .is_our_file_from_vfs = is_our_fd, - .vfs_extensions = fmts, + .aud_vfs_extensions = fmts, }; InputPlugin *alac_iplist[] = { &alac_ip, NULL }; @@ -323,7 +323,7 @@ set_endian(); - input_file = vfs_fopen((char *) args, "rb"); + input_file = aud_vfs_fopen((char *) args, "rb"); input_stream = stream_create_file(input_file, 1); if (!input_stream) @@ -359,7 +359,7 @@ stream_destroy(input_stream); if (input_opened) - vfs_fclose(input_file); + aud_vfs_fclose(input_file); playback->output->close_audio(); diff -r 5a6b60ceaa0f -r fa9f85cebade src/alac/stream.c --- a/src/alac/stream.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/alac/stream.c Sun Oct 07 00:25:33 2007 -0500 @@ -71,8 +71,8 @@ { size_t ret; - ret = vfs_fread(buf, 4, size >> 2, stream->f) * 4; - ret += vfs_fread((char*)buf + ret, 1, size - ret, stream->f); + ret = aud_vfs_fread(buf, 4, size >> 2, stream->f) * 4; + ret += aud_vfs_fread((char*)buf + ret, 1, size - ret, stream->f); if (ret == 0 && size != 0) stream->eof = 1; } @@ -142,7 +142,7 @@ void stream_skip(stream_t *stream, size_t skip) { - if (vfs_fseek(stream->f, (long)skip, SEEK_CUR) == 0) return; + if (aud_vfs_fseek(stream->f, (long)skip, SEEK_CUR) == 0) return; if (errno == ESPIPE) { char *buffer = malloc(skip); @@ -158,12 +158,12 @@ long stream_tell(stream_t *stream) { - return vfs_ftell(stream->f); /* returns -1 on error */ + return aud_vfs_ftell(stream->f); /* returns -1 on error */ } int stream_setpos(stream_t *stream, long pos) { - return vfs_fseek(stream->f, pos, SEEK_SET); + return aud_vfs_fseek(stream->f, pos, SEEK_SET); } stream_t *stream_create_file(VFSFile *file, diff -r 5a6b60ceaa0f -r fa9f85cebade src/amidi-plug/amidi-plug.h --- a/src/amidi-plug/amidi-plug.h Sun Oct 07 00:23:19 2007 -0500 +++ b/src/amidi-plug/amidi-plug.h Sun Oct 07 00:25:33 2007 -0500 @@ -63,7 +63,7 @@ 0 /* ap_opts_lyrics_extract */ }; -gchar *amidiplug_vfs_extensions[] = { "mid" , "midi" , "rmi" , "rmid" , NULL }; +gchar *amidiplug_aud_vfs_extensions[] = { "mid" , "midi" , "rmi" , "rmid" , NULL }; gpointer amidiplug_play_loop( gpointer ); gpointer amidiplug_audio_loop( gpointer ); @@ -102,7 +102,7 @@ .get_song_info = amidiplug_get_song_info, /* get_song_info */ .file_info_box = amidiplug_file_info_box, /* file_info_box */ .is_our_file_from_vfs = amidiplug_is_our_file_from_vfs, /* is_our_file_from_vfs */ - .vfs_extensions = amidiplug_vfs_extensions /* vfs_extensions */ + .aud_vfs_extensions = amidiplug_aud_vfs_extensions /* aud_vfs_extensions */ }; #endif /* !_I_AMIDIPLUG_H */ diff -r 5a6b60ceaa0f -r fa9f85cebade src/amidi-plug/i_vfslayer.h --- a/src/amidi-plug/i_vfslayer.h Sun Oct 07 00:23:19 2007 -0500 +++ b/src/amidi-plug/i_vfslayer.h Sun Oct 07 00:25:33 2007 -0500 @@ -26,13 +26,13 @@ #include -#define VFS_FOPEN( x , y ) vfs_fopen( x , y ) -#define VFS_FCLOSE( x ) vfs_fclose( x ) -#define VFS_FREAD( x , y , z , w ) vfs_fread( x , y , z , w ) -#define VFS_FSEEK( x , y , z ) vfs_fseek( x , y , z ) -#define VFS_FEOF( x ) vfs_feof( x ) -#define VFS_GETC( x ) vfs_getc( x ) -#define VFS_UNGETC( x , y ) vfs_ungetc( x , y ) +#define VFS_FOPEN( x , y ) aud_vfs_fopen( x , y ) +#define VFS_FCLOSE( x ) aud_vfs_fclose( x ) +#define VFS_FREAD( x , y , z , w ) aud_vfs_fread( x , y , z , w ) +#define VFS_FSEEK( x , y , z ) aud_vfs_fseek( x , y , z ) +#define VFS_FEOF( x ) aud_vfs_feof( x ) +#define VFS_GETC( x ) aud_vfs_getc( x ) +#define VFS_UNGETC( x , y ) aud_vfs_ungetc( x , y ) #endif /* !_I_VFSLAYER_H */ diff -r 5a6b60ceaa0f -r fa9f85cebade src/console/Audacious_Driver.cxx --- a/src/console/Audacious_Driver.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/console/Audacious_Driver.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -84,7 +84,7 @@ ~File_Handler(); private: char header [4]; - Vfs_File_Reader vfs_in; + Vfs_File_Reader aud_vfs_in; Gzip_Reader in; }; @@ -117,12 +117,12 @@ // open vfs if ( fd ) - vfs_in.reset( fd ); - else if ( log_err( vfs_in.open( path ) ) ) + aud_vfs_in.reset( fd ); + else if ( log_err( aud_vfs_in.open( path ) ) ) return; // now open gzip_reader on top of vfs - if ( log_err( in.open( &vfs_in ) ) ) + if ( log_err( in.open( &aud_vfs_in ) ) ) return; // read and identify header @@ -165,7 +165,7 @@ // files can be closed now in.close(); - vfs_in.close(); + aud_vfs_in.close(); log_warning( emu ); @@ -485,7 +485,7 @@ if (!is_our_file_from_vfs(filename, fd)) return NULL; - vfs_rewind(fd); + aud_vfs_rewind(fd); return get_song_tuple(filename); } diff -r 5a6b60ceaa0f -r fa9f85cebade src/console/Vfs_File.cxx --- a/src/console/Vfs_File.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/console/Vfs_File.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -13,7 +13,7 @@ Vfs_File_Reader::error_t Vfs_File_Reader::open( const char* path ) { close(); - file_ = owned_file_ = vfs_fopen( path, "rb" ); + file_ = owned_file_ = aud_vfs_fopen( path, "rb" ); if ( !file_ ) return "Couldn't open file"; return 0; @@ -22,27 +22,27 @@ long Vfs_File_Reader::size() const { long pos = tell(); - vfs_fseek( file_, 0, SEEK_END ); + aud_vfs_fseek( file_, 0, SEEK_END ); long result = tell(); - vfs_fseek( file_, pos, SEEK_SET ); + aud_vfs_fseek( file_, pos, SEEK_SET ); return result; } long Vfs_File_Reader::read_avail( void* p, long s ) { - return (long) vfs_fread( p, 1, s, file_ ); + return (long) aud_vfs_fread( p, 1, s, file_ ); } long Vfs_File_Reader::tell() const { - return vfs_ftell( file_ ); + return aud_vfs_ftell( file_ ); } Vfs_File_Reader::error_t Vfs_File_Reader::seek( long n ) { if ( n == 0 ) // optimization - vfs_rewind( file_ ); - else if ( vfs_fseek( file_, n, SEEK_SET ) != 0 ) + aud_vfs_rewind( file_ ); + else if ( aud_vfs_fseek( file_, n, SEEK_SET ) != 0 ) return eof_error; return 0; } @@ -52,7 +52,7 @@ file_ = 0; if ( owned_file_ ) { - vfs_fclose( owned_file_ ); + aud_vfs_fclose( owned_file_ ); owned_file_ = 0; } } diff -r 5a6b60ceaa0f -r fa9f85cebade src/console/abstract_file.cxx --- a/src/console/abstract_file.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/console/abstract_file.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -143,7 +143,7 @@ error_t Std_File_Reader::open( const char* path ) { - file_ = vfs_fopen( path, "rb" ); + file_ = aud_vfs_fopen( path, "rb" ); if ( !file_ ) RAISE_ERROR( "Couldn't open file" ); return NULL; @@ -152,23 +152,23 @@ long Std_File_Reader::size() const { long pos = tell(); - vfs_fseek( file_, 0, SEEK_END ); + aud_vfs_fseek( file_, 0, SEEK_END ); long result = tell(); - vfs_fseek( file_, pos, SEEK_SET ); + aud_vfs_fseek( file_, pos, SEEK_SET ); return result; } long Std_File_Reader::read_avail( void* p, long s ) { - return (long) vfs_fread( p, 1, s, file_ ); + return (long) aud_vfs_fread( p, 1, s, file_ ); } long Std_File_Reader::tell() const { - return vfs_ftell( file_ ); + return aud_vfs_ftell( file_ ); } error_t Std_File_Reader::seek( long n ) { - if ( vfs_fseek( file_, n, SEEK_SET ) != 0 ) + if ( aud_vfs_fseek( file_, n, SEEK_SET ) != 0 ) RAISE_ERROR( "Error seeking in file" ); return NULL; } @@ -176,7 +176,7 @@ void Std_File_Reader::close() { if ( file_ ) { - vfs_fclose( file_ ); + aud_vfs_fclose( file_ ); file_ = NULL; } } @@ -192,7 +192,7 @@ error_t Std_File_Writer::open( const char* path ) { - file_ = vfs_fopen( path, "wb" ); + file_ = aud_vfs_fopen( path, "wb" ); if ( !file_ ) RAISE_ERROR( "Couldn't open file for writing" ); @@ -204,7 +204,7 @@ error_t Std_File_Writer::write( const void* p, long s ) { - long result = (long) vfs_fwrite( p, 1, s, file_ ); + long result = (long) aud_vfs_fwrite( p, 1, s, file_ ); if ( result != s ) RAISE_ERROR( "Couldn't write to file" ); return NULL; @@ -213,7 +213,7 @@ void Std_File_Writer::close() { if ( file_ ) { - vfs_fclose( file_ ); + aud_vfs_fclose( file_ ); file_ = NULL; } } diff -r 5a6b60ceaa0f -r fa9f85cebade src/cue/cuesheet.c --- a/src/cue/cuesheet.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/cue/cuesheet.c Sun Oct 07 00:25:33 2007 -0500 @@ -458,7 +458,7 @@ cur_cue_track = track; cache_cue_file(path2); //path2 should be uri. - if (cue_file == NULL || !vfs_file_test(cue_file, G_FILE_TEST_EXISTS)) + if (cue_file == NULL || !aud_vfs_file_test(cue_file, G_FILE_TEST_EXISTS)) return; pr = input_check_file(cue_file, FALSE); @@ -749,7 +749,7 @@ static void cache_cue_file(char *f) { - VFSFile *file = vfs_fopen(f, "rb"); + VFSFile *file = aud_vfs_fopen(f, "rb"); gchar line[MAX_CUE_LINE_LENGTH+1]; if(!file) @@ -759,8 +759,8 @@ gint p; gint q; - if (vfs_fgets(line, MAX_CUE_LINE_LENGTH+1, file) == NULL) { - vfs_fclose(file); + if (aud_vfs_fgets(line, MAX_CUE_LINE_LENGTH+1, file) == NULL) { + aud_vfs_fclose(file); return; } @@ -847,7 +847,7 @@ } } - vfs_fclose(file); + aud_vfs_fclose(file); } static void fix_cue_argument(char *line) diff -r 5a6b60ceaa0f -r fa9f85cebade src/curl/curl.c --- a/src/curl/curl.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/curl/curl.c Sun Oct 07 00:25:33 2007 -0500 @@ -102,22 +102,22 @@ CurlOptions curl_options; -void curl_vfs_rewind_impl(VFSFile * file); -glong curl_vfs_ftell_impl(VFSFile * file); -gboolean curl_vfs_feof_impl(VFSFile * file); -gint curl_vfs_truncate_impl(VFSFile * file, glong size); -gchar *curl_vfs_metadata_impl(VFSFile * file, const gchar * field); -size_t curl_vfs_fwrite_impl(gconstpointer ptr, size_t size, +void curl_aud_vfs_rewind_impl(VFSFile * file); +glong curl_aud_vfs_ftell_impl(VFSFile * file); +gboolean curl_aud_vfs_feof_impl(VFSFile * file); +gint curl_aud_vfs_truncate_impl(VFSFile * file, glong size); +gchar *curl_aud_vfs_metadata_impl(VFSFile * file, const gchar * field); +size_t curl_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file); -size_t curl_vfs_fread_impl(gpointer ptr_, size_t size, +size_t curl_aud_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile * file); -gint curl_vfs_fclose_impl(VFSFile * file); -gint curl_vfs_getc_impl(VFSFile *stream); -gint curl_vfs_ungetc_impl(gint c, VFSFile *stream); -gint curl_vfs_fseek_impl(VFSFile * file, glong offset, gint whence); -VFSFile *curl_vfs_fopen_impl(const gchar * path, +gint curl_aud_vfs_fclose_impl(VFSFile * file); +gint curl_aud_vfs_getc_impl(VFSFile *stream); +gint curl_aud_vfs_ungetc_impl(gint c, VFSFile *stream); +gint curl_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence); +VFSFile *curl_aud_vfs_fopen_impl(const gchar * path, const gchar * mode); VFSConstructor curl_const; @@ -350,7 +350,7 @@ handle->wr_abs += trans; if (handle->download) { - vfs_fwrite(ptr + ret, trans, 1, handle->download); + aud_vfs_fwrite(ptr + ret, trans, 1, handle->download); } if (handle->icy_interval && !handle->icy_left) { @@ -448,7 +448,7 @@ // the data which has to go into the // beginning of the file must be at the end // of the input that we've dealt with. - vfs_fwrite(ptr + ret - leftover, leftover, 1, + aud_vfs_fwrite(ptr + ret - leftover, leftover, 1, handle->download); } handle->icy_left = handle->icy_interval; @@ -560,7 +560,7 @@ } VFSFile * -curl_vfs_fopen_impl(const gchar * path, +curl_aud_vfs_fopen_impl(const gchar * path, const gchar * mode) { CurlHandle *handle; @@ -663,7 +663,7 @@ curl_easy_setopt(handle->curl, CURLOPT_HTTPHEADER, hdr); } - //handle->download = vfs_fopen(FILENAME, "wb"); + //handle->download = aud_vfs_fopen(FILENAME, "wb"); file->handle = handle; file->base = &curl_const; @@ -675,7 +675,7 @@ } gint -curl_vfs_fclose_impl(VFSFile * file) +curl_aud_vfs_fclose_impl(VFSFile * file) { gint ret = 0; if (file == NULL) @@ -712,7 +712,7 @@ if (handle->download) { - vfs_fclose(handle->download); + aud_vfs_fclose(handle->download); } if (handle->url != NULL) @@ -725,7 +725,7 @@ } size_t -curl_vfs_fread_impl(gpointer ptr_, +curl_aud_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile * file) @@ -802,7 +802,7 @@ } size_t -curl_vfs_fwrite_impl(gconstpointer ptr, +curl_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file) @@ -811,7 +811,7 @@ } gint -curl_vfs_getc_impl(VFSFile *stream) +curl_aud_vfs_getc_impl(VFSFile *stream) { CurlHandle *handle = (CurlHandle *) stream->handle; guchar uc; @@ -825,13 +825,13 @@ handle->rd_abs++; return uc; } - else if (curl_vfs_fread_impl(&uc, 1, 1, stream) != 1) + else if (curl_aud_vfs_fread_impl(&uc, 1, 1, stream) != 1) return EOF; return uc; } gint -curl_vfs_ungetc_impl(gint c, VFSFile *stream) +curl_aud_vfs_ungetc_impl(gint c, VFSFile *stream) { CurlHandle *handle = (CurlHandle *) stream->handle; @@ -848,7 +848,7 @@ } gint -curl_vfs_fseek_impl(VFSFile * file, +curl_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence) { @@ -927,33 +927,33 @@ } void -curl_vfs_rewind_impl(VFSFile * file) +curl_aud_vfs_rewind_impl(VFSFile * file) { - curl_vfs_fseek_impl(file, 0, SEEK_SET); + curl_aud_vfs_fseek_impl(file, 0, SEEK_SET); } glong -curl_vfs_ftell_impl(VFSFile * file) +curl_aud_vfs_ftell_impl(VFSFile * file) { CurlHandle *handle = file->handle; return handle->rd_abs; } gboolean -curl_vfs_feof_impl(VFSFile * file) +curl_aud_vfs_feof_impl(VFSFile * file) { CurlHandle *handle = file->handle; return handle->rd_abs == handle->length; } gint -curl_vfs_truncate_impl(VFSFile * file, glong size) +curl_aud_vfs_truncate_impl(VFSFile * file, glong size) { return -1; } off_t -curl_vfs_fsize_impl(VFSFile * file) +curl_aud_vfs_fsize_impl(VFSFile * file) { CurlHandle *handle = file->handle; @@ -987,7 +987,7 @@ } gchar * -curl_vfs_metadata_impl(VFSFile * file, const gchar * field) +curl_aud_vfs_metadata_impl(VFSFile * file, const gchar * field) { CurlHandle *handle = file->handle; if (!strcmp(field, "stream-name") && handle->name != NULL) @@ -1009,36 +1009,36 @@ VFSConstructor curl_const = { "http://", - curl_vfs_fopen_impl, - curl_vfs_fclose_impl, - curl_vfs_fread_impl, - curl_vfs_fwrite_impl, - curl_vfs_getc_impl, - curl_vfs_ungetc_impl, - curl_vfs_fseek_impl, - curl_vfs_rewind_impl, - curl_vfs_ftell_impl, - curl_vfs_feof_impl, - curl_vfs_truncate_impl, - curl_vfs_fsize_impl, - curl_vfs_metadata_impl + curl_aud_vfs_fopen_impl, + curl_aud_vfs_fclose_impl, + curl_aud_vfs_fread_impl, + curl_aud_vfs_fwrite_impl, + curl_aud_vfs_getc_impl, + curl_aud_vfs_ungetc_impl, + curl_aud_vfs_fseek_impl, + curl_aud_vfs_rewind_impl, + curl_aud_vfs_ftell_impl, + curl_aud_vfs_feof_impl, + curl_aud_vfs_truncate_impl, + curl_aud_vfs_fsize_impl, + curl_aud_vfs_metadata_impl }; VFSConstructor curl_https_const = { "https://", - curl_vfs_fopen_impl, - curl_vfs_fclose_impl, - curl_vfs_fread_impl, - curl_vfs_fwrite_impl, - curl_vfs_getc_impl, - curl_vfs_ungetc_impl, - curl_vfs_fseek_impl, - curl_vfs_rewind_impl, - curl_vfs_ftell_impl, - curl_vfs_feof_impl, - curl_vfs_truncate_impl, - curl_vfs_fsize_impl, - curl_vfs_metadata_impl + curl_aud_vfs_fopen_impl, + curl_aud_vfs_fclose_impl, + curl_aud_vfs_fread_impl, + curl_aud_vfs_fwrite_impl, + curl_aud_vfs_getc_impl, + curl_aud_vfs_ungetc_impl, + curl_aud_vfs_fseek_impl, + curl_aud_vfs_rewind_impl, + curl_aud_vfs_ftell_impl, + curl_aud_vfs_feof_impl, + curl_aud_vfs_truncate_impl, + curl_aud_vfs_fsize_impl, + curl_aud_vfs_metadata_impl }; static void curl_load_settings(void) @@ -1075,16 +1075,16 @@ static void init(void) { curl_load_settings(); - vfs_register_transport(&curl_const); - vfs_register_transport(&curl_https_const); + aud_vfs_register_transport(&curl_const); + aud_vfs_register_transport(&curl_https_const); } static void cleanup(void) { curl_save_settings(); #if 0 - vfs_unregister_transport(&curl_const); - vfs_unregister_transport(&curl_https_const); + aud_vfs_unregister_transport(&curl_const); + aud_vfs_unregister_transport(&curl_https_const); #endif } diff -r 5a6b60ceaa0f -r fa9f85cebade src/daap/daap.c --- a/src/daap/daap.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/daap/daap.c Sun Oct 07 00:25:33 2007 -0500 @@ -306,7 +306,7 @@ -VFSFile * daap_vfs_fopen_impl(const gchar * path, const gchar * mode) +VFSFile * daap_aud_vfs_fopen_impl(const gchar * path, const gchar * mode) { VFSFile *file=NULL; daap_handle_t *handle = g_new0(daap_handle_t, 1); @@ -330,7 +330,7 @@ if (handle->fd < 0) { - g_print("vfs_fopen got a negative FD \n"); + g_print("aud_vfs_fopen got a negative FD \n"); g_free(file); file = NULL; } @@ -339,7 +339,7 @@ return file; } -gint daap_vfs_fclose_impl(VFSFile * file) +gint daap_aud_vfs_fclose_impl(VFSFile * file) { gint ret=0; daap_handle_t * handle = (daap_handle_t *)file->handle; @@ -363,7 +363,7 @@ return -1; } -size_t daap_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file) +size_t daap_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file) { daap_handle_t *handle= (daap_handle_t *)file->handle; size_t ret=0; @@ -378,12 +378,12 @@ return 0; } -size_t daap_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file) +size_t daap_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file) { return -1; } -gint daap_vfs_getc_impl(VFSFile * file) +gint daap_aud_vfs_getc_impl(VFSFile * file) { guchar ret=EOF; daap_handle_t *handle = (daap_handle_t *)file->handle; @@ -401,44 +401,44 @@ } } -gint daap_vfs_fseek_impl(VFSFile * file, glong offset, gint whence) +gint daap_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence) { return -1; } -gint daap_vfs_ungetc_impl(gint c, VFSFile * stream) +gint daap_aud_vfs_ungetc_impl(gint c, VFSFile * stream) { return c; } -void daap_vfs_rewind_impl(VFSFile * stream) +void daap_aud_vfs_rewind_impl(VFSFile * stream) { return; } -glong daap_vfs_ftell_impl(VFSFile * stream) +glong daap_aud_vfs_ftell_impl(VFSFile * stream) { daap_handle_t *handle=stream->handle; return handle->pos; } -gboolean daap_vfs_feof_impl(VFSFile * file) +gboolean daap_aud_vfs_feof_impl(VFSFile * file) { daap_handle_t *handle=file->handle; - off_t at = daap_vfs_ftell_impl(file); + off_t at = daap_aud_vfs_ftell_impl(file); return (gboolean) (at >= handle->length) ? TRUE : FALSE; } -gint daap_vfs_truncate_impl(VFSFile * file, glong size) +gint daap_aud_vfs_truncate_impl(VFSFile * file, glong size) { return -1; } -off_t daap_vfs_fsize_impl(VFSFile * file) +off_t daap_aud_vfs_fsize_impl(VFSFile * file) { return 0; } -gchar *daap_vfs_metadata_impl(VFSFile * file, const gchar * field) +gchar *daap_aud_vfs_metadata_impl(VFSFile * file, const gchar * field) { daap_handle_t *handle; g_print("Requested metadata: '%s' \n",field); @@ -462,26 +462,26 @@ VFSConstructor daap_const = { "daap://", - daap_vfs_fopen_impl, - daap_vfs_fclose_impl, - daap_vfs_fread_impl, - daap_vfs_fwrite_impl, - daap_vfs_getc_impl, - daap_vfs_ungetc_impl, - daap_vfs_fseek_impl, - daap_vfs_rewind_impl, - daap_vfs_ftell_impl, - daap_vfs_feof_impl, - daap_vfs_truncate_impl, - daap_vfs_fsize_impl, - daap_vfs_metadata_impl + daap_aud_vfs_fopen_impl, + daap_aud_vfs_fclose_impl, + daap_aud_vfs_fread_impl, + daap_aud_vfs_fwrite_impl, + daap_aud_vfs_getc_impl, + daap_aud_vfs_ungetc_impl, + daap_aud_vfs_fseek_impl, + daap_aud_vfs_rewind_impl, + daap_aud_vfs_ftell_impl, + daap_aud_vfs_feof_impl, + daap_aud_vfs_truncate_impl, + daap_aud_vfs_fsize_impl, + daap_aud_vfs_metadata_impl }; static void init(void) { mutex_init = g_mutex_new(); mutex_discovery = g_mutex_new(); - vfs_register_transport(&daap_const); + aud_vfs_register_transport(&daap_const); daap_mdns_initialize (); if (!login_sessions) login_sessions = g_hash_table_new (g_str_hash, g_str_equal); diff -r 5a6b60ceaa0f -r fa9f85cebade src/filewriter/filewriter.c --- a/src/filewriter/filewriter.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/filewriter/filewriter.c Sun Oct 07 00:25:33 2007 -0500 @@ -244,7 +244,7 @@ g_free(filename); filename = temp; - output_file = vfs_fopen(filename, "w"); + output_file = aud_vfs_fopen(filename, "w"); g_free(filename); if (!output_file) @@ -328,7 +328,7 @@ if (output_file) { written = 0; - vfs_fclose(output_file); + aud_vfs_fclose(output_file); } output_file = NULL; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/filewriter/flac.c --- a/src/filewriter/flac.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/filewriter/flac.c Sun Oct 07 00:25:33 2007 -0500 @@ -51,7 +51,7 @@ static FLAC__StreamEncoderWriteStatus flac_write_cb(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, gpointer data) { - written += vfs_fwrite(buffer, bytes, 1, (VFSFile *) data); + written += aud_vfs_fwrite(buffer, bytes, 1, (VFSFile *) data); return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; } @@ -61,7 +61,7 @@ { VFSFile *file = (VFSFile *) data; - if (vfs_fseek(file, absolute_byte_offset, SEEK_SET) < 0) + if (aud_vfs_fseek(file, absolute_byte_offset, SEEK_SET) < 0) return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR; return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; @@ -72,7 +72,7 @@ { VFSFile *file = (VFSFile *) data; - *absolute_byte_offset = vfs_ftell(file); + *absolute_byte_offset = aud_vfs_ftell(file); return FLAC__STREAM_ENCODER_TELL_STATUS_OK; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/filewriter/mp3.c --- a/src/filewriter/mp3.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/filewriter/mp3.c Sun Oct 07 00:25:33 2007 -0500 @@ -299,7 +299,7 @@ ENCBUFFER_SIZE); } - vfs_fwrite(encbuffer, 1, encout, output_file); + aud_vfs_fwrite(encbuffer, 1, encout, output_file); written += encout; olen += length; } @@ -309,7 +309,7 @@ if (output_file) { encout = lame_encode_flush_nogap(gfp, encbuffer, ENCBUFFER_SIZE); - vfs_fwrite(encbuffer, 1, encout, output_file); + aud_vfs_fwrite(encbuffer, 1, encout, output_file); // lame_mp3_tags_fid(gfp, output_file); // will erase id3v2 tag?? diff -r 5a6b60ceaa0f -r fa9f85cebade src/filewriter/vorbis.c --- a/src/filewriter/vorbis.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/filewriter/vorbis.c Sun Oct 07 00:25:33 2007 -0500 @@ -140,8 +140,8 @@ if (result == 0) break; - written += vfs_fwrite(og.header, 1, og.header_len, output_file); - written += vfs_fwrite(og.body, 1, og.body_len, output_file); + written += aud_vfs_fwrite(og.header, 1, og.header_len, output_file); + written += aud_vfs_fwrite(og.body, 1, og.body_len, output_file); } return 1; @@ -194,8 +194,8 @@ if (result == 0) break; - written += vfs_fwrite(og.header, 1, og.header_len, output_file); - written += vfs_fwrite(og.body, 1, og.body_len, output_file); + written += aud_vfs_fwrite(og.header, 1, og.header_len, output_file); + written += aud_vfs_fwrite(og.body, 1, og.body_len, output_file); } } } diff -r 5a6b60ceaa0f -r fa9f85cebade src/filewriter/wav.c --- a/src/filewriter/wav.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/filewriter/wav.c Sun Oct 07 00:25:33 2007 -0500 @@ -78,14 +78,14 @@ header.byte_p_spl = GUINT16_TO_LE((GUINT16_FROM_LE(header.bit_p_spl) / (8 / input.channels))); memcpy(&header.data_chunk, "data", 4); header.data_length = GUINT32_TO_LE(0); - vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file); + aud_vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file); return 1; } static void wav_write(void *ptr, gint length) { - written += vfs_fwrite(ptr, 1, length, output_file); + written += aud_vfs_fwrite(ptr, 1, length, output_file); } static void wav_close(void) @@ -95,8 +95,8 @@ header.length = GUINT32_TO_LE(written + sizeof (struct wavhead) - 8); header.data_length = GUINT32_TO_LE(written); - vfs_fseek(output_file, 0, SEEK_SET); - vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file); + aud_vfs_fseek(output_file, 0, SEEK_SET); + aud_vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file); } } diff -r 5a6b60ceaa0f -r fa9f85cebade src/flacng/plugin.c --- a/src/flacng/plugin.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/flacng/plugin.c Sun Oct 07 00:25:33 2007 -0500 @@ -41,7 +41,7 @@ .get_song_info = flac_get_song_info, .get_song_tuple = flac_get_song_tuple, // get a tuple .is_our_file_from_vfs = flac_is_our_fd, // version of is_our_file which is handed an FD - .vfs_extensions = flac_fmts // vector of fileextensions allowed by the plugin + .aud_vfs_extensions = flac_fmts // vector of fileextensions allowed by the plugin }; InputPlugin *flac_iplist[] = { &flac_ip, NULL }; @@ -232,14 +232,14 @@ /* * Open the file */ - if (NULL == (fd = vfs_fopen(filename, "rb"))) { + if (NULL == (fd = aud_vfs_fopen(filename, "rb"))) { _ERROR("Could not open file for reading! (%s)", filename); _LEAVE FALSE; } ret = flac_is_our_fd(filename, fd); - vfs_fclose(fd); + aud_vfs_fclose(fd); _LEAVE ret; } @@ -536,7 +536,7 @@ /* * Open the file */ - if (NULL == (fd = vfs_fopen(input->filename, "rb"))) { + if (NULL == (fd = aud_vfs_fopen(input->filename, "rb"))) { _ERROR("Could not open file for reading! (%s)", input->filename); _LEAVE; } @@ -633,7 +633,7 @@ /* * Open the file */ - if (NULL == (fd = vfs_fopen(filename, "rb"))) { + if (NULL == (fd = aud_vfs_fopen(filename, "rb"))) { _ERROR("Could not open file for reading! (%s)", filename); _LEAVE; } @@ -682,7 +682,7 @@ /* * Open the file */ - if (NULL == (fd = vfs_fopen(filename, "rb"))) { + if (NULL == (fd = aud_vfs_fopen(filename, "rb"))) { _ERROR("Could not open file for reading! (%s)", filename); _LEAVE NULL; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/flacng/seekable_stream_callbacks.c --- a/src/flacng/seekable_stream_callbacks.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/flacng/seekable_stream_callbacks.c Sun Oct 07 00:25:33 2007 -0500 @@ -55,7 +55,7 @@ _LEAVE FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; } - read = vfs_fread(buffer, 1, to_read, info->input_stream); + read = aud_vfs_fread(buffer, 1, to_read, info->input_stream); if ((0 < read) && (0 < info->read_max)) { info->read_max -= read; @@ -93,7 +93,7 @@ _DEBUG("Seeking to %lld", absolute_byte_offset); - if (0 != vfs_fseek(info->input_stream, absolute_byte_offset, SEEK_SET)) { + if (0 != aud_vfs_fseek(info->input_stream, absolute_byte_offset, SEEK_SET)) { _ERROR("Could not seek to %lld!", (long long)absolute_byte_offset); _LEAVE FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; } @@ -113,7 +113,7 @@ info = (callback_info*) client_data; _DEBUG("Using callback_info %s", info->name); - if (-1 == (position = vfs_ftell(info->input_stream))) { + if (-1 == (position = aud_vfs_ftell(info->input_stream))) { _ERROR("Could not tell current position!"); _LEAVE FLAC__STREAM_DECODER_TELL_STATUS_ERROR; } @@ -147,7 +147,7 @@ _LEAVE TRUE; } - eof = vfs_feof(info->input_stream); + eof = aud_vfs_feof(info->input_stream); _LEAVE eof; } @@ -164,7 +164,7 @@ info = (callback_info*) client_data; _DEBUG("Using callback_info %s", info->name); - if (-1 == (size = vfs_fsize(info->input_stream))) { + if (-1 == (size = aud_vfs_fsize(info->input_stream))) { /* * Could not get the stream size. This is not necessarily an * error, maybe the stream has no fixed size (think streaming diff -r 5a6b60ceaa0f -r fa9f85cebade src/flacng/tools.c --- a/src/flacng/tools.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/flacng/tools.c Sun Oct 07 00:25:33 2007 -0500 @@ -83,7 +83,7 @@ if (close_fd && (NULL != info->input_stream)) { _DEBUG("Closing fd"); - vfs_fclose(info->input_stream); + aud_vfs_fclose(info->input_stream); } info->input_stream = NULL; diff -r 5a6b60ceaa0f -r fa9f85cebade src/lastfm/lastfm.c --- a/src/lastfm/lastfm.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/lastfm/lastfm.c Sun Oct 07 00:25:33 2007 -0500 @@ -424,7 +424,7 @@ return NULL; } -VFSFile *lastfm_vfs_fopen_impl(const gchar * path, const gchar * mode) +VFSFile *lastfm_aud_vfs_fopen_impl(const gchar * path, const gchar * mode) { VFSFile *file = g_new0(VFSFile, 1); LastFM *handle = g_new0(LastFM, 1); @@ -453,7 +453,7 @@ g_thread_create(lastfm_adjust,temp_path,FALSE,NULL); metadata_thread = g_thread_create(lastfm_metadata_thread_func, handle, FALSE, NULL); thread_count++; - handle->proxy_fd = vfs_fopen(handle->lastfm_mp3_stream_url, mode); + handle->proxy_fd = aud_vfs_fopen(handle->lastfm_mp3_stream_url, mode); file->handle = handle; #if DEBUG g_print("LASTFM: (fopen) Thread_count: %d\n",thread_count); @@ -461,7 +461,7 @@ return file; } -gint lastfm_vfs_fclose_impl(VFSFile * file) +gint lastfm_aud_vfs_fclose_impl(VFSFile * file) { gint ret = 0; @@ -471,7 +471,7 @@ { g_mutex_lock(metadata_mutex); LastFM *handle = file->handle; - ret = vfs_fclose(handle->proxy_fd); + ret = aud_vfs_fclose(handle->proxy_fd); if (!ret) handle->proxy_fd = NULL; g_free(handle); @@ -482,65 +482,65 @@ return ret; } -size_t lastfm_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file) +size_t lastfm_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file) { LastFM *handle = file->handle; - size_t ret = vfs_fread(ptr, size, nmemb, handle->proxy_fd); + size_t ret = aud_vfs_fread(ptr, size, nmemb, handle->proxy_fd); return ret; } -size_t lastfm_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file) +size_t lastfm_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file) { return -1; } -gint lastfm_vfs_getc_impl(VFSFile * stream) +gint lastfm_aud_vfs_getc_impl(VFSFile * stream) { LastFM *handle = stream->handle; - return vfs_getc(handle->proxy_fd); + return aud_vfs_getc(handle->proxy_fd); } -gint lastfm_vfs_ungetc_impl(gint c, VFSFile * stream) +gint lastfm_aud_vfs_ungetc_impl(gint c, VFSFile * stream) { LastFM *handle = stream->handle; - return vfs_ungetc(c, handle->proxy_fd); + return aud_vfs_ungetc(c, handle->proxy_fd); } -gint lastfm_vfs_fseek_impl(VFSFile * file, glong offset, gint whence) +gint lastfm_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence) { return -1; } -void lastfm_vfs_rewind_impl(VFSFile * file) +void lastfm_aud_vfs_rewind_impl(VFSFile * file) { return; } -glong lastfm_vfs_ftell_impl(VFSFile * file) +glong lastfm_aud_vfs_ftell_impl(VFSFile * file) { LastFM *handle = file->handle; - return vfs_ftell(handle->proxy_fd); + return aud_vfs_ftell(handle->proxy_fd); } -gboolean lastfm_vfs_feof_impl(VFSFile * file) +gboolean lastfm_aud_vfs_feof_impl(VFSFile * file) { LastFM *handle = file->handle; - return vfs_feof(handle->proxy_fd); + return aud_vfs_feof(handle->proxy_fd); } -gint lastfm_vfs_truncate_impl(VFSFile * file, glong size) +gint lastfm_aud_vfs_truncate_impl(VFSFile * file, glong size) { return -1; } -off_t lastfm_vfs_fsize_impl(VFSFile * file) +off_t lastfm_aud_vfs_fsize_impl(VFSFile * file) { return 0; } -gchar *lastfm_vfs_metadata_impl(VFSFile * file, const gchar * field) +gchar *lastfm_aud_vfs_metadata_impl(VFSFile * file, const gchar * field) { LastFM * handle; if(file->handle!= NULL) @@ -560,24 +560,24 @@ VFSConstructor lastfm_const = { "lastfm://", - lastfm_vfs_fopen_impl, - lastfm_vfs_fclose_impl, - lastfm_vfs_fread_impl, - lastfm_vfs_fwrite_impl, - lastfm_vfs_getc_impl, - lastfm_vfs_ungetc_impl, - lastfm_vfs_fseek_impl, - lastfm_vfs_rewind_impl, - lastfm_vfs_ftell_impl, - lastfm_vfs_feof_impl, - lastfm_vfs_truncate_impl, - lastfm_vfs_fsize_impl, - lastfm_vfs_metadata_impl + lastfm_aud_vfs_fopen_impl, + lastfm_aud_vfs_fclose_impl, + lastfm_aud_vfs_fread_impl, + lastfm_aud_vfs_fwrite_impl, + lastfm_aud_vfs_getc_impl, + lastfm_aud_vfs_ungetc_impl, + lastfm_aud_vfs_fseek_impl, + lastfm_aud_vfs_rewind_impl, + lastfm_aud_vfs_ftell_impl, + lastfm_aud_vfs_feof_impl, + lastfm_aud_vfs_truncate_impl, + lastfm_aud_vfs_fsize_impl, + lastfm_aud_vfs_metadata_impl }; static void init(void) { - vfs_register_transport(&lastfm_const); + aud_vfs_register_transport(&lastfm_const); if (!metadata_mutex) metadata_mutex = g_mutex_new (); t0=g_new0(GTimeVal,1); diff -r 5a6b60ceaa0f -r fa9f85cebade src/lastfm/lastfm.h --- a/src/lastfm/lastfm.h Sun Oct 07 00:23:19 2007 -0500 +++ b/src/lastfm/lastfm.h Sun Oct 07 00:25:33 2007 -0500 @@ -32,31 +32,31 @@ gint thread_count=0; static GMutex * metadata_mutex = NULL; static gchar * login_url=NULL; -VFSFile *lastfm_vfs_fopen_impl(const gchar * path, const gchar * mode); +VFSFile *lastfm_aud_vfs_fopen_impl(const gchar * path, const gchar * mode); -size_t lastfm_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file); +size_t lastfm_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file); -size_t lastfm_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file); +size_t lastfm_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file); -gint lastfm_vfs_getc_impl(VFSFile * stream); +gint lastfm_aud_vfs_getc_impl(VFSFile * stream); -gint lastfm_vfs_ungetc_impl(gint c, VFSFile * stream); +gint lastfm_aud_vfs_ungetc_impl(gint c, VFSFile * stream); -gint lastfm_vfs_fseek_impl(VFSFile * file, glong offset, gint whence); +gint lastfm_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence); -void lastfm_vfs_rewind_impl(VFSFile * file); +void lastfm_aud_vfs_rewind_impl(VFSFile * file); -glong lastfm_vfs_ftell_impl(VFSFile * file); +glong lastfm_aud_vfs_ftell_impl(VFSFile * file); -gboolean lastfm_vfs_feof_impl(VFSFile * file); +gboolean lastfm_aud_vfs_feof_impl(VFSFile * file); -gint lastfm_vfs_truncate_impl(VFSFile * file, glong size); +gint lastfm_aud_vfs_truncate_impl(VFSFile * file, glong size); -off_t lastfm_vfs_fsize_impl(VFSFile * file); +off_t lastfm_aud_vfs_fsize_impl(VFSFile * file); -gint lastfm_vfs_fclose_impl(VFSFile * file); +gint lastfm_aud_vfs_fclose_impl(VFSFile * file); -gchar *lastfm_vfs_metadata_impl(VFSFile * file, const gchar * field); +gchar *lastfm_aud_vfs_metadata_impl(VFSFile * file, const gchar * field); gboolean parse_metadata(LastFM * handle,gchar **res); diff -r 5a6b60ceaa0f -r fa9f85cebade src/m3u/m3u.c --- a/src/m3u/m3u.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/m3u/m3u.c Sun Oct 07 00:25:33 2007 -0500 @@ -88,17 +88,17 @@ uri = g_filename_to_uri(filename, NULL, NULL); - if ((file = vfs_fopen(uri ? uri : filename, "rb")) == NULL) + if ((file = aud_vfs_fopen(uri ? uri : filename, "rb")) == NULL) return; g_free(uri); line = g_malloc(line_len); - while (vfs_fgets(line, line_len, file)) { + while (aud_vfs_fgets(line, line_len, file)) { while (strlen(line) == line_len - 1 && line[strlen(line) - 1] != '\n') { line_len += 1024; line = g_realloc(line, line_len); - vfs_fgets(&line[strlen(line)], 1024, file); + aud_vfs_fgets(&line[strlen(line)], 1024, file); } while (line[strlen(line) - 1] == '\r' || @@ -141,7 +141,7 @@ pos++; } - vfs_fclose(file); + aud_vfs_fclose(file); g_free(line); } @@ -158,12 +158,12 @@ g_return_if_fail(playlist != NULL); fn = g_filename_to_uri(filename, NULL, NULL); - file = vfs_fopen(fn ? fn : filename, "wb"); + file = aud_vfs_fopen(fn ? fn : filename, "wb"); g_free(fn); g_return_if_fail(file != NULL); if (cfg.use_pl_metadata) - vfs_fprintf(file, "#EXTM3U\n"); + aud_vfs_fprintf(file, "#EXTM3U\n"); PLAYLIST_LOCK(playlist); @@ -180,22 +180,22 @@ outstr = g_locale_from_utf8(entry->title, -1, NULL, NULL, NULL); if(outstr) { - vfs_fprintf(file, "#EXTINF:%d,%s\n", seconds, outstr); + aud_vfs_fprintf(file, "#EXTINF:%d,%s\n", seconds, outstr); g_free(outstr); outstr = NULL; } else { - vfs_fprintf(file, "#EXTINF:%d,%s\n", seconds, entry->title); + aud_vfs_fprintf(file, "#EXTINF:%d,%s\n", seconds, entry->title); } } fn = g_filename_from_uri(entry->filename, NULL, NULL); - vfs_fprintf(file, "%s\n", fn ? fn : entry->filename); + aud_vfs_fprintf(file, "%s\n", fn ? fn : entry->filename); g_free(fn); } PLAYLIST_UNLOCK(playlist); - vfs_fclose(file); + aud_vfs_fclose(file); } PlaylistContainer plc_m3u = { diff -r 5a6b60ceaa0f -r fa9f85cebade src/madplug/decoder.c --- a/src/madplug/decoder.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/madplug/decoder.c Sun Oct 07 00:25:33 2007 -0500 @@ -571,7 +571,7 @@ #ifdef DEBUG g_message("seeking to: %d bytes", new_position); #endif - if (vfs_fseek(info->infile, new_position, SEEK_SET) == -1) + if (aud_vfs_fseek(info->infile, new_position, SEEK_SET) == -1) audmad_error("failed to seek to: %d", new_position); mad_frame_mute(&frame); mad_synth_mute(&synth); diff -r 5a6b60ceaa0f -r fa9f85cebade src/madplug/fileinfo.c --- a/src/madplug/fileinfo.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/madplug/fileinfo.c Sun Oct 07 00:25:33 2007 -0500 @@ -596,7 +596,7 @@ } #endif - if(!vfs_is_remote(fileurl) && !vfs_file_test(fileurl, G_FILE_TEST_EXISTS)) { + if(!aud_vfs_is_remote(fileurl) && !aud_vfs_file_test(fileurl, G_FILE_TEST_EXISTS)) { return; } @@ -604,7 +604,7 @@ if(audmad_is_remote(fileurl)) { info.remote = TRUE; - if(vfs_is_streaming(info.infile)) + if(aud_vfs_is_streaming(info.infile)) return; //file info dialog for remote streaming doesn't make sense. } diff -r 5a6b60ceaa0f -r fa9f85cebade src/madplug/input.c --- a/src/madplug/input.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/madplug/input.c Sun Oct 07 00:25:33 2007 -0500 @@ -94,20 +94,20 @@ info->mp3gain_minmax = -77; if(!fd){ - info->infile = vfs_fopen(info->filename, "rb"); + info->infile = aud_vfs_fopen(info->filename, "rb"); if (info->infile == NULL) { return FALSE; } } else{ #ifdef DEBUG - printf("input_init: vfs_dup\n"); + printf("input_init: aud_vfs_dup\n"); #endif - info->infile = vfs_dup(fd); + info->infile = aud_vfs_dup(fd); } // obtain file size - info->size = vfs_fsize(info->infile); + info->size = aud_vfs_fsize(info->infile); info->remote = info->size == 0 ? TRUE : FALSE; //proxy connection may result in non-zero size. if(audmad_is_remote((gchar *)url)) info->remote = TRUE; @@ -362,7 +362,7 @@ info->tuple = tuple; if(info->infile) { - curpos = vfs_ftell(info->infile); + curpos = aud_vfs_ftell(info->infile); info->id3file = id3_file_vfsopen(info->infile, ID3_FILE_MODE_READONLY); } else { @@ -429,8 +429,8 @@ // for connection via proxy, we have to stop transfer once. I can't explain the reason. if (info->infile != NULL) { - vfs_fseek(info->infile, -1, SEEK_SET); // an impossible request - vfs_fseek(info->infile, curpos, SEEK_SET); + aud_vfs_fseek(info->infile, -1, SEEK_SET); // an impossible request + aud_vfs_fseek(info->infile, curpos, SEEK_SET); } #ifdef DEBUG @@ -455,7 +455,7 @@ aud_tuple_disassociate(info->tuple, FIELD_TITLE, NULL); aud_tuple_disassociate(info->tuple, FIELD_ALBUM, NULL); - tmp = vfs_get_metadata(info->infile, "track-name"); + tmp = aud_vfs_get_metadata(info->infile, "track-name"); if(tmp){ metadata = TRUE; gchar *scratch; @@ -468,7 +468,7 @@ tmp = NULL; } - tmp = vfs_get_metadata(info->infile, "stream-name"); + tmp = aud_vfs_get_metadata(info->infile, "stream-name"); if(tmp){ metadata = TRUE; gchar *scratch; @@ -538,7 +538,7 @@ } /* reset the input file to the start */ - vfs_fseek(info->infile, 0, SEEK_SET); + aud_vfs_fseek(info->infile, 0, SEEK_SET); info->offset = 0; /* use the filename for the title as a last resort */ @@ -576,7 +576,7 @@ #endif #endif /* simply read to data from the file */ - len = vfs_fread(buffer, 1, buffer_size, info->infile); //vfs_fread returns num of elements. + len = aud_vfs_fread(buffer, 1, buffer_size, info->infile); //aud_vfs_fread returns num of elements. if(len == 0 && info->playback){ info->playback->eof = TRUE; @@ -607,7 +607,7 @@ if (info->filename) g_free(info->filename); if (info->infile) - vfs_fclose(info->infile); + aud_vfs_fclose(info->infile); if (info->id3file) id3_file_close(info->id3file); diff -r 5a6b60ceaa0f -r fa9f85cebade src/madplug/plugin.c --- a/src/madplug/plugin.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/madplug/plugin.c Sun Oct 07 00:25:33 2007 -0500 @@ -292,7 +292,7 @@ gboolean audmad_is_remote(gchar *url) { - gboolean rv = vfs_is_remote(url); + gboolean rv = aud_vfs_is_remote(url); return rv; } @@ -325,9 +325,9 @@ return 0; } - if(vfs_fread(buf, 1, 4, fin) == 0) { + if(aud_vfs_fread(buf, 1, 4, fin) == 0) { gchar *tmp = g_filename_to_utf8(filename, -1, NULL, NULL, NULL); - g_message("vfs_fread failed @1 %s", tmp); + g_message("aud_vfs_fread failed @1 %s", tmp); g_free(tmp); return 0; } @@ -340,10 +340,10 @@ return 0; else if (memcmp(buf, "RIFF", 4) == 0) { - vfs_fseek(fin, 4, SEEK_CUR); - if(vfs_fread(buf, 1, 4, fin) == 0) { + aud_vfs_fseek(fin, 4, SEEK_CUR); + if(aud_vfs_fread(buf, 1, 4, fin) == 0) { gchar *tmp = g_filename_to_utf8(filename, -1, NULL, NULL, NULL); - g_message("vfs_fread failed @2 %s", tmp); + g_message("aud_vfs_fread failed @2 %s", tmp); g_free(tmp); return 0; } @@ -355,9 +355,9 @@ // check data for frame header while (!mp3_head_check(check, &frameSize)) { - if((ret = vfs_fread(tmp, 1, chksize, fin)) == 0){ + if((ret = aud_vfs_fread(tmp, 1, chksize, fin)) == 0){ gchar *tmp = g_filename_to_utf8(filename, -1, NULL, NULL, NULL); - g_message("vfs_fread failed @3 %s", tmp); + g_message("aud_vfs_fread failed @3 %s", tmp); g_free(tmp); return 0; } @@ -372,7 +372,7 @@ * next header ... also reduce the check size. */ if (++chkcount >= 3) return 1; - vfs_fseek(fin, frameSize-4, SEEK_CUR); + aud_vfs_fseek(fin, frameSize-4, SEEK_CUR); check = 0; chksize = 8; } @@ -391,13 +391,13 @@ VFSFile *fin = NULL; gint rtn; - fin = vfs_fopen(filename, "rb"); + fin = aud_vfs_fopen(filename, "rb"); if (fin == NULL) return 0; rtn = audmad_is_our_fd(filename, fin); - vfs_fclose(fin); + aud_vfs_fclose(fin); return rtn; } @@ -654,7 +654,7 @@ #endif if(info.remote && mad_timer_count(info.duration, MAD_UNITS_SECONDS) <= 0){ - if((fd && vfs_is_streaming(fd)) || (info.playback && info.playback->playing)) { + if((fd && aud_vfs_is_streaming(fd)) || (info.playback && info.playback->playing)) { gchar *tmp = NULL; tuple = aud_tuple_new_from_filename(filename); @@ -662,7 +662,7 @@ if(info.playback) g_message("info.playback->playing = %d",info.playback->playing); #endif - tmp = vfs_get_metadata(info.infile ? info.infile : fd, "track-name"); + tmp = aud_vfs_get_metadata(info.infile ? info.infile : fd, "track-name"); if(tmp){ gchar *scratch; @@ -673,7 +673,7 @@ tmp = NULL; } - tmp = vfs_get_metadata(info.infile ? info.infile : fd, "stream-name"); + tmp = aud_vfs_get_metadata(info.infile ? info.infile : fd, "stream-name"); if(tmp){ gchar *scratch; @@ -702,9 +702,9 @@ // return NULL; } /* info.remote */ - // if !fd, pre-open the file with vfs_fopen() and reuse fd. + // if !fd, pre-open the file with aud_vfs_fopen() and reuse fd. if(!fd) { - fd = vfs_fopen(filename, "rb"); + fd = aud_vfs_fopen(filename, "rb"); if(!fd) return NULL; local_fd = TRUE; @@ -796,7 +796,7 @@ aud_tuple_associate_string(tuple, FIELD_CODEC, NULL, "MPEG Audio (MP3)"); if(local_fd) - vfs_fclose(fd); + aud_vfs_fclose(fd); #ifdef DEBUG g_message("e: mad: audmad_get_song_tuple"); @@ -814,7 +814,7 @@ if (!audmad_is_our_fd(filename, fd)) return NULL; - vfs_rewind(fd); + aud_vfs_rewind(fd); return __audmad_get_song_tuple(filename, fd); } @@ -836,7 +836,7 @@ .file_info_box = audmad_get_file_info, .get_song_tuple = audmad_get_song_tuple, .is_our_file_from_vfs = audmad_is_our_fd, - .vfs_extensions = fmts, + .aud_vfs_extensions = fmts, .mseek = audmad_mseek, .probe_for_tuple = audmad_probe_for_tuple }; diff -r 5a6b60ceaa0f -r fa9f85cebade src/madplug/replaygain.c --- a/src/madplug/replaygain.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/madplug/replaygain.c Sun Oct 07 00:25:33 2007 -0500 @@ -72,9 +72,9 @@ tp = &T; - if (vfs_fseek(fp, -sizeof(T), SEEK_CUR) != 0) + if (aud_vfs_fseek(fp, -sizeof(T), SEEK_CUR) != 0) return 18; - if (vfs_fread(tp, 1, sizeof(T), fp) != sizeof T) + if (aud_vfs_fread(tp, 1, sizeof(T), fp) != sizeof T) return 2; if (memcmp(tp->ID, "APETAGEX", sizeof(tp->ID)) != 0) return 3; @@ -83,12 +83,12 @@ TagLen = Read_LE_Uint32(tp->Length); if (TagLen < sizeof(T)) return 5; - if (vfs_fseek(fp, -TagLen, SEEK_CUR) != 0) + if (aud_vfs_fseek(fp, -TagLen, SEEK_CUR) != 0) return 6; if ((buff = (char *) malloc(TagLen)) == NULL) { return 7; } - if (vfs_fread(buff, 1, TagLen - sizeof(T), fp) != TagLen - sizeof(T)) { + if (aud_vfs_fread(buff, 1, TagLen - sizeof(T), fp) != TagLen - sizeof(T)) { free(buff); return 8; } @@ -170,8 +170,8 @@ static const char *key = "APETAGEX"; char buff[20000]; int N = 0; - if (vfs_fseek(fp, -20000, SEEK_CUR) != 0); - if ((N = vfs_fread(buff, 1, 20000, fp)) < 16) + if (aud_vfs_fseek(fp, -20000, SEEK_CUR) != 0); + if ((N = aud_vfs_fread(buff, 1, 20000, fp)) < 16) return 1; int matched = 0; int i, last_match = -1; @@ -285,36 +285,36 @@ /* APEv2 stuff */ if (file_info->infile) { - fp = vfs_dup(file_info->infile); - curpos = vfs_ftell(fp); + fp = aud_vfs_dup(file_info->infile); + curpos = aud_vfs_ftell(fp); } else { - if ((fp = vfs_fopen(file_info->filename, "rb")) == NULL) + if ((fp = aud_vfs_fopen(file_info->filename, "rb")) == NULL) return; } - if (vfs_fseek(fp, 0L, SEEK_END) != 0) { - vfs_fclose(fp); + if (aud_vfs_fseek(fp, 0L, SEEK_END) != 0) { + aud_vfs_fclose(fp); return; } - long pos = vfs_ftell(fp); + long pos = aud_vfs_ftell(fp); int res = -1; int try = 0; while (res != 0 && try < 10) { // try skipping an id3 tag - vfs_fseek(fp, pos, SEEK_SET); - vfs_fseek(fp, try * -128, SEEK_CUR); + aud_vfs_fseek(fp, pos, SEEK_SET); + aud_vfs_fseek(fp, try * -128, SEEK_CUR); res = ReadAPE2Tag(fp, file_info); ++try; } if (res != 0) { // try brute search (don't want to parse all possible kinds of tags..) - vfs_fseek(fp, pos, SEEK_SET); + aud_vfs_fseek(fp, pos, SEEK_SET); int offs = find_offset(fp); if (offs <= 0) { // found ! - vfs_fseek(fp, pos, SEEK_SET); - vfs_fseek(fp, offs, SEEK_CUR); + aud_vfs_fseek(fp, pos, SEEK_SET); + aud_vfs_fseek(fp, offs, SEEK_CUR); res = ReadAPE2Tag(fp, file_info); if (res != 0) { g_message @@ -342,9 +342,9 @@ file_info->has_replaygain = TRUE; if (file_info->infile) - vfs_fseek(fp, curpos, SEEK_SET); + aud_vfs_fseek(fp, curpos, SEEK_SET); - vfs_fclose(fp); + aud_vfs_fclose(fp); #ifdef DEBUG g_message("e: read_replaygain"); diff -r 5a6b60ceaa0f -r fa9f85cebade src/mms/mms.c --- a/src/mms/mms.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/mms/mms.c Sun Oct 07 00:25:33 2007 -0500 @@ -41,7 +41,7 @@ } MMSHandle; VFSFile * -mms_vfs_fopen_impl(const gchar * path, +mms_aud_vfs_fopen_impl(const gchar * path, const gchar * mode) { VFSFile *file; @@ -72,7 +72,7 @@ } gint -mms_vfs_fclose_impl(VFSFile * file) +mms_aud_vfs_fclose_impl(VFSFile * file) { gint ret = 0; @@ -92,7 +92,7 @@ } size_t -mms_vfs_fread_impl(gpointer ptr, +mms_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file) @@ -117,7 +117,7 @@ } size_t -mms_vfs_fwrite_impl(gconstpointer ptr, +mms_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file) @@ -126,7 +126,7 @@ } gint -mms_vfs_getc_impl(VFSFile *stream) +mms_aud_vfs_getc_impl(VFSFile *stream) { MMSHandle *handle = (MMSHandle *) stream->handle; guchar c; @@ -147,7 +147,7 @@ } gint -mms_vfs_ungetc_impl(gint c, VFSFile *stream) +mms_aud_vfs_ungetc_impl(gint c, VFSFile *stream) { MMSHandle *handle = (MMSHandle *) stream->handle; @@ -160,7 +160,7 @@ } gint -mms_vfs_fseek_impl(VFSFile * file, +mms_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence) { @@ -168,13 +168,13 @@ } void -mms_vfs_rewind_impl(VFSFile * file) +mms_aud_vfs_rewind_impl(VFSFile * file) { return; } glong -mms_vfs_ftell_impl(VFSFile * file) +mms_aud_vfs_ftell_impl(VFSFile * file) { MMSHandle *handle = (MMSHandle *) file->handle; @@ -182,7 +182,7 @@ } gboolean -mms_vfs_feof_impl(VFSFile * file) +mms_aud_vfs_feof_impl(VFSFile * file) { MMSHandle *handle = (MMSHandle *) file->handle; @@ -191,42 +191,42 @@ } gint -mms_vfs_truncate_impl(VFSFile * file, glong size) +mms_aud_vfs_truncate_impl(VFSFile * file, glong size) { return -1; } off_t -mms_vfs_fsize_impl(VFSFile * file) +mms_aud_vfs_fsize_impl(VFSFile * file) { return -1; } VFSConstructor mms_const = { "mms://", - mms_vfs_fopen_impl, - mms_vfs_fclose_impl, - mms_vfs_fread_impl, - mms_vfs_fwrite_impl, - mms_vfs_getc_impl, - mms_vfs_ungetc_impl, - mms_vfs_fseek_impl, - mms_vfs_rewind_impl, - mms_vfs_ftell_impl, - mms_vfs_feof_impl, - mms_vfs_truncate_impl, - mms_vfs_fsize_impl + mms_aud_vfs_fopen_impl, + mms_aud_vfs_fclose_impl, + mms_aud_vfs_fread_impl, + mms_aud_vfs_fwrite_impl, + mms_aud_vfs_getc_impl, + mms_aud_vfs_ungetc_impl, + mms_aud_vfs_fseek_impl, + mms_aud_vfs_rewind_impl, + mms_aud_vfs_ftell_impl, + mms_aud_vfs_feof_impl, + mms_aud_vfs_truncate_impl, + mms_aud_vfs_fsize_impl }; static void init(void) { - vfs_register_transport(&mms_const); + aud_vfs_register_transport(&mms_const); } static void cleanup(void) { #if 0 - vfs_unregister_transport(&mms_const); + aud_vfs_unregister_transport(&mms_const); #endif } diff -r 5a6b60ceaa0f -r fa9f85cebade src/modplug/archive/arch_raw.cxx --- a/src/modplug/archive/arch_raw.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/modplug/archive/arch_raw.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -16,7 +16,7 @@ arch_Raw::arch_Raw(const string& aFileName) { - mFileDesc = vfs_fopen(aFileName.c_str(), "rb"); + mFileDesc = aud_vfs_fopen(aFileName.c_str(), "rb"); //open and mmap the file if(mFileDesc == NULL) @@ -24,12 +24,12 @@ mSize = 0; return; } - vfs_fseek(mFileDesc, 0, SEEK_END); - mSize = vfs_ftell(mFileDesc); - vfs_fseek(mFileDesc, 0, SEEK_SET); + aud_vfs_fseek(mFileDesc, 0, SEEK_END); + mSize = aud_vfs_ftell(mFileDesc); + aud_vfs_fseek(mFileDesc, 0, SEEK_SET); mMap = malloc(mSize); - vfs_fread(mMap, 1, mSize, mFileDesc); + aud_vfs_fread(mMap, 1, mSize, mFileDesc); } arch_Raw::~arch_Raw() @@ -37,7 +37,7 @@ if(mSize != 0) { free(mMap); - vfs_fclose(mFileDesc); + aud_vfs_fclose(mFileDesc); } } diff -r 5a6b60ceaa0f -r fa9f85cebade src/modplug/modplugbmp.cxx --- a/src/modplug/modplugbmp.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/modplug/modplugbmp.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -111,7 +111,7 @@ const int magicSize = 32; char magic[magicSize]; - vfs_fread(magic, 1, magicSize, file); + aud_vfs_fread(magic, 1, magicSize, file); if (!memcmp(magic, UMX_MAGIC, 4)) return true; if (!memcmp(magic, "Extended Module:", 16)) @@ -125,13 +125,13 @@ if (!memcmp(magic, PSM_MAGIC, 4)) return true; - vfs_fseek(file, 44, SEEK_SET); - vfs_fread(magic, 1, 4, file); + aud_vfs_fseek(file, 44, SEEK_SET); + aud_vfs_fread(magic, 1, 4, file); if (!memcmp(magic, S3M_MAGIC, 4)) return true; - vfs_fseek(file, 1080, SEEK_SET); - vfs_fread(magic, 1, 4, file); + aud_vfs_fseek(file, 1080, SEEK_SET); + aud_vfs_fread(magic, 1, 4, file); // Check for Fast Tracker multichannel modules (xCHN, xxCH) if (magic[1] == 'C' && magic[2] == 'H' && magic[3] == 'N') { diff -r 5a6b60ceaa0f -r fa9f85cebade src/mtp_up/mtp.c --- a/src/mtp_up/mtp.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/mtp_up/mtp.c Sun Oct 07 00:25:33 2007 -0500 @@ -142,10 +142,10 @@ /* dealing the stream upload (invalidating)*/ if(filename) { - f = vfs_fopen(from_path,"r"); - if(vfs_is_streaming(f)) + f = aud_vfs_fopen(from_path,"r"); + if(aud_vfs_is_streaming(f)) { - vfs_fclose(f); + aud_vfs_fclose(f); return NULL; } } diff -r 5a6b60ceaa0f -r fa9f85cebade src/musepack/libmpc.cxx --- a/src/musepack/libmpc.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/musepack/libmpc.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -60,34 +60,34 @@ * This _IS_ very sick, but it works. -nenolod */ static mpc_int32_t -vfs_fread_impl(void *data, void *ptr, mpc_int32_t size) +aud_vfs_fread_impl(void *data, void *ptr, mpc_int32_t size) { mpc_reader_file *d = (mpc_reader_file *) data; VFSFile *file = (VFSFile *) d->file; - return (mpc_int32_t) vfs_fread(ptr, 1, size, file); + return (mpc_int32_t) aud_vfs_fread(ptr, 1, size, file); } static mpc_bool_t -vfs_fseek_impl(void *data, mpc_int32_t offset) +aud_vfs_fseek_impl(void *data, mpc_int32_t offset) { mpc_reader_file *d = (mpc_reader_file *) data; VFSFile *file = (VFSFile *) d->file; - return d->is_seekable ? vfs_fseek(file, offset, SEEK_SET) == 0 : FALSE; + return d->is_seekable ? aud_vfs_fseek(file, offset, SEEK_SET) == 0 : FALSE; } static mpc_int32_t -vfs_ftell_impl(void *data) +aud_vfs_ftell_impl(void *data) { mpc_reader_file *d = (mpc_reader_file *) data; VFSFile *file = (VFSFile *) d->file; - return vfs_ftell(file); + return aud_vfs_ftell(file); } static mpc_int32_t -vfs_getsize_impl(void *data) +aud_vfs_getsize_impl(void *data) { mpc_reader_file *d = (mpc_reader_file *) data; @@ -95,7 +95,7 @@ } static mpc_bool_t -vfs_canseek_impl(void *data) +aud_vfs_canseek_impl(void *data) { mpc_reader_file *d = (mpc_reader_file *) data; @@ -110,19 +110,19 @@ void mpc_reader_setup_file_vfs(mpc_reader_file *p_reader, VFSFile *input) { - p_reader->reader.seek = vfs_fseek_impl; - p_reader->reader.read = vfs_fread_impl; - p_reader->reader.tell = vfs_ftell_impl; - p_reader->reader.get_size = vfs_getsize_impl; - p_reader->reader.canseek = vfs_canseek_impl; + p_reader->reader.seek = aud_vfs_fseek_impl; + p_reader->reader.read = aud_vfs_fread_impl; + p_reader->reader.tell = aud_vfs_ftell_impl; + p_reader->reader.get_size = aud_vfs_getsize_impl; + p_reader->reader.canseek = aud_vfs_canseek_impl; p_reader->reader.data = p_reader; p_reader->file = (FILE *) input; // no worries, it gets cast back -nenolod p_reader->is_seekable = TRUE; // XXX streams - vfs_fseek(input, 0, SEEK_END); - p_reader->file_size = vfs_ftell(input); - vfs_fseek(input, 0, SEEK_SET); + aud_vfs_fseek(input, 0, SEEK_END); + p_reader->file_size = aud_vfs_ftell(input); + aud_vfs_fseek(input, 0, SEEK_SET); } static void mpcOpenPlugin() @@ -279,13 +279,13 @@ { VFSFile *file; gchar magic[3]; - if ((file = vfs_fopen(p_Filename, "rb"))) { - vfs_fread(magic, 1, 3, file); + if ((file = aud_vfs_fopen(p_Filename, "rb"))) { + aud_vfs_fread(magic, 1, 3, file); if (!memcmp(magic, "MP+", 3)) { - vfs_fclose(file); + aud_vfs_fclose(file); return 1; } - vfs_fclose(file); + aud_vfs_fclose(file); } return 0; } @@ -293,7 +293,7 @@ static int mpcIsOurFD(char* p_Filename, VFSFile* file) { gchar magic[3]; - vfs_fread(magic, 1, 3, file); + aud_vfs_fread(magic, 1, 3, file); if (!memcmp(magic, "MP+", 3)) return 1; return 0; @@ -350,7 +350,7 @@ static Tuple *mpcGetSongTuple(char* p_Filename) { - VFSFile *input = vfs_fopen(p_Filename, "rb"); + VFSFile *input = aud_vfs_fopen(p_Filename, "rb"); Tuple *tuple = NULL; if(input) @@ -385,7 +385,7 @@ aud_tuple_associate_string(tuple, FIELD_QUALITY, NULL, scratch); g_free(scratch); - vfs_fclose(input); + aud_vfs_fclose(input); } else { @@ -399,7 +399,7 @@ static void mpcGetSongInfo(char* p_Filename, char** p_Title, int* p_Length) { - VFSFile *input = vfs_fopen(p_Filename, "rb"); + VFSFile *input = aud_vfs_fopen(p_Filename, "rb"); if(input) { MpcInfo tags = getTags(p_Filename); @@ -410,7 +410,7 @@ mpc_reader_setup_file_vfs(&reader, input); mpc_streaminfo_read(&info, &reader.reader); *p_Length = static_cast (1000 * mpc_streaminfo_get_length(&info)); - vfs_fclose(input); + aud_vfs_fclose(input); } else { @@ -580,7 +580,7 @@ GtkWidget* albumPeakLabel = mpcGtkLabel(infoVbox); GtkWidget* albumGainLabel = mpcGtkLabel(infoVbox); - VFSFile *input = vfs_fopen(p_Filename, "rb"); + VFSFile *input = aud_vfs_fopen(p_Filename, "rb"); if(input) { mpc_streaminfo info; @@ -621,7 +621,7 @@ gtk_entry_set_text(GTK_ENTRY(fileEntry), entry); free(entry); freeTags(tags); - vfs_fclose(input); + aud_vfs_fclose(input); } else { @@ -762,7 +762,7 @@ } setAlive(false); if(p_FileHandle) - vfs_fclose(p_FileHandle); + aud_vfs_fclose(p_FileHandle); if(track.display) { free(track.display); @@ -775,7 +775,7 @@ { lockAcquire(); char* filename = static_cast (data); - VFSFile *input = vfs_fopen(filename, "rb"); + VFSFile *input = aud_vfs_fopen(filename, "rb"); if (!input) { mpcDecoder.isError = g_strdup_printf("[xmms-musepack] decodeStream is unable to open %s", filename); diff -r 5a6b60ceaa0f -r fa9f85cebade src/neon/neon.c --- a/src/neon/neon.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/neon/neon.c Sun Oct 07 00:25:33 2007 -0500 @@ -38,36 +38,36 @@ VFSConstructor neon_http_const = { "http://", - neon_vfs_fopen_impl, - neon_vfs_fclose_impl, - neon_vfs_fread_impl, - neon_vfs_fwrite_impl, - neon_vfs_getc_impl, - neon_vfs_ungetc_impl, - neon_vfs_fseek_impl, - neon_vfs_rewind_impl, - neon_vfs_ftell_impl, - neon_vfs_feof_impl, - neon_vfs_truncate_impl, - neon_vfs_fsize_impl, - neon_vfs_metadata_impl + neon_aud_vfs_fopen_impl, + neon_aud_vfs_fclose_impl, + neon_aud_vfs_fread_impl, + neon_aud_vfs_fwrite_impl, + neon_aud_vfs_getc_impl, + neon_aud_vfs_ungetc_impl, + neon_aud_vfs_fseek_impl, + neon_aud_vfs_rewind_impl, + neon_aud_vfs_ftell_impl, + neon_aud_vfs_feof_impl, + neon_aud_vfs_truncate_impl, + neon_aud_vfs_fsize_impl, + neon_aud_vfs_metadata_impl }; VFSConstructor neon_https_const = { "https://", - neon_vfs_fopen_impl, - neon_vfs_fclose_impl, - neon_vfs_fread_impl, - neon_vfs_fwrite_impl, - neon_vfs_getc_impl, - neon_vfs_ungetc_impl, - neon_vfs_fseek_impl, - neon_vfs_rewind_impl, - neon_vfs_ftell_impl, - neon_vfs_feof_impl, - neon_vfs_truncate_impl, - neon_vfs_fsize_impl, - neon_vfs_metadata_impl + neon_aud_vfs_fopen_impl, + neon_aud_vfs_fclose_impl, + neon_aud_vfs_fread_impl, + neon_aud_vfs_fwrite_impl, + neon_aud_vfs_getc_impl, + neon_aud_vfs_ungetc_impl, + neon_aud_vfs_fseek_impl, + neon_aud_vfs_rewind_impl, + neon_aud_vfs_ftell_impl, + neon_aud_vfs_feof_impl, + neon_aud_vfs_truncate_impl, + neon_aud_vfs_fsize_impl, + neon_aud_vfs_metadata_impl }; /* bring ne_set_connect_timeout in as a weak reference, not using it @@ -163,11 +163,11 @@ _LEAVE; } - vfs_register_transport(&neon_http_const); + aud_vfs_register_transport(&neon_http_const); if (0 != ne_has_support(NE_FEATURE_SSL)) { _DEBUG("neon compiled with thread-safe SSL, enabling https:// transport"); - vfs_register_transport(&neon_https_const); + aud_vfs_register_transport(&neon_https_const); } _LEAVE; @@ -774,7 +774,7 @@ * ----- */ -VFSFile* neon_vfs_fopen_impl(const gchar* path, const gchar* mode) { +VFSFile* neon_aud_vfs_fopen_impl(const gchar* path, const gchar* mode) { VFSFile* file; struct neon_handle* handle; @@ -818,7 +818,7 @@ * ---- */ -gint neon_vfs_fclose_impl(VFSFile* file) { +gint neon_aud_vfs_fclose_impl(VFSFile* file) { struct neon_handle* h = (struct neon_handle *)file->handle; @@ -845,7 +845,7 @@ * ----- */ -size_t neon_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile* file) { +size_t neon_aud_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile* file) { struct neon_handle* h = (struct neon_handle*)file->handle; int belem; @@ -1052,7 +1052,7 @@ * ----- */ -size_t neon_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile* file) { +size_t neon_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile* file) { _ENTER; @@ -1065,13 +1065,13 @@ * ----- */ -gint neon_vfs_getc_impl(VFSFile* file) { +gint neon_aud_vfs_getc_impl(VFSFile* file) { gchar c; _ENTER; - if (1 != neon_vfs_fread_impl(&c, 1, 1, file)) { + if (1 != neon_aud_vfs_fread_impl(&c, 1, 1, file)) { _ERROR("Could not getc()!"); _LEAVE -1; } @@ -1083,7 +1083,7 @@ * ----- */ -gint neon_vfs_ungetc_impl(gint c, VFSFile* stream) { +gint neon_aud_vfs_ungetc_impl(gint c, VFSFile* stream) { _ENTER; @@ -1096,11 +1096,11 @@ * ----- */ -void neon_vfs_rewind_impl(VFSFile* file) { +void neon_aud_vfs_rewind_impl(VFSFile* file) { _ENTER; - (void)neon_vfs_fseek_impl(file, 0L, SEEK_SET); + (void)neon_aud_vfs_fseek_impl(file, 0L, SEEK_SET); _LEAVE; } @@ -1109,7 +1109,7 @@ * ----- */ -glong neon_vfs_ftell_impl(VFSFile* file) { +glong neon_aud_vfs_ftell_impl(VFSFile* file) { struct neon_handle* h = (struct neon_handle *)file->handle; @@ -1124,7 +1124,7 @@ * ----- */ -gboolean neon_vfs_feof_impl(VFSFile* file) { +gboolean neon_aud_vfs_feof_impl(VFSFile* file) { struct neon_handle* h = (struct neon_handle*)file->handle; @@ -1137,7 +1137,7 @@ * ----- */ -gint neon_vfs_truncate_impl(VFSFile* file, glong size) { +gint neon_aud_vfs_truncate_impl(VFSFile* file, glong size) { _ENTER; @@ -1150,7 +1150,7 @@ * ----- */ -gint neon_vfs_fseek_impl(VFSFile* file, glong offset, gint whence) { +gint neon_aud_vfs_fseek_impl(VFSFile* file, glong offset, gint whence) { struct neon_handle* h = (struct neon_handle*)file->handle; long newpos; @@ -1243,7 +1243,7 @@ * ----- */ -gchar *neon_vfs_metadata_impl(VFSFile* file, const gchar* field) { +gchar *neon_aud_vfs_metadata_impl(VFSFile* file, const gchar* field) { struct neon_handle* h = (struct neon_handle*)file->handle; @@ -1270,7 +1270,7 @@ * ----- */ -off_t neon_vfs_fsize_impl(VFSFile* file) { +off_t neon_aud_vfs_fsize_impl(VFSFile* file) { struct neon_handle* h = (struct neon_handle*)file->handle; diff -r 5a6b60ceaa0f -r fa9f85cebade src/neon/neon.h --- a/src/neon/neon.h Sun Oct 07 00:23:19 2007 -0500 +++ b/src/neon/neon.h Sun Oct 07 00:25:33 2007 -0500 @@ -33,19 +33,19 @@ static void init(void); static void fini(void); -VFSFile *neon_vfs_fopen_impl(const gchar* path, const gchar* mode); -gint neon_vfs_fclose_impl(VFSFile* file); -size_t neon_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile* file); -size_t neon_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile* file); -gint neon_vfs_getc_impl(VFSFile* file); -gint neon_vfs_ungetc_impl(gint c, VFSFile* file); -void neon_vfs_rewind_impl(VFSFile* file); -glong neon_vfs_ftell_impl(VFSFile* file); -gboolean neon_vfs_feof_impl(VFSFile* file); -gint neon_vfs_truncate_impl(VFSFile* file, glong size); -gint neon_vfs_fseek_impl(VFSFile* file, glong offset, gint whence); -gchar *neon_vfs_metadata_impl(VFSFile* file, const gchar * field); -off_t neon_vfs_fsize_impl(VFSFile* file); +VFSFile *neon_aud_vfs_fopen_impl(const gchar* path, const gchar* mode); +gint neon_aud_vfs_fclose_impl(VFSFile* file); +size_t neon_aud_vfs_fread_impl(gpointer ptr_, size_t size, size_t nmemb, VFSFile* file); +size_t neon_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile* file); +gint neon_aud_vfs_getc_impl(VFSFile* file); +gint neon_aud_vfs_ungetc_impl(gint c, VFSFile* file); +void neon_aud_vfs_rewind_impl(VFSFile* file); +glong neon_aud_vfs_ftell_impl(VFSFile* file); +gboolean neon_aud_vfs_feof_impl(VFSFile* file); +gint neon_aud_vfs_truncate_impl(VFSFile* file, glong size); +gint neon_aud_vfs_fseek_impl(VFSFile* file, glong offset, gint whence); +gchar *neon_aud_vfs_metadata_impl(VFSFile* file, const gchar * field); +off_t neon_aud_vfs_fsize_impl(VFSFile* file); ne_uri purl; diff -r 5a6b60ceaa0f -r fa9f85cebade src/paranormal/libcalc/parser.c --- a/src/paranormal/libcalc/parser.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/paranormal/libcalc/parser.c Sun Oct 07 00:25:33 2007 -0500 @@ -1377,7 +1377,7 @@ parser_control *pc = (parser_control *) yyparam; /* Ignore whitespace, get first nonwhite character. */ - while ((c = vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n'); + while ((c = aud_vfs_getc (pc->input)) == ' ' || c == '\t' || c == '\n'); /* End of input ? */ if (c == EOF) @@ -1385,7 +1385,7 @@ /* Char starts a number => parse the number. */ if (isdigit (c)) { - vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */ + aud_vfs_fseek (pc->input, -1, SEEK_CUR); /* Put the char back. */ { char *old_locale, *saved_locale; @@ -1396,10 +1396,10 @@ while (isdigit(c) || c == '.') { - c = vfs_getc(pc->input); + c = aud_vfs_getc(pc->input); } - vfs_fseek(pc->input, -1, SEEK_CUR); + aud_vfs_fseek(pc->input, -1, SEEK_CUR); setlocale (LC_ALL, saved_locale); g_free (saved_locale); @@ -1417,10 +1417,10 @@ sym_name = g_string_append_c (sym_name, c); /* Get another character. */ - c = vfs_getc (pc->input); + c = aud_vfs_getc (pc->input); } while (c != EOF && isalnum (c)); - vfs_fseek (pc->input, -1, SEEK_CUR); + aud_vfs_fseek (pc->input, -1, SEEK_CUR); yylval->s_value = sym_name->str; @@ -1501,7 +1501,7 @@ g_return_val_if_fail(str != NULL && dict != NULL, NULL); - stream = vfs_buffer_new_from_string ( (char *) str ); + stream = aud_vfs_buffer_new_from_string ( (char *) str ); pc.input = stream; pc.expr = expr_new (); @@ -1513,7 +1513,7 @@ pc.expr = NULL; } - vfs_fclose (stream); + aud_vfs_fclose (stream); return pc.expr; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/paranormal/libcalc/parser.h --- a/src/paranormal/libcalc/parser.h Sun Oct 07 00:23:19 2007 -0500 +++ b/src/paranormal/libcalc/parser.h Sun Oct 07 00:25:33 2007 -0500 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "execute.h" diff -r 5a6b60ceaa0f -r fa9f85cebade src/pls/pls.c --- a/src/pls/pls.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/pls/pls.c Sun Oct 07 00:25:33 2007 -0500 @@ -100,14 +100,14 @@ playlist_save_pls(const gchar *filename, gint pos) { GList *node; - VFSFile *file = vfs_fopen(filename, "wb"); + VFSFile *file = aud_vfs_fopen(filename, "wb"); Playlist *playlist = playlist_get_active(); g_return_if_fail(file != NULL); g_return_if_fail(playlist != NULL); - vfs_fprintf(file, "[playlist]\n"); - vfs_fprintf(file, "NumberOfEntries=%d\n", playlist_get_length(playlist)); + aud_vfs_fprintf(file, "[playlist]\n"); + aud_vfs_fprintf(file, "NumberOfEntries=%d\n", playlist_get_length(playlist)); PLAYLIST_LOCK(playlist); @@ -115,12 +115,12 @@ PlaylistEntry *entry = PLAYLIST_ENTRY(node->data); gchar *fn; - if (vfs_is_remote(entry->filename)) + if (aud_vfs_is_remote(entry->filename)) fn = g_strdup(entry->filename); else fn = g_filename_from_uri(entry->filename, NULL, NULL); - vfs_fprintf(file, "File%d=%s\n", g_list_position(playlist->entries, node) + 1, + aud_vfs_fprintf(file, "File%d=%s\n", g_list_position(playlist->entries, node) + 1, fn); g_free(fn); @@ -128,7 +128,7 @@ PLAYLIST_UNLOCK(playlist); - vfs_fclose(file); + aud_vfs_fclose(file); } PlaylistContainer plc_pls = { diff -r 5a6b60ceaa0f -r fa9f85cebade src/sexypsf/Misc.c --- a/src/sexypsf/Misc.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/sexypsf/Misc.c Sun Oct 07 00:25:33 2007 -0500 @@ -236,13 +236,13 @@ PSFINFO *psfi; PSFINFO *tmpi; - if(!(fp=vfs_fopen(path,"rb"))) + if(!(fp=aud_vfs_fopen(path,"rb"))) { printf("path %s failed to load\n", path); return(0); } - vfs_fread(head,1,4,fp); + aud_vfs_fread(head,1,4,fp); if(memcmp(head,"PSF\x01",4)) return(0); psfi=malloc(sizeof(PSFINFO)); @@ -250,22 +250,22 @@ psfi->stop=~0; psfi->fade=0; - vfs_fread(&reserved,1,4,fp); - vfs_fread(&complen,1,4,fp); + aud_vfs_fread(&reserved,1,4,fp); + aud_vfs_fread(&complen,1,4,fp); complen=BFLIP32(complen); - vfs_fread(&crc32,1,4,fp); + aud_vfs_fread(&crc32,1,4,fp); crc32=BFLIP32(crc32); - vfs_fseek(fp,reserved,SEEK_CUR); + aud_vfs_fseek(fp,reserved,SEEK_CUR); if(type) - vfs_fseek(fp,complen,SEEK_CUR); + aud_vfs_fseek(fp,complen,SEEK_CUR); else { in=malloc(complen); out=malloc(1024*1024*2+0x800); - vfs_fread(in,1,complen,fp); + aud_vfs_fread(in,1,complen,fp); outlen=1024*1024*2; uncompress(out,&outlen,in,complen); free(in); @@ -284,13 +284,13 @@ { u8 tagdata[5]; - if(vfs_fread(tagdata,1,5,fp)==5) + if(aud_vfs_fread(tagdata,1,5,fp)==5) { if(!memcmp(tagdata,"[TAG]",5)) { char linebuf[1024]; - while(vfs_fgets(linebuf,1024,fp)) + while(aud_vfs_fgets(linebuf,1024,fp)) { int x; char *key=0,*value=0; @@ -332,7 +332,7 @@ free(value); free(tmpfn); if(!level) free(out); - vfs_fclose(fp); + aud_vfs_fclose(fp); FreeTags(psfi->tags); free(psfi); return(0); @@ -346,7 +346,7 @@ } } - vfs_fclose(fp); + aud_vfs_fclose(fp); /* Now, if we're at level 0(main PSF), load the main executable, and any libN stuff */ if(!level && !type) @@ -406,7 +406,7 @@ //free(key); //free(value); //free(tmpfn); - //vfs_fclose(fp); + //aud_vfs_fclose(fp); //return(0); } free(tmpfn); diff -r 5a6b60ceaa0f -r fa9f85cebade src/sexypsf/plugin.c --- a/src/sexypsf/plugin.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/sexypsf/plugin.c Sun Oct 07 00:25:33 2007 -0500 @@ -44,7 +44,7 @@ static int is_our_fd(gchar *filename, VFSFile *file) { gchar magic[4]; - vfs_fread(magic, 1, 4, file); + aud_vfs_fread(magic, 1, 4, file); // only allow PSF1 for now if (!memcmp(magic, "PSF\x01", 4)) @@ -269,7 +269,7 @@ .get_song_info = sexypsf_xmms_getsonginfo, .get_song_tuple = get_aud_tuple_psf, .is_our_file_from_vfs = is_our_fd, - .vfs_extensions = sexypsf_fmts, + .aud_vfs_extensions = sexypsf_fmts, }; InputPlugin *sexypsf_iplist[] = { &sexypsf_ip, NULL }; diff -r 5a6b60ceaa0f -r fa9f85cebade src/shnplug/id3v2.c --- a/src/shnplug/id3v2.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/shnplug/id3v2.c Sun Oct 07 00:25:33 2007 -0500 @@ -58,7 +58,7 @@ unsigned long tag_size; /* read an ID3v2 header's size worth of data */ - if (sizeof(_id3v2_header) != vfs_fread(&id3v2_header,1,sizeof(_id3v2_header),f)) { + if (sizeof(_id3v2_header) != aud_vfs_fread(&id3v2_header,1,sizeof(_id3v2_header),f)) { return 0; } @@ -83,7 +83,7 @@ VFSFile *f; unsigned long tag_size; - if (NULL == (f = vfs_fopen(filename,"rb"))) { + if (NULL == (f = aud_vfs_fopen(filename,"rb"))) { return NULL; } @@ -95,8 +95,8 @@ /* check for ID3v2 tag on input */ if (0 == (tag_size = check_for_id3v2_tag(f))) { - vfs_fclose(f); - return vfs_fopen(filename,"rb"); + aud_vfs_fclose(f); + return aud_vfs_fopen(filename,"rb"); } if (file_has_id3v2_tag) @@ -107,10 +107,10 @@ shn_debug("Discarding %lu-byte ID3v2 tag at beginning of file '%s'.",tag_size+sizeof(_id3v2_header),filename); - if (0 != vfs_fseek(f,(long)tag_size,SEEK_CUR)) { + if (0 != aud_vfs_fseek(f,(long)tag_size,SEEK_CUR)) { shn_debug("Error while discarding ID3v2 tag in file '%s'.",filename); - vfs_fclose(f); - return vfs_fopen(filename,"rb"); + aud_vfs_fclose(f); + return aud_vfs_fopen(filename,"rb"); } return f; diff -r 5a6b60ceaa0f -r fa9f85cebade src/shnplug/seek.c --- a/src/shnplug/seek.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/shnplug/seek.c Sun Oct 07 00:25:33 2007 -0500 @@ -53,16 +53,16 @@ shn_debug("Looking for seek table in separate file: '%s'",filename); - if (!(f=vfs_fopen(filename,"rb"))) + if (!(f=aud_vfs_fopen(filename,"rb"))) { return 0; } - vfs_fseek(f,0,SEEK_END); - seek_table_len = (slong)vfs_ftell(f) - SEEK_HEADER_SIZE; - vfs_fseek(f,0,SEEK_SET); + aud_vfs_fseek(f,0,SEEK_END); + seek_table_len = (slong)aud_vfs_ftell(f) - SEEK_HEADER_SIZE; + aud_vfs_fseek(f,0,SEEK_SET); - if (vfs_fread((void *)this_shn->seek_header.data,1,SEEK_HEADER_SIZE,f) == SEEK_HEADER_SIZE) + if (aud_vfs_fread((void *)this_shn->seek_header.data,1,SEEK_HEADER_SIZE,f) == SEEK_HEADER_SIZE) { this_shn->seek_header.version = (slong)shn_uchar_to_ulong_le(this_shn->seek_header.data+4); this_shn->seek_header.shnFileSize = shn_uchar_to_ulong_le(this_shn->seek_header.data+8); @@ -76,7 +76,7 @@ if ((this_shn->seek_table = malloc(seek_table_len))) { - if (vfs_fread((void *)this_shn->seek_table,1,seek_table_len,f) == seek_table_len) + if (aud_vfs_fread((void *)this_shn->seek_table,1,seek_table_len,f) == seek_table_len) { shn_debug("Successfully loaded seek table in separate file: '%s'",filename); @@ -87,7 +87,7 @@ else this_shn->vars.seek_resolution = SEEK_RESOLUTION; - vfs_fclose(f); + aud_vfs_fclose(f); return 1; } @@ -95,7 +95,7 @@ } } - vfs_fclose(f); + aud_vfs_fclose(f); return 0; } @@ -114,21 +114,21 @@ break; } - vfs_fseek(this_shn->vars.fd,-(SEEK_TRAILER_SIZE+bytes_from_end),SEEK_END); - if (vfs_fread((void *)this_shn->seek_trailer.data,1,SEEK_TRAILER_SIZE,this_shn->vars.fd) == SEEK_TRAILER_SIZE) + aud_vfs_fseek(this_shn->vars.fd,-(SEEK_TRAILER_SIZE+bytes_from_end),SEEK_END); + if (aud_vfs_fread((void *)this_shn->seek_trailer.data,1,SEEK_TRAILER_SIZE,this_shn->vars.fd) == SEEK_TRAILER_SIZE) { this_shn->seek_trailer.seekTableSize = shn_uchar_to_ulong_le(this_shn->seek_trailer.data); if (memcmp(this_shn->seek_trailer.data+4,SEEK_TRAILER_SIGNATURE,strlen(SEEK_TRAILER_SIGNATURE)) == 0) { - vfs_fseek(this_shn->vars.fd,-(this_shn->seek_trailer.seekTableSize+bytes_from_end),SEEK_END); + aud_vfs_fseek(this_shn->vars.fd,-(this_shn->seek_trailer.seekTableSize+bytes_from_end),SEEK_END); this_shn->seek_trailer.seekTableSize -= (SEEK_HEADER_SIZE + SEEK_TRAILER_SIZE); - if (vfs_fread((void *)this_shn->seek_header.data,1,SEEK_HEADER_SIZE,this_shn->vars.fd) == SEEK_HEADER_SIZE) + if (aud_vfs_fread((void *)this_shn->seek_header.data,1,SEEK_HEADER_SIZE,this_shn->vars.fd) == SEEK_HEADER_SIZE) { this_shn->seek_header.version = (slong)shn_uchar_to_ulong_le(this_shn->seek_header.data+4); this_shn->seek_header.shnFileSize = shn_uchar_to_ulong_le(this_shn->seek_header.data+8); if ((this_shn->seek_table = malloc(this_shn->seek_trailer.seekTableSize))) { - if (vfs_fread((void *)this_shn->seek_table,1,this_shn->seek_trailer.seekTableSize,this_shn->vars.fd) == this_shn->seek_trailer.seekTableSize) + if (aud_vfs_fread((void *)this_shn->seek_table,1,this_shn->seek_trailer.seekTableSize,this_shn->vars.fd) == this_shn->seek_trailer.seekTableSize) { shn_debug("Successfully loaded seek table appended to file: '%s'",filename); diff -r 5a6b60ceaa0f -r fa9f85cebade src/shnplug/shn.c --- a/src/shnplug/shn.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/shnplug/shn.c Sun Oct 07 00:25:33 2007 -0500 @@ -223,7 +223,7 @@ version = MAX_VERSION + 1; while(version > MAX_VERSION) { - int byte = vfs_getc(this_shn->vars.fd); + int byte = aud_vfs_getc(this_shn->vars.fd); this_shn->vars.bytes_read++; if(byte == EOF) return 0; @@ -553,7 +553,7 @@ { if (this_shn->vars.fd) { - vfs_fclose(this_shn->vars.fd); + aud_vfs_fclose(this_shn->vars.fd); this_shn->vars.fd = NULL; } @@ -671,13 +671,13 @@ if (tmp_file->wave_header.file_has_id3v2_tag) { - vfs_fseek(tmp_file->vars.fd,tmp_file->wave_header.id3v2_tag_size,SEEK_SET); + aud_vfs_fseek(tmp_file->vars.fd,tmp_file->wave_header.id3v2_tag_size,SEEK_SET); tmp_file->vars.bytes_read += tmp_file->wave_header.id3v2_tag_size; tmp_file->vars.seek_offset = tmp_file->wave_header.id3v2_tag_size; } else { - vfs_fseek(tmp_file->vars.fd,0,SEEK_SET); + aud_vfs_fseek(tmp_file->vars.fd,0,SEEK_SET); } if (0 == shn_verify_header(tmp_file)) @@ -747,7 +747,7 @@ { char data[4]; - if (vfs_fread((void *)data,1,4,fd) != 4) + if (aud_vfs_fread((void *)data,1,4,fd) != 4) return FALSE; if (memcmp(data,MAGIC,4)) @@ -865,7 +865,7 @@ version = MAX_VERSION + 1; while(version > MAX_VERSION) { - int byte = vfs_getc(this_shn->vars.fd); + int byte = aud_vfs_getc(this_shn->vars.fd); if(byte == EOF) { shn_error_fatal(this_shn,"No magic number"); goto exit_thread; @@ -1142,8 +1142,8 @@ seekto_offset = shn_uchar_to_ulong_le(seek_info->data+8) + this_shn->vars.seek_offset; - vfs_fseek(this_shn->vars.fd,(slong)seekto_offset,SEEK_SET); - vfs_fread((uchar*) this_shn->decode_state->getbuf, 1, BUFSIZ, this_shn->vars.fd); + aud_vfs_fseek(this_shn->vars.fd,(slong)seekto_offset,SEEK_SET); + aud_vfs_fread((uchar*) this_shn->decode_state->getbuf, 1, BUFSIZ, this_shn->vars.fd); this_shn->decode_state->getbufp = this_shn->decode_state->getbuf + shn_uchar_to_ushort_le(seek_info->data+14); this_shn->decode_state->nbitget = shn_uchar_to_ushort_le(seek_info->data+16); @@ -1183,7 +1183,7 @@ if(maxnlpc > 0 && qlpc) free((void *) qlpc); - vfs_fseek(this_shn->vars.fd,0,SEEK_SET); + aud_vfs_fseek(this_shn->vars.fd,0,SEEK_SET); goto restart; } else @@ -1261,7 +1261,7 @@ return; } - vfs_fseek(shnfile->vars.fd,0,SEEK_SET); + aud_vfs_fseek(shnfile->vars.fd,0,SEEK_SET); playback->playing = TRUE; diff -r 5a6b60ceaa0f -r fa9f85cebade src/shnplug/shorten.h --- a/src/shnplug/shorten.h Sun Oct 07 00:23:19 2007 -0500 +++ b/src/shnplug/shorten.h Sun Oct 07 00:25:33 2007 -0500 @@ -166,7 +166,7 @@ extern int getc_exit_val; #define getc_exit(stream)\ -(((getc_exit_val = vfs_getc(stream)) == EOF) ? \ +(((getc_exit_val = aud_vfs_getc(stream)) == EOF) ? \ complain("FATALERROR: read failed: getc returns EOF"), 0: getc_exit_val) /************************/ diff -r 5a6b60ceaa0f -r fa9f85cebade src/shnplug/vario.c --- a/src/shnplug/vario.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/shnplug/vario.c Sun Oct 07 00:25:33 2007 -0500 @@ -50,7 +50,7 @@ { this_shn->vars.last_file_position = this_shn->vars.bytes_read; - bytes = vfs_fread((uchar*) this_shn->decode_state->getbuf, 1, BUFSIZ, this_shn->vars.fd); + bytes = aud_vfs_fread((uchar*) this_shn->decode_state->getbuf, 1, BUFSIZ, this_shn->vars.fd); this_shn->decode_state->nbyteget += bytes; if(this_shn->decode_state->nbyteget < 4) { diff -r 5a6b60ceaa0f -r fa9f85cebade src/sid/xs_init.c --- a/src/sid/xs_init.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/sid/xs_init.c Sun Oct 07 00:25:33 2007 -0500 @@ -43,7 +43,7 @@ .file_info_box = xs_fileinfo, /* Show file-information dialog */ .get_song_tuple = xs_get_song_tuple, /* Get Tuple */ - .vfs_extensions = xs_sid_fmts, /* File ext assist */ + .aud_vfs_extensions = xs_sid_fmts, /* File ext assist */ .probe_for_tuple = xs_probe_for_tuple }; diff -r 5a6b60ceaa0f -r fa9f85cebade src/sid/xs_support.h --- a/src/sid/xs_support.h Sun Oct 07 00:23:19 2007 -0500 +++ b/src/sid/xs_support.h Sun Oct 07 00:25:33 2007 -0500 @@ -70,14 +70,14 @@ #ifdef __AUDACIOUS_NEWVFS__ #include #define t_xs_file VFSFile -#define xs_fopen(a,b) vfs_fopen(a,b) -#define xs_fclose(a) vfs_fclose(a) -#define xs_fgetc(a) vfs_getc(a) -#define xs_fread(a,b,c,d) vfs_fread(a,b,c,d) -#define xs_feof(a) vfs_feof(a) +#define xs_fopen(a,b) aud_vfs_fopen(a,b) +#define xs_fclose(a) aud_vfs_fclose(a) +#define xs_fgetc(a) aud_vfs_getc(a) +#define xs_fread(a,b,c,d) aud_vfs_fread(a,b,c,d) +#define xs_feof(a) aud_vfs_feof(a) #define xs_ferror(a) (0) -#define xs_ftell(a) vfs_ftell(a) -#define xs_fseek(a,b,c) vfs_fseek(a,b,c) +#define xs_ftell(a) aud_vfs_ftell(a) +#define xs_fseek(a,b,c) aud_vfs_fseek(a,b,c) #else #define t_xs_file FILE t_xs_file *xs_fopen(const gchar *, const gchar *); diff -r 5a6b60ceaa0f -r fa9f85cebade src/smb/smb.c --- a/src/smb/smb.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/smb/smb.c Sun Oct 07 00:25:33 2007 -0500 @@ -41,7 +41,7 @@ } SMBFile; /* TODO: make writing work. */ -VFSFile *smb_vfs_fopen_impl(const gchar * path, const gchar * mode) +VFSFile *smb_aud_vfs_fopen_impl(const gchar * path, const gchar * mode) { VFSFile *file; SMBFile *handle; @@ -66,7 +66,7 @@ return file; } -gint smb_vfs_fclose_impl(VFSFile * file) +gint smb_aud_vfs_fclose_impl(VFSFile * file) { gint ret = 0; SMBFile *handle; @@ -85,7 +85,7 @@ return ret; } -size_t smb_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file) +size_t smb_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file) { SMBFile *handle; if (file == NULL) @@ -94,12 +94,12 @@ return smbc_read(handle->fd, ptr, size * nmemb); } -size_t smb_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file) +size_t smb_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file) { return 0; } -gint smb_vfs_getc_impl(VFSFile *file) +gint smb_aud_vfs_getc_impl(VFSFile *file) { SMBFile *handle; char temp; @@ -108,7 +108,7 @@ return (gint) temp; } -gint smb_vfs_fseek_impl(VFSFile * file, glong offset, gint whence) +gint smb_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence) { SMBFile *handle; glong roffset = offset; @@ -138,19 +138,19 @@ return ret; } -gint smb_vfs_ungetc_impl(gint c, VFSFile *file) +gint smb_aud_vfs_ungetc_impl(gint c, VFSFile *file) { - smb_vfs_fseek_impl(file, -1, SEEK_CUR); + smb_aud_vfs_fseek_impl(file, -1, SEEK_CUR); return c; } -void smb_vfs_rewind_impl(VFSFile * file) +void smb_aud_vfs_rewind_impl(VFSFile * file) { - smb_vfs_fseek_impl(file, 0, SEEK_SET); + smb_aud_vfs_fseek_impl(file, 0, SEEK_SET); } glong -smb_vfs_ftell_impl(VFSFile * file) +smb_aud_vfs_ftell_impl(VFSFile * file) { SMBFile *handle; handle = (SMBFile *)file->handle; @@ -158,25 +158,25 @@ } gboolean -smb_vfs_feof_impl(VFSFile * file) +smb_aud_vfs_feof_impl(VFSFile * file) { SMBFile *handle; off_t at; - at = smb_vfs_ftell_impl(file); + at = smb_aud_vfs_ftell_impl(file); //printf("%d %d %ld %ld\n",sizeof(int), sizeof(off_t), at, handle->length); return (gboolean) (at == handle->length) ? TRUE : FALSE; } gint -smb_vfs_truncate_impl(VFSFile * file, glong size) +smb_aud_vfs_truncate_impl(VFSFile * file, glong size) { return -1; } off_t -smb_vfs_fsize_impl(VFSFile * file) +smb_aud_vfs_fsize_impl(VFSFile * file) { SMBFile *handle = (SMBFile *)file->handle; @@ -185,18 +185,18 @@ VFSConstructor smb_const = { "smb://", - smb_vfs_fopen_impl, - smb_vfs_fclose_impl, - smb_vfs_fread_impl, - smb_vfs_fwrite_impl, - smb_vfs_getc_impl, - smb_vfs_ungetc_impl, - smb_vfs_fseek_impl, - smb_vfs_rewind_impl, - smb_vfs_ftell_impl, - smb_vfs_feof_impl, - smb_vfs_truncate_impl, - smb_vfs_fsize_impl + smb_aud_vfs_fopen_impl, + smb_aud_vfs_fclose_impl, + smb_aud_vfs_fread_impl, + smb_aud_vfs_fwrite_impl, + smb_aud_vfs_getc_impl, + smb_aud_vfs_ungetc_impl, + smb_aud_vfs_fseek_impl, + smb_aud_vfs_rewind_impl, + smb_aud_vfs_ftell_impl, + smb_aud_vfs_feof_impl, + smb_aud_vfs_truncate_impl, + smb_aud_vfs_fsize_impl }; static void init(void) @@ -210,13 +210,13 @@ return; } - vfs_register_transport(&smb_const); + aud_vfs_register_transport(&smb_const); } static void cleanup(void) { #if 0 - vfs_unregister_transport(&smb_const); + aud_vfs_unregister_transport(&smb_const); #endif } diff -r 5a6b60ceaa0f -r fa9f85cebade src/stdio/stdio.c --- a/src/stdio/stdio.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/stdio/stdio.c Sun Oct 07 00:25:33 2007 -0500 @@ -28,7 +28,7 @@ #include static gchar * -vfs_stdio_urldecode_path(const gchar * encoded_path) +aud_vfs_stdio_urldecode_path(const gchar * encoded_path) { const gchar *cur, *ext; gchar *path, *tmp; @@ -71,7 +71,7 @@ } VFSFile * -stdio_vfs_fopen_impl(const gchar * path, +stdio_aud_vfs_fopen_impl(const gchar * path, const gchar * mode) { VFSFile *file; @@ -80,7 +80,7 @@ if (!path || !mode) return NULL; - decpath = vfs_stdio_urldecode_path(path); + decpath = aud_vfs_stdio_urldecode_path(path); file = g_new(VFSFile, 1); @@ -98,7 +98,7 @@ } gint -stdio_vfs_fclose_impl(VFSFile * file) +stdio_aud_vfs_fclose_impl(VFSFile * file) { gint ret = 0; @@ -118,7 +118,7 @@ } size_t -stdio_vfs_fread_impl(gpointer ptr, +stdio_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file) @@ -134,7 +134,7 @@ } size_t -stdio_vfs_fwrite_impl(gconstpointer ptr, +stdio_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file) @@ -150,7 +150,7 @@ } gint -stdio_vfs_getc_impl(VFSFile *stream) +stdio_aud_vfs_getc_impl(VFSFile *stream) { FILE *handle = (FILE *) stream->handle; @@ -158,7 +158,7 @@ } gint -stdio_vfs_ungetc_impl(gint c, VFSFile *stream) +stdio_aud_vfs_ungetc_impl(gint c, VFSFile *stream) { FILE *handle = (FILE *) stream->handle; @@ -166,7 +166,7 @@ } gint -stdio_vfs_fseek_impl(VFSFile * file, +stdio_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence) { @@ -181,7 +181,7 @@ } void -stdio_vfs_rewind_impl(VFSFile * file) +stdio_aud_vfs_rewind_impl(VFSFile * file) { FILE *handle; @@ -194,7 +194,7 @@ } glong -stdio_vfs_ftell_impl(VFSFile * file) +stdio_aud_vfs_ftell_impl(VFSFile * file) { FILE *handle; @@ -207,7 +207,7 @@ } gboolean -stdio_vfs_feof_impl(VFSFile * file) +stdio_aud_vfs_feof_impl(VFSFile * file) { FILE *handle; @@ -220,7 +220,7 @@ } gint -stdio_vfs_truncate_impl(VFSFile * file, glong size) +stdio_aud_vfs_truncate_impl(VFSFile * file, glong size) { FILE *handle; @@ -233,7 +233,7 @@ } off_t -stdio_vfs_fsize_impl(VFSFile * file) +stdio_aud_vfs_fsize_impl(VFSFile * file) { FILE *handle; struct stat s; @@ -251,29 +251,29 @@ VFSConstructor file_const = { .uri_id = "file://", - .vfs_fopen_impl = stdio_vfs_fopen_impl, - .vfs_fclose_impl = stdio_vfs_fclose_impl, - .vfs_fread_impl = stdio_vfs_fread_impl, - .vfs_fwrite_impl = stdio_vfs_fwrite_impl, - .vfs_getc_impl = stdio_vfs_getc_impl, - .vfs_ungetc_impl = stdio_vfs_ungetc_impl, - .vfs_fseek_impl = stdio_vfs_fseek_impl, - .vfs_rewind_impl = stdio_vfs_rewind_impl, - .vfs_ftell_impl = stdio_vfs_ftell_impl, - .vfs_feof_impl = stdio_vfs_feof_impl, - .vfs_truncate_impl = stdio_vfs_truncate_impl, - .vfs_fsize_impl = stdio_vfs_fsize_impl + .aud_vfs_fopen_impl = stdio_aud_vfs_fopen_impl, + .aud_vfs_fclose_impl = stdio_aud_vfs_fclose_impl, + .aud_vfs_fread_impl = stdio_aud_vfs_fread_impl, + .aud_vfs_fwrite_impl = stdio_aud_vfs_fwrite_impl, + .aud_vfs_getc_impl = stdio_aud_vfs_getc_impl, + .aud_vfs_ungetc_impl = stdio_aud_vfs_ungetc_impl, + .aud_vfs_fseek_impl = stdio_aud_vfs_fseek_impl, + .aud_vfs_rewind_impl = stdio_aud_vfs_rewind_impl, + .aud_vfs_ftell_impl = stdio_aud_vfs_ftell_impl, + .aud_vfs_feof_impl = stdio_aud_vfs_feof_impl, + .aud_vfs_truncate_impl = stdio_aud_vfs_truncate_impl, + .aud_vfs_fsize_impl = stdio_aud_vfs_fsize_impl }; static void init(void) { - vfs_register_transport(&file_const); + aud_vfs_register_transport(&file_const); } static void cleanup(void) { #if 0 - vfs_unregister_transport(&file_const); + aud_vfs_unregister_transport(&file_const); #endif } diff -r 5a6b60ceaa0f -r fa9f85cebade src/timidity/libtimidity/common.c --- a/src/timidity/libtimidity/common.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/timidity/libtimidity/common.c Sun Oct 07 00:25:33 2007 -0500 @@ -51,7 +51,7 @@ /* First try the given name */ DEBUG_MSG("Trying to open %s\n", name); - if ((fp = vfs_fopen(g_filename_to_uri(name, NULL, NULL), OPEN_MODE))) + if ((fp = aud_vfs_fopen(g_filename_to_uri(name, NULL, NULL), OPEN_MODE))) return fp; if (name[0] != PATH_SEP) @@ -75,7 +75,7 @@ } strcat(current_filename, name); DEBUG_MSG("Trying to open %s\n", current_filename); - if ((fp = vfs_fopen(g_filename_to_uri(current_filename, NULL, NULL), OPEN_MODE))) + if ((fp = aud_vfs_fopen(g_filename_to_uri(current_filename, NULL, NULL), OPEN_MODE))) return fp; plp = plp->next; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/timidity/libtimidity/instrum.c --- a/src/timidity/libtimidity/instrum.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/timidity/libtimidity/instrum.c Sun Oct 07 00:25:33 2007 -0500 @@ -202,7 +202,7 @@ /* Read some headers and do cursory sanity checks. There are loads of magic offsets. This could be rewritten... */ - if ((239 != vfs_fread(tmp, 1, 239, fp)) || + if ((239 != aud_vfs_fread(tmp, 1, 239, fp)) || (memcmp(tmp, "GF1PATCH110\0ID#000002", 22) && memcmp(tmp, "GF1PATCH100\0ID#000002", 22))) /* don't know what the differences are */ @@ -236,18 +236,18 @@ uint8 tmpchar; #define READ_CHAR(thing) \ - if (1 != vfs_fread(&tmpchar, 1, 1, fp)) goto fail; \ + if (1 != aud_vfs_fread(&tmpchar, 1, 1, fp)) goto fail; \ thing = tmpchar; #define READ_SHORT(thing) \ - if (1 != vfs_fread(&tmpshort, 2, 1, fp)) goto fail; \ + if (1 != aud_vfs_fread(&tmpshort, 2, 1, fp)) goto fail; \ thing = SWAPLE16(tmpshort); #define READ_LONG(thing) \ - if (1 != vfs_fread(&tmplong, 4, 1, fp)) goto fail; \ + if (1 != aud_vfs_fread(&tmplong, 4, 1, fp)) goto fail; \ thing = SWAPLE32(tmplong); - vfs_fseek(fp, 7, SEEK_CUR); /* Skip the wave name */ + aud_vfs_fseek(fp, 7, SEEK_CUR); /* Skip the wave name */ - if (1 != vfs_fread(&fractions, 1, 1, fp)) + if (1 != aud_vfs_fread(&fractions, 1, 1, fp)) { fail: DEBUG_MSG("Error reading sample %d\n", i); @@ -269,7 +269,7 @@ READ_LONG(sp->root_freq); sp->low_vel = 0; sp->high_vel = 127; - vfs_fseek(fp, 2, SEEK_CUR); /* Why have a "root frequency" and then + aud_vfs_fseek(fp, 2, SEEK_CUR); /* Why have a "root frequency" and then * "tuning"?? */ READ_CHAR(tmp[0]); @@ -280,7 +280,7 @@ sp->panning=(uint8)(panning & 0x7F); /* envelope, tremolo, and vibrato */ - if (18 != vfs_fread(tmp, 1, 18, fp)) goto fail; + if (18 != aud_vfs_fread(tmp, 1, 18, fp)) goto fail; if (!tmp[13] || !tmp[14]) { @@ -318,7 +318,7 @@ READ_CHAR(sp->modes); - vfs_fseek(fp, 40, SEEK_CUR); /* skip the useless scale frequency, scale + aud_vfs_fseek(fp, 40, SEEK_CUR); /* skip the useless scale frequency, scale factor (what's it mean?), and reserved space */ @@ -392,7 +392,7 @@ /* Then read the sample data */ sp->data = safe_malloc(sp->data_length); - if (1 != vfs_fread(sp->data, sp->data_length, 1, fp)) + if (1 != aud_vfs_fread(sp->data, sp->data_length, 1, fp)) goto fail; if (!(sp->modes & MODES_16BIT)) /* convert to 16-bit data */ @@ -507,7 +507,7 @@ } } - vfs_fclose(fp); + aud_vfs_fclose(fp); return ip; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/timidity/libtimidity/stream.c --- a/src/timidity/libtimidity/stream.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/timidity/libtimidity/stream.c Sun Oct 07 00:25:33 2007 -0500 @@ -22,7 +22,7 @@ size_t stdio_istream_read (void *ctx, void *ptr, size_t size, size_t nmemb) { - return vfs_fread (ptr, size, nmemb, ((StdIOContext *) ctx)->fp); + return aud_vfs_fread (ptr, size, nmemb, ((StdIOContext *) ctx)->fp); } int @@ -30,7 +30,7 @@ { int ret = 0; if (((StdIOContext *) ctx)->autoclose) - ret = vfs_fclose (((StdIOContext *) ctx)->fp); + ret = aud_vfs_fclose (((StdIOContext *) ctx)->fp); free (ctx); return ret; } @@ -101,7 +101,7 @@ { VFSFile *fp; - fp = vfs_fopen (file, "rb"); + fp = aud_vfs_fopen (file, "rb"); if (fp == NULL) return NULL; diff -r 5a6b60ceaa0f -r fa9f85cebade src/timidity/libtimidity/timidity.c --- a/src/timidity/libtimidity/timidity.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/timidity/libtimidity/timidity.c Sun Oct 07 00:25:33 2007 -0500 @@ -51,7 +51,7 @@ while (num_read < size && !newline) { - if (vfs_fread(&s[num_read], 1, 1, fp) != 1) + if (aud_vfs_fread(&s[num_read], 1, 1, fp) != 1) break; /* Unlike fgets(), don't store newline. Under Windows/DOS we'll @@ -387,7 +387,7 @@ } } } - vfs_fclose(fp); + aud_vfs_fclose(fp); return 0; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/timidity/xmms-timidity.c --- a/src/timidity/xmms-timidity.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/timidity/xmms-timidity.c Sun Oct 07 00:25:33 2007 -0500 @@ -223,7 +223,7 @@ { gchar magic_bytes[4]; - vfs_fread( magic_bytes , 1 , 4 , fp ); + aud_vfs_fread( magic_bytes , 1 , 4 , fp ); if ( !memcmp( magic_bytes , "MThd" , 4 ) ) return TRUE; @@ -232,8 +232,8 @@ { /* skip the four bytes after RIFF, then read the next four */ - vfs_fseek( fp , 4 , SEEK_CUR ); - vfs_fread( magic_bytes , 1 , 4 , fp ); + aud_vfs_fseek( fp , 4 , SEEK_CUR ); + aud_vfs_fread( magic_bytes , 1 , 4 , fp ); if ( !memcmp( magic_bytes , "RMID" , 4 ) ) return TRUE; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/tta/libtta.c --- a/src/tta/libtta.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/tta/libtta.c Sun Oct 07 00:25:33 2007 -0500 @@ -92,7 +92,7 @@ .get_song_info = get_song_info, .file_info_box = file_info, .get_song_tuple = get_song_tuple, - .vfs_extensions = tta_fmts, + .aud_vfs_extensions = tta_fmts, .mseek = mseek, }; @@ -106,11 +106,11 @@ VFSFile *f; size_t size = -1; - if ((f = vfs_fopen (filename, "r"))) + if ((f = aud_vfs_fopen (filename, "r"))) { - vfs_fseek (f, 0, SEEK_END); - size = vfs_ftell (f); - vfs_fclose (f); + aud_vfs_fseek (f, 0, SEEK_END); + size = aud_vfs_ftell (f); + aud_vfs_fclose (f); } return size; } @@ -553,7 +553,7 @@ ttainfo = g_malloc0(sizeof(tta_info)); - if((file = vfs_fopen(filename, "rb")) != NULL) { + if((file = aud_vfs_fopen(filename, "rb")) != NULL) { if(open_tta_file(filename, ttainfo, 0) >= 0) { tuple = aud_tuple_new_from_filename(filename); @@ -584,7 +584,7 @@ } close_tta_file (ttainfo); } - vfs_fclose(file); + aud_vfs_fclose(file); } return tuple; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/tta/ttadec.c --- a/src/tta/ttadec.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/tta/ttadec.c Sun Oct 07 00:25:33 2007 -0500 @@ -87,7 +87,7 @@ __inline void get_binary(unsigned int *value, unsigned int bits) { while (bit_count < bits) { if (bitpos == iso_buffers_end) { - int res = vfs_fread(isobuffers, 1, + int res = aud_vfs_fread(isobuffers, 1, ISO_BUFFERS_SIZE, ttainfo->HANDLE); if (!res) { ttainfo->STATE = READ_ERROR; @@ -113,7 +113,7 @@ while (!(bit_cache ^ bit_mask[bit_count])) { if (bitpos == iso_buffers_end) { - int res = vfs_fread(isobuffers, 1, + int res = aud_vfs_fread(isobuffers, 1, ISO_BUFFERS_SIZE, ttainfo->HANDLE); if (!res) { ttainfo->STATE = READ_ERROR; @@ -145,7 +145,7 @@ rbytes = iso_buffers_end - bitpos; if (rbytes < sizeof(int)) { memcpy(isobuffers, bitpos, 4); - res = vfs_fread(isobuffers + rbytes, 1, + res = aud_vfs_fread(isobuffers + rbytes, 1, ISO_BUFFERS_SIZE - rbytes, ttainfo->HANDLE); if (!res) { ttainfo->STATE = READ_ERROR; @@ -260,7 +260,7 @@ } __ATTRIBUTE_PACKED__ id3v2; unsigned int len = 0; - if (!vfs_fread(&id3v2, sizeof(id3v2), 1, ttainfo->HANDLE) || + if (!aud_vfs_fread(&id3v2, sizeof(id3v2), 1, ttainfo->HANDLE) || memcmp(id3v2.id, "ID3", 3) || id3v2.size[0] & 0x80) { @@ -286,7 +286,7 @@ // clear the memory memset (info, 0, sizeof(tta_info)); - info->HANDLE = infile = vfs_fopen(filename, "rb"); + info->HANDLE = infile = aud_vfs_fopen(filename, "rb"); if (!infile) return OPEN_ERROR; // read id3v2 header @@ -294,18 +294,18 @@ // data_offset = id3v2_header_length(info); data_offset = get_id3_tags (filename, info); - vfs_fseek (infile, data_offset, SEEK_SET); + aud_vfs_fseek (infile, data_offset, SEEK_SET); // read TTA header - if (vfs_fread (&ttahdr, 1, sizeof (ttahdr), infile) == 0) { - vfs_fclose (infile); + if (aud_vfs_fread (&ttahdr, 1, sizeof (ttahdr), infile) == 0) { + aud_vfs_fclose (infile); info->STATE = READ_ERROR; return -1; } // check for TTA3 signature if (ENDSWAP_INT32(ttahdr.TTAid) != TTA1_SIGN) { - vfs_fclose (infile); + aud_vfs_fclose (infile); info->STATE = FORMAT_ERROR; return -1; } @@ -314,7 +314,7 @@ checksum = crc32((unsigned char *) &ttahdr, sizeof(tta_hdr) - sizeof(int)); if (checksum != ttahdr.CRC32) { - vfs_fclose (infile); + aud_vfs_fclose (infile); info->STATE = FILE_ERROR; return -1; } @@ -338,7 +338,7 @@ ttahdr.SampleRate != 64000 && ttahdr.SampleRate != 88200 && ttahdr.SampleRate != 96000)) { - vfs_fclose (infile); + aud_vfs_fclose (infile); info->STATE = FORMAT_ERROR; return FORMAT_ERROR; } @@ -398,7 +398,7 @@ } seek_pos = ttainfo->DATAPOS + seek_table[data_pos = pos]; - vfs_fseek(ttainfo->HANDLE, seek_pos, SEEK_SET); + aud_vfs_fseek(ttainfo->HANDLE, seek_pos, SEEK_SET); data_cur = 0; framelen = 0; @@ -432,7 +432,7 @@ } // read seek table - if (!vfs_fread(seek_table, st_size, 1, ttainfo->HANDLE)) { + if (!aud_vfs_fread(seek_table, st_size, 1, ttainfo->HANDLE)) { ttainfo->STATE = READ_ERROR; return -1; } @@ -455,7 +455,7 @@ void close_tta_file (tta_info *info) { if (info->HANDLE) { - vfs_fclose (info->HANDLE); + aud_vfs_fclose (info->HANDLE); info->HANDLE = NULL; } } diff -r 5a6b60ceaa0f -r fa9f85cebade src/tta/ttalib.h --- a/src/tta/ttalib.h Sun Oct 07 00:23:19 2007 -0500 +++ b/src/tta/ttalib.h Sun Oct 07 00:25:33 2007 -0500 @@ -34,13 +34,13 @@ // audacious support #define FILE VFSFile -#define fopen vfs_fopen -#define fclose vfs_fclose -#define fwrite vfs_fwrite -#define fread vfs_fread -#define frewind vfs_frewind -#define ftell vfs_ftell -#define fseek vfs_fseek +#define fopen aud_vfs_fopen +#define fclose aud_vfs_fclose +#define fwrite aud_vfs_fwrite +#define fread aud_vfs_fread +#define frewind aud_vfs_frewind +#define ftell aud_vfs_ftell +#define fseek aud_vfs_fseek #define MAX_BPS 24 // Max supported Bit resolution #define MAX_NCH 8 // Max supported number of channels diff -r 5a6b60ceaa0f -r fa9f85cebade src/vorbis/fileinfo.c --- a/src/vorbis/fileinfo.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/vorbis/fileinfo.c Sun Oct 07 00:25:33 2007 -0500 @@ -359,7 +359,7 @@ static gint init_files(vcedit_state * state) { - if ((vte.in = vfs_fopen(vte.filename, "rb")) == NULL) { + if ((vte.in = aud_vfs_fopen(vte.filename, "rb")) == NULL) { #ifdef DEBUG g_message("fileinfo.c: couldn't open file %s", vte.filename); #endif @@ -371,7 +371,7 @@ g_message("fileinfo.c: couldn't open file for editing %s", vte.filename); #endif - vfs_fclose(vte.in); + aud_vfs_fclose(vte.in); return -1; } @@ -394,7 +394,7 @@ if ((ofh = mkstemp(tmpfn)) < 0) { g_free(tmpfn); - vfs_fclose(vte.in); + aud_vfs_fclose(vte.in); #ifdef DEBUG g_critical("fileinfo.c: couldn't create temp file"); #endif @@ -406,11 +406,11 @@ #endif } - if ((out = vfs_fopen(tmpfn, "wb")) == NULL) { + if ((out = aud_vfs_fopen(tmpfn, "wb")) == NULL) { close(ofh); remove(tmpfn); g_free(tmpfn); - vfs_fclose(vte.in); + aud_vfs_fclose(vte.in); #ifdef DEBUG g_critical("fileinfo.c: couldn't open temp file"); #endif @@ -429,9 +429,9 @@ retval = -1; } - vfs_fclose(vte.in); + aud_vfs_fclose(vte.in); - if (vfs_fclose(out) != 0) { + if (aud_vfs_fclose(out) != 0) { #ifdef DEBUG g_critical("fileinfo.c: couldn't close out file"); #endif @@ -927,7 +927,7 @@ gtk_label_set_text(GTK_LABEL(filesize_label), _("File size:")); gtk_label_set_text(GTK_LABEL(filesize_label_val), _("N/A")); - if ((fh->fd = vfs_fopen(vte.filename, "r")) != NULL) { + if ((fh->fd = aud_vfs_fopen(vte.filename, "r")) != NULL) { g_mutex_lock(vf_mutex); if (ov_open_callbacks(fh, &vf, NULL, 0, vorbis_callbacks) == 0) { @@ -951,8 +951,8 @@ time = ov_time_total(&vf, -1); minutes = time / 60; seconds = time % 60; - vfs_fseek(fh->fd, 0, SEEK_END); - filesize = vfs_ftell(fh->fd); + aud_vfs_fseek(fh->fd, 0, SEEK_END); + filesize = aud_vfs_ftell(fh->fd); label_set_text(GTK_LABEL(bitrate_label_val), _("%d KBit/s (nominal)"), bitrate); @@ -965,7 +965,7 @@ } else - vfs_fclose(fh->fd); + aud_vfs_fclose(fh->fd); } rg_track_gain = get_comment(comment, "replaygain_track_gain"); @@ -1048,7 +1048,7 @@ g_mutex_unlock(vf_mutex); - gtk_widget_set_sensitive(tag_frame, vfs_is_writeable(vte.filename)); + gtk_widget_set_sensitive(tag_frame, aud_vfs_is_writeable(vte.filename)); g_signal_connect_swapped(title_entry, "changed", change_buttons, save_button); diff -r 5a6b60ceaa0f -r fa9f85cebade src/vorbis/vcedit.c --- a/src/vorbis/vcedit.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/vorbis/vcedit.c Sun Oct 07 00:25:33 2007 -0500 @@ -179,8 +179,8 @@ vcedit_open(vcedit_state * state, VFSFile * in) { return vcedit_open_callbacks(state, (void *) in, - (vcedit_read_func) vfs_fread, - (vcedit_write_func) vfs_fwrite); + (vcedit_read_func) aud_vfs_fread, + (vcedit_write_func) aud_vfs_fwrite); } int diff -r 5a6b60ceaa0f -r fa9f85cebade src/vorbis/vorbis.c --- a/src/vorbis/vorbis.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/vorbis/vorbis.c Sun Oct 07 00:25:33 2007 -0500 @@ -108,7 +108,7 @@ .file_info_box = vorbis_file_info_box, /* file info box, tag editing */ .get_song_tuple = get_song_tuple, .is_our_file_from_vfs = vorbis_check_fd, - .vfs_extensions = vorbis_fmts, + .aud_vfs_extensions = vorbis_fmts, }; InputPlugin *vorbis_iplist[] = { &vorbis_ip, NULL }; @@ -134,7 +134,7 @@ gint result; VFSVorbisFile *fd; - if (!(stream = vfs_fopen(filename, "r"))) { + if (!(stream = aud_vfs_fopen(filename, "r"))) { return FALSE; } @@ -160,7 +160,7 @@ g_message("** vorbis.c: Media read error: %s", filename); #endif g_mutex_unlock(vf_mutex); - vfs_fclose(stream); + aud_vfs_fclose(stream); return FALSE; break; case OV_ENOTVORBIS: @@ -168,7 +168,7 @@ g_message("** vorbis.c: Not Vorbis data: %s", filename); #endif g_mutex_unlock(vf_mutex); - vfs_fclose(stream); + aud_vfs_fclose(stream); return FALSE; break; case OV_EVERSION: @@ -176,7 +176,7 @@ g_message("** vorbis.c: Version mismatch: %s", filename); #endif g_mutex_unlock(vf_mutex); - vfs_fclose(stream); + aud_vfs_fclose(stream); return FALSE; break; case OV_EBADHEADER: @@ -185,7 +185,7 @@ filename); #endif g_mutex_unlock(vf_mutex); - vfs_fclose(stream); + aud_vfs_fclose(stream); return FALSE; break; case OV_EFAULT: @@ -194,7 +194,7 @@ filename); #endif g_mutex_unlock(vf_mutex); - vfs_fclose(stream); + aud_vfs_fclose(stream); return FALSE; break; case 0: @@ -423,7 +423,7 @@ memset(&vf, 0, sizeof(vf)); - if ((stream = vfs_fopen(filename, "r")) == NULL) { + if ((stream = aud_vfs_fopen(filename, "r")) == NULL) { playback->eof = TRUE; goto play_cleanup; } @@ -775,7 +775,7 @@ gboolean is_stream = FALSE; VFSVorbisFile *fd = NULL; - if ((stream = vfs_fopen(filename, "r")) == NULL) + if ((stream = aud_vfs_fopen(filename, "r")) == NULL) return NULL; fd = g_new0(VFSVorbisFile, 1); @@ -788,7 +788,7 @@ */ if (ov_open_callbacks(fd, &vfile, NULL, 0, vorbis_callbacks) < 0) { if (is_stream == FALSE) - vfs_fclose(stream); + aud_vfs_fclose(stream); return NULL; } @@ -816,7 +816,7 @@ displaytitle = aud_tuple_formatter_make_title_string(input, vorbis_cfg.tag_override ? vorbis_cfg.tag_format : get_gentitle_format()); - if ((tmp = vfs_get_metadata(((VFSVorbisFile *) vorbisfile->datasource)->fd, "stream-name")) != NULL) + if ((tmp = aud_vfs_get_metadata(((VFSVorbisFile *) vorbisfile->datasource)->fd, "stream-name")) != NULL) { gchar *old = displaytitle; @@ -970,7 +970,7 @@ { VFSVorbisFile *handle = (VFSVorbisFile *) datasource; - return vfs_fread(ptr, size, nmemb, handle->fd); + return aud_vfs_fread(ptr, size, nmemb, handle->fd); } static int @@ -978,7 +978,7 @@ { VFSVorbisFile *handle = (VFSVorbisFile *) datasource; - return vfs_fseek(handle->fd, offset, whence); + return aud_vfs_fseek(handle->fd, offset, whence); } static int @@ -990,7 +990,7 @@ if (handle->probe == FALSE) { - ret = vfs_fclose(handle->fd); + ret = aud_vfs_fclose(handle->fd); // g_free(handle); // it causes double free. i'm not really sure that commenting out at here is correct. --yaz } @@ -1002,5 +1002,5 @@ { VFSVorbisFile *handle = (VFSVorbisFile *) datasource; - return vfs_ftell(handle->fd); + return aud_vfs_ftell(handle->fd); } diff -r 5a6b60ceaa0f -r fa9f85cebade src/vtx/vtx.c --- a/src/vtx/vtx.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/vtx/vtx.c Sun Oct 07 00:25:33 2007 -0500 @@ -75,7 +75,7 @@ { char buf[2]; - vfs_fread (buf, 2, 1, fp); + aud_vfs_fread (buf, 2, 1, fp); return (!strncasecmp (buf, "ay", 2) || !strncasecmp (buf, "ym", 2)); } @@ -85,9 +85,9 @@ gboolean ret; VFSFile *fp; - fp = vfs_fopen(filename, "rb"); + fp = aud_vfs_fopen(filename, "rb"); ret = vtx_is_our_fd(filename, fp); - vfs_fclose(fp); + aud_vfs_fclose(fp); return ret; } @@ -320,7 +320,7 @@ .file_info_box = vtx_file_info, /* Show file-information dialog */ .get_song_tuple = vtx_get_song_tuple, /* Tuple */ .is_our_file_from_vfs = vtx_is_our_fd, /* VFS */ - .vfs_extensions = vtx_fmts /* ext assist */ + .aud_vfs_extensions = vtx_fmts /* ext assist */ }; InputPlugin *vtx_iplist[] = { &vtx_ip, NULL }; diff -r 5a6b60ceaa0f -r fa9f85cebade src/vtx/vtxfile.c --- a/src/vtx/vtxfile.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/vtx/vtxfile.c Sun Oct 07 00:25:33 2007 -0500 @@ -17,7 +17,7 @@ static int read_byte(VFSFile *fp, int *p) { int c; - if ((c = vfs_getc(fp)) == EOF) { + if ((c = aud_vfs_getc(fp)) == EOF) { perror("libayemu: read_byte()"); return 1; } @@ -31,13 +31,13 @@ static int read_word16(VFSFile *fp, int *p) { int c; - if ((c = vfs_getc(fp)) == EOF) { + if ((c = aud_vfs_getc(fp)) == EOF) { perror("libayemu: read_word16()"); return 1; } *p = c; - if ((c = vfs_getc(fp)) == EOF) { + if ((c = aud_vfs_getc(fp)) == EOF) { perror("libayemu: read_word16()"); return 1; } @@ -53,25 +53,25 @@ { int c; - if ((c = vfs_getc(fp)) == EOF) { + if ((c = aud_vfs_getc(fp)) == EOF) { perror("libayemu: read_word32()"); return 1; } *p = c; - if ((c = vfs_getc(fp)) == EOF) { + if ((c = aud_vfs_getc(fp)) == EOF) { perror("libayemu: read_word32()"); return 1; } *p += c << 8; - if ((c = vfs_getc(fp)) == EOF) { + if ((c = aud_vfs_getc(fp)) == EOF) { perror("libayemu: read_word32()"); return 1; } *p += c << 16; - if ((c = vfs_getc(fp)) == EOF) { + if ((c = aud_vfs_getc(fp)) == EOF) { perror("libayemu: read_word32()"); return 1; } @@ -86,7 +86,7 @@ static int read_NTstring(VFSFile *fp, char s[]) { int i, c; - for (i = 0 ; i < AYEMU_VTX_NTSTRING_MAX && (c = vfs_getc(fp)) != EOF && c ; i++) + for (i = 0 ; i < AYEMU_VTX_NTSTRING_MAX && (c = aud_vfs_getc(fp)) != EOF && c ; i++) s[i] = c; s[i] = '\0'; if (c == EOF) { @@ -109,12 +109,12 @@ vtx->regdata = NULL; - if ((vtx->fp = vfs_fopen (filename, "rb")) == NULL) { + if ((vtx->fp = aud_vfs_fopen (filename, "rb")) == NULL) { fprintf(stderr, "ayemu_vtx_open: Cannot open file %s: %s\n", filename, strerror(errno)); return 0; } - if (vfs_fread(buf, 2, 1, vtx->fp) != 1) { + if (aud_vfs_fread(buf, 2, 1, vtx->fp) != 1) { fprintf(stderr,"ayemu_vtx_open: Can't read from %s: %s\n", filename, strerror(errno)); error = 1; } @@ -149,7 +149,7 @@ if (!error) error = read_NTstring (vtx->fp, vtx->hdr.comment); if (error) { - vfs_fclose(vtx->fp); + aud_vfs_fclose(vtx->fp); vtx->fp = NULL; } return !error; @@ -175,19 +175,19 @@ buf_alloc = 4096; packed_data = (char *) malloc (buf_alloc); /* read packed AY register data to end of file. */ - while ((c = vfs_getc (vtx->fp)) != EOF) { + while ((c = aud_vfs_getc (vtx->fp)) != EOF) { if (buf_alloc < packed_size) { buf_alloc *= 2; packed_data = (char *) realloc (packed_data, buf_alloc); if (packed_data == NULL) { fprintf (stderr, "ayemu_vtx_load_data: Packed data out of memory!\n"); - vfs_fclose (vtx->fp); + aud_vfs_fclose (vtx->fp); return NULL; } } packed_data[packed_size++] = c; } - vfs_fclose (vtx->fp); + aud_vfs_fclose (vtx->fp); vtx->fp = NULL; if ((vtx->regdata = (char *) malloc (vtx->hdr.regdata_size)) == NULL) { fprintf (stderr, "ayemu_vtx_load_data: Can allocate %d bytes for unpack register data\n", vtx->hdr.regdata_size); @@ -316,7 +316,7 @@ void ayemu_vtx_free (ayemu_vtx_t *vtx) { if (vtx->fp) { - vfs_fclose(vtx->fp); + aud_vfs_fclose(vtx->fp); vtx->fp = NULL; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/wav/wav.c --- a/src/wav/wav.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/wav/wav.c Sun Oct 07 00:25:33 2007 -0500 @@ -43,7 +43,7 @@ .seek = seek, .get_time = get_time, .get_song_info = get_song_info, - .vfs_extensions = wav_fmts, + .aud_vfs_extensions = wav_fmts, .mseek = mseek, }; @@ -65,7 +65,7 @@ static gint read_n_bytes(VFSFile * file, guint8 * buf, gsize n) { - if (vfs_fread(buf, 1, n, file) != n) { + if (aud_vfs_fread(buf, 1, n, file) != n) { return FALSE; } return TRUE; @@ -94,21 +94,21 @@ guint32 head; glong seek; - if (!(file = vfs_fopen(filename, "rb"))) { /* Could not open file */ + if (!(file = aud_vfs_fopen(filename, "rb"))) { /* Could not open file */ return 0; } if (!(read_n_bytes(file, buf, 4))) { - vfs_fclose(file); + aud_vfs_fclose(file); return 0; } head = convert_to_header(buf); if (head == ('R' << 24) + ('I' << 16) + ('F' << 8) + 'F') { /* Found a riff -- maybe WAVE */ - if (vfs_fseek(file, 4, SEEK_CUR) != 0) { /* some error occured */ - vfs_fclose(file); + if (aud_vfs_fseek(file, 4, SEEK_CUR) != 0) { /* some error occured */ + aud_vfs_fclose(file); return 0; } if (!(read_n_bytes(file, buf, 4))) { - vfs_fclose(file); + aud_vfs_fclose(file); return 0; } head = convert_to_header(buf); @@ -120,18 +120,18 @@ We'll skip all chunks until we find the "data"-one which could contain mpeg-data */ if (seek != 0) { - if (vfs_fseek(file, seek, SEEK_CUR) != 0) { /* some error occured */ - vfs_fclose(file); + if (aud_vfs_fseek(file, seek, SEEK_CUR) != 0) { /* some error occured */ + aud_vfs_fclose(file); return 0; } } if (!(read_n_bytes(file, buf, 4))) { - vfs_fclose(file); + aud_vfs_fclose(file); return 0; } head = convert_to_header(buf); if (!(read_n_bytes(file, buf, 4))) { - vfs_fclose(file); + aud_vfs_fclose(file); return 0; } seek = convert_to_long(buf); @@ -139,13 +139,13 @@ if (seek >= 2 && head == ('f' << 24) + ('m' << 16) + ('t' << 8) + ' ') { if (!(read_n_bytes(file, buf, 2))) { - vfs_fclose(file); + aud_vfs_fclose(file); return 0; } wavid = buf[0] + 256 * buf[1]; seek -= 2; /* we could go on looking for other things, but all we wanted was the wavid */ - vfs_fclose(file); + aud_vfs_fclose(file); return wavid; } } @@ -155,7 +155,7 @@ /* it's RIFF */ } /* it's not even RIFF */ - vfs_fclose(file); + aud_vfs_fclose(file); return 0; } @@ -201,7 +201,7 @@ { guchar buf[4]; - if (vfs_fread(buf, 1, 4, file) != 4) + if (aud_vfs_fread(buf, 1, 4, file) != 4) return 0; *ret = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; @@ -215,7 +215,7 @@ { guchar buf[2]; - if (vfs_fread(buf, 1, 2, file) != 2) + if (aud_vfs_fread(buf, 1, 2, file) != 2) return 0; *ret = (buf[1] << 8) | buf[0]; @@ -240,7 +240,7 @@ if (wav_file->length - wav_file->position < bytes) bytes = wav_file->length - wav_file->position; if (bytes > 0) { - actual_read = vfs_fread(data, 1, bytes, wav_file->file); + actual_read = aud_vfs_fread(data, 1, bytes, wav_file->file); if (actual_read == 0) playback->eof = TRUE; @@ -267,14 +267,14 @@ if (wav_file->seek_to != -1) { wav_file->position = (unsigned long)((gint64)wav_file->seek_to * (gint64)rate / 1000L); - vfs_fseek(wav_file->file, + aud_vfs_fseek(wav_file->file, wav_file->position + wav_file->data_offset, SEEK_SET); playback->output->flush(wav_file->seek_to); wav_file->seek_to = -1; } } - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); return NULL; } @@ -289,36 +289,36 @@ audio_error = FALSE; wav_file = g_new0(WaveFile, 1); - if ((wav_file->file = vfs_fopen(filename, "rb"))) { - vfs_fread(magic, 1, 4, wav_file->file); + if ((wav_file->file = aud_vfs_fopen(filename, "rb"))) { + aud_vfs_fread(magic, 1, 4, wav_file->file); if (strncmp(magic, "RIFF", 4)) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } read_le_ulong(wav_file->file, &len); - vfs_fread(magic, 1, 4, wav_file->file); + aud_vfs_fread(magic, 1, 4, wav_file->file); if (strncmp(magic, "WAVE", 4)) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } for (;;) { - vfs_fread(magic, 1, 4, wav_file->file); + aud_vfs_fread(magic, 1, 4, wav_file->file); if (!read_le_ulong(wav_file->file, &len)) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } if (!strncmp("fmt ", magic, 4)) break; - vfs_fseek(wav_file->file, len, SEEK_CUR); + aud_vfs_fseek(wav_file->file, len, SEEK_CUR); } if (len < 16) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; @@ -335,7 +335,7 @@ case IBM_FORMAT_MULAW: case IBM_FORMAT_ALAW: case IBM_FORMAT_ADPCM: - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; @@ -346,29 +346,29 @@ read_le_short(wav_file->file, &wav_file->block_align); read_le_short(wav_file->file, &wav_file->bits_per_sample); if (wav_file->bits_per_sample != 8 && wav_file->bits_per_sample != 16) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } len -= 16; if (len) - vfs_fseek(wav_file->file, len, SEEK_CUR); + aud_vfs_fseek(wav_file->file, len, SEEK_CUR); for (;;) { - vfs_fread(magic, 4, 1, wav_file->file); + aud_vfs_fread(magic, 4, 1, wav_file->file); if (!read_le_ulong(wav_file->file, &len)) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } if (!strncmp("data", magic, 4)) break; - vfs_fseek(wav_file->file, len, SEEK_CUR); + aud_vfs_fseek(wav_file->file, len, SEEK_CUR); } - wav_file->data_offset = vfs_ftell(wav_file->file); + wav_file->data_offset = aud_vfs_ftell(wav_file->file); wav_file->length = len; wav_file->position = 0; @@ -379,7 +379,7 @@ 16) ? FMT_S16_LE : FMT_U8, wav_file->samples_per_sec, wav_file->channels) == 0) { audio_error = TRUE; - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; @@ -459,38 +459,38 @@ wav_file = g_malloc(sizeof(WaveFile)); memset(wav_file, 0, sizeof(WaveFile)); - if (!(wav_file->file = vfs_fopen(filename, "rb"))) + if (!(wav_file->file = aud_vfs_fopen(filename, "rb"))) return; - vfs_fread(magic, 1, 4, wav_file->file); + aud_vfs_fread(magic, 1, 4, wav_file->file); if (strncmp(magic, "RIFF", 4)) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } read_le_ulong(wav_file->file, &len); - vfs_fread(magic, 1, 4, wav_file->file); + aud_vfs_fread(magic, 1, 4, wav_file->file); if (strncmp(magic, "WAVE", 4)) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } for (;;) { - vfs_fread(magic, 1, 4, wav_file->file); + aud_vfs_fread(magic, 1, 4, wav_file->file); if (!read_le_ulong(wav_file->file, &len)) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } if (!strncmp("fmt ", magic, 4)) break; - vfs_fseek(wav_file->file, len, SEEK_CUR); + aud_vfs_fseek(wav_file->file, len, SEEK_CUR); } if (len < 16) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; @@ -507,7 +507,7 @@ case IBM_FORMAT_MULAW: case IBM_FORMAT_ALAW: case IBM_FORMAT_ADPCM: - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; @@ -518,27 +518,27 @@ read_le_short(wav_file->file, &wav_file->block_align); read_le_short(wav_file->file, &wav_file->bits_per_sample); if (wav_file->bits_per_sample != 8 && wav_file->bits_per_sample != 16) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } len -= 16; if (len) - vfs_fseek(wav_file->file, len, SEEK_CUR); + aud_vfs_fseek(wav_file->file, len, SEEK_CUR); for (;;) { - vfs_fread(magic, 4, 1, wav_file->file); + aud_vfs_fread(magic, 4, 1, wav_file->file); if (!read_le_ulong(wav_file->file, &len)) { - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; return; } if (!strncmp("data", magic, 4)) break; - vfs_fseek(wav_file->file, len, SEEK_CUR); + aud_vfs_fseek(wav_file->file, len, SEEK_CUR); } rate = wav_file->samples_per_sec * wav_file->channels * @@ -546,7 +546,7 @@ (*length) = 1000 * (len / rate); (*title) = get_title(filename); - vfs_fclose(wav_file->file); + aud_vfs_fclose(wav_file->file); g_free(wav_file); wav_file = NULL; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/wavpack/libwavpack.cxx --- a/src/wavpack/libwavpack.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/wavpack/libwavpack.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -98,27 +98,27 @@ int32_t read_bytes (void *id, void *data, int32_t bcount) { - return vfs_fread (data, 1, bcount, (VFSFile *) id); + return aud_vfs_fread (data, 1, bcount, (VFSFile *) id); } uint32_t get_pos (void *id) { - return vfs_ftell ((VFSFile *) id); + return aud_vfs_ftell ((VFSFile *) id); } int set_pos_abs (void *id, uint32_t pos) { - return vfs_fseek ((VFSFile *) id, pos, SEEK_SET); + return aud_vfs_fseek ((VFSFile *) id, pos, SEEK_SET); } int set_pos_rel (void *id, int32_t delta, int mode) { - return vfs_fseek ((VFSFile *) id, delta, mode); + return aud_vfs_fseek ((VFSFile *) id, delta, mode); } int push_back_byte (void *id, int c) { - return vfs_ungetc (c, (VFSFile *) id); + return aud_vfs_ungetc (c, (VFSFile *) id); } uint32_t get_length (void *id) @@ -129,9 +129,9 @@ if (file == NULL) return 0; - vfs_fseek(file, 0, SEEK_END); - sz = vfs_ftell(file); - vfs_fseek(file, 0, SEEK_SET); + aud_vfs_fseek(file, 0, SEEK_END); + sz = aud_vfs_ftell(file); + aud_vfs_fseek(file, 0, SEEK_SET); return sz; } @@ -144,7 +144,7 @@ int32_t write_bytes (void *id, void *data, int32_t bcount) { - return vfs_fwrite (data, 1, bcount, (VFSFile *) id); + return aud_vfs_fwrite (data, 1, bcount, (VFSFile *) id); } WavpackStreamReader reader = { @@ -185,10 +185,10 @@ } if (ctx != NULL) { if (wv_Input) - vfs_fclose(wv_Input); + aud_vfs_fclose(wv_Input); if (wvc_Input) - vfs_fclose(wvc_Input); + aud_vfs_fclose(wvc_Input); g_free(ctx); ctx = NULL; } @@ -196,11 +196,11 @@ bool attach(const char *filename) { - wv_Input = vfs_fopen(filename, "rb"); + wv_Input = aud_vfs_fopen(filename, "rb"); char *corrFilename = g_strconcat(filename, "c", NULL); - wvc_Input = vfs_fopen(corrFilename, "rb"); + wvc_Input = aud_vfs_fopen(corrFilename, "rb"); g_free(corrFilename); @@ -225,11 +225,11 @@ bool attach_to_play(const char *filename) { - wv_Input = vfs_fopen(filename, "rb"); + wv_Input = aud_vfs_fopen(filename, "rb"); char *corrFilename = g_strconcat(filename, "c", NULL); - wvc_Input = vfs_fopen(corrFilename, "rb"); + wvc_Input = aud_vfs_fopen(corrFilename, "rb"); g_free(corrFilename); diff -r 5a6b60ceaa0f -r fa9f85cebade src/wavpack/tags.cxx --- a/src/wavpack/tags.cxx Sun Oct 07 00:23:19 2007 -0500 +++ b/src/wavpack/tags.cxx Sun Oct 07 00:25:33 2007 -0500 @@ -143,18 +143,18 @@ return TAG_NONE; } - if (vfs_fseek(fp, 0, SEEK_END) != 0) + if (aud_vfs_fseek(fp, 0, SEEK_END) != 0) return TAG_NONE; - size = vfs_ftell(fp); - if (vfs_fseek(fp, size - sizeof T, SEEK_SET) != 0) + size = aud_vfs_ftell(fp); + if (aud_vfs_fseek(fp, size - sizeof T, SEEK_SET) != 0) return TAG_NONE; - if (vfs_fread(&T, 1, sizeof T, fp) != sizeof T) + if (aud_vfs_fread(&T, 1, sizeof T, fp) != sizeof T) return TAG_NONE; if (memcmp(T.ID, "APETAGEX", sizeof T.ID) == 0) return TAG_APE; - if (vfs_fseek(fp, -128L, SEEK_END) != 0) + if (aud_vfs_fseek(fp, -128L, SEEK_END) != 0) return TAG_NONE; - if (vfs_fread(tagheader, 1, 3, fp) != 3) + if (aud_vfs_fread(tagheader, 1, 3, fp) != 3) return TAG_NONE; if (0 == memcmp(tagheader, "TAG", 3)) return TAG_ID3; @@ -179,9 +179,9 @@ *(Tag->track) = '\0'; *(Tag->year) = '\0'; - if (vfs_fseek(fp, -128L, SEEK_END) != 0) + if (aud_vfs_fseek(fp, -128L, SEEK_END) != 0) return 0; - if (vfs_fread(buff, 1, 128, fp) != 128) + if (aud_vfs_fread(buff, 1, 128, fp) != 128) return 0; tag = buff; tag_insert(Tag->title, (tag + 3), 30, 32, false); @@ -222,12 +222,12 @@ *(Tag->track) = '\0'; *(Tag->year) = '\0'; - if (vfs_fseek(fp, 0, SEEK_END) != 0) + if (aud_vfs_fseek(fp, 0, SEEK_END) != 0) return 0; - size = vfs_ftell(fp); - if (vfs_fseek(fp, size - sizeof T, SEEK_SET) != 0) + size = aud_vfs_ftell(fp); + if (aud_vfs_fseek(fp, size - sizeof T, SEEK_SET) != 0) return 0; - if (vfs_fread(&T, 1, sizeof T, fp) != sizeof T) + if (aud_vfs_fread(&T, 1, sizeof T, fp) != sizeof T) return 0; if (memcmp(T.ID, "APETAGEX", sizeof T.ID) != 0) return 0; @@ -236,11 +236,11 @@ TagLen = Read_LE_Uint32(T.Length); if (TagLen < sizeof T) return 0; - if (vfs_fseek(fp, size - TagLen, SEEK_SET) != 0) + if (aud_vfs_fseek(fp, size - TagLen, SEEK_SET) != 0) return 0; if ((buff = (unsigned char *) malloc(TagLen)) == NULL) return 0; - if (vfs_fread(buff, 1, TagLen - sizeof T, fp) != TagLen - sizeof T) { + if (aud_vfs_fread(buff, 1, TagLen - sizeof T, fp) != TagLen - sizeof T) { free(buff); return 0; } @@ -296,7 +296,7 @@ DeleteTag(char *filename) { - VFSFile *fp = vfs_fopen(filename, "rb+"); + VFSFile *fp = aud_vfs_fopen(filename, "rb+"); int tagtype; int fd; long filelength = 0; @@ -317,8 +317,8 @@ tagtype = GetTageType(fp); // get Length of File - vfs_fseek(fp, 0L, SEEK_END); - filelength = vfs_ftell(fp); + aud_vfs_fseek(fp, 0L, SEEK_END); + filelength = aud_vfs_ftell(fp); apelength = (unsigned long *) malloc(4); tagheader = (char *) malloc(9); @@ -327,11 +327,11 @@ dellength = 128L; } else if (tagtype == TAG_APE) { - vfs_fseek(fp, -32L, SEEK_END); - vfs_fread(tagheader, 8, 1, fp); + aud_vfs_fseek(fp, -32L, SEEK_END); + aud_vfs_fread(tagheader, 8, 1, fp); if (0 == memcmp(tagheader, "APETAGEX", 8)) { - vfs_fseek(fp, -20L, SEEK_END); - vfs_fread(apelength, 4, 1, fp); + aud_vfs_fseek(fp, -20L, SEEK_END); + aud_vfs_fread(apelength, 4, 1, fp); dellength = *apelength + 32; } } @@ -379,7 +379,7 @@ // Delete Tag if there is one - fp = vfs_fopen(filename, "rb+"); + fp = aud_vfs_fopen(filename, "rb+"); if (fp == NULL) { char text[256]; @@ -481,7 +481,7 @@ free(value); } // Start writing the new Ape2 Tag - vfs_fseek(fp, 0L, SEEK_END); + aud_vfs_fseek(fp, 0L, SEEK_END); if (TagCount == 0) { printf("no tag to write"); @@ -509,7 +509,7 @@ H[19] = TagCount >> 24; H[23] = 0x80 | 0x20; - writtenbytes += vfs_fwrite(H, 1, 32, fp); + writtenbytes += aud_vfs_fwrite(H, 1, 32, fp); for (unsigned int i = 0; i < TagCount; i++) { dw[0] = T[i].valuelen >> 0; @@ -520,19 +520,19 @@ dw[5] = T[i].flags >> 8; dw[6] = T[i].flags >> 16; dw[7] = T[i].flags >> 24; - writtenbytes += vfs_fwrite(dw, 1, 8, fp); - writtenbytes += vfs_fwrite(T[i].key, 1, T[i].keylen, fp); - writtenbytes += vfs_fwrite("", 1, 1, fp); + writtenbytes += aud_vfs_fwrite(dw, 1, 8, fp); + writtenbytes += aud_vfs_fwrite(T[i].key, 1, T[i].keylen, fp); + writtenbytes += aud_vfs_fwrite("", 1, 1, fp); if (T[i].valuelen > 0) - writtenbytes += vfs_fwrite(T[i].value, 1, T[i].valuelen, fp); + writtenbytes += aud_vfs_fwrite(T[i].value, 1, T[i].valuelen, fp); } H[23] = 0x80; - writtenbytes += vfs_fwrite(H, 1, 32, fp); + writtenbytes += aud_vfs_fwrite(H, 1, 32, fp); if (estimatedbytes != (unsigned long) writtenbytes) printf("\nError writing APE tag.\n"); - vfs_fclose(fp); + aud_vfs_fclose(fp); TagCount = 0; return 0; } diff -r 5a6b60ceaa0f -r fa9f85cebade src/wma/libffwma/file.c --- a/src/wma/libffwma/file.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/wma/libffwma/file.c Sun Oct 07 00:25:33 2007 -0500 @@ -31,9 +31,9 @@ VFSFile *file; if (flags & URL_WRONLY) { - file = vfs_fopen(filename, "wb"); + file = aud_vfs_fopen(filename, "wb"); } else { - file = vfs_fopen(filename, "rb"); + file = aud_vfs_fopen(filename, "rb"); } if (file == NULL) @@ -46,14 +46,14 @@ { VFSFile *file; file = h->priv_data; - return vfs_fread(buf, 1, size, file); + return aud_vfs_fread(buf, 1, size, file); } static int file_write(URLContext *h, unsigned char *buf, int size) { VFSFile *file; file = h->priv_data; - return vfs_fwrite(buf, 1, size, file); + return aud_vfs_fwrite(buf, 1, size, file); } /* XXX: use llseek */ @@ -62,9 +62,9 @@ int result = 0; VFSFile *file; file = h->priv_data; - result = vfs_fseek(file, pos, whence); + result = aud_vfs_fseek(file, pos, whence); if (result == 0) - result = vfs_ftell(file); + result = aud_vfs_ftell(file); else result = -1; return result; @@ -74,7 +74,7 @@ { VFSFile *file; file = h->priv_data; - return vfs_fclose(file); + return aud_vfs_fclose(file); } URLProtocol file_protocol = { diff -r 5a6b60ceaa0f -r fa9f85cebade src/wma/wma.c --- a/src/wma/wma.c Sun Oct 07 00:23:19 2007 -0500 +++ b/src/wma/wma.c Sun Oct 07 00:25:33 2007 -0500 @@ -104,7 +104,7 @@ .get_song_info = wma_get_song_info, .get_song_tuple = wma_get_song_tuple, .is_our_file_from_vfs = wma_is_our_fd, - .vfs_extensions = fmts, + .aud_vfs_extensions = fmts, }; InputPlugin *wma_iplist[] = { &wma_ip, NULL };