updates to work with new grabbag lib
authorJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 7 Nov 2002 05:07:30 +0000 (05:07 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Thu, 7 Nov 2002 05:07:30 +0000 (05:07 +0000)
39 files changed:
FLAC.dsw
Makefile.lite
configure.in
include/share/Makefile.am
src/flac/Makefile.lite
src/flac/Makefile.vc
src/flac/decode.c
src/flac/encode.c
src/flac/flac.dsp
src/metaflac/Makefile.lite
src/metaflac/Makefile.vc
src/metaflac/main.c
src/metaflac/metaflac.dsp
src/plugin_xmms/Makefile.lite
src/plugin_xmms/plugin.c
src/test_libFLAC++/Makefile.am
src/test_libFLAC++/Makefile.lite
src/test_libFLAC++/Makefile.vc
src/test_libFLAC++/decoders.cpp
src/test_libFLAC++/metadata_manip.cpp
src/test_libFLAC++/test_libFLAC++.dsp
src/test_libFLAC/Makefile.am
src/test_libFLAC/Makefile.lite
src/test_libFLAC/Makefile.vc
src/test_libFLAC/decoders.c
src/test_libFLAC/encoders.c
src/test_libFLAC/metadata_manip.c
src/test_libFLAC/test_libFLAC.dsp
src/test_libOggFLAC++/Makefile.am
src/test_libOggFLAC++/Makefile.lite
src/test_libOggFLAC++/Makefile.vc
src/test_libOggFLAC++/decoders.cpp
src/test_libOggFLAC++/test_libOggFLAC++.dsp
src/test_libOggFLAC/Makefile.am
src/test_libOggFLAC/Makefile.lite
src/test_libOggFLAC/Makefile.vc
src/test_libOggFLAC/decoders.c
src/test_libOggFLAC/encoders.c
src/test_libOggFLAC/test_libOggFLAC.dsp

index a3ce293..8a74d14 100644 (file)
--- a/FLAC.dsw
+++ b/FLAC.dsw
@@ -27,7 +27,7 @@ Package=<4>
     Project_Dep_Name flac_ren\r
     End Project Dependency\r
     Begin Project Dependency\r
-    Project_Dep_Name file_utils\r
+    Project_Dep_Name grabbag\r
     End Project Dependency\r
     Begin Project Dependency\r
     Project_Dep_Name gain_analysis\r
@@ -78,7 +78,7 @@ Package=<5>
 Package=<4>\r
 {{{\r
     Begin Project Dependency\r
-    Project_Dep_Name file_utils\r
+    Project_Dep_Name grabbag\r
     End Project Dependency\r
     Begin Project Dependency\r
     Project_Dep_Name gain_analysis\r
@@ -123,7 +123,7 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
-Project: "file_utils"=.\src\share\file_utils\file_utils.dsp - Package Owner=<4>\r
+Project: "gain_analysis"=.\src\share\gain_analysis\gain_analysis.dsp - Package Owner=<4>\r
 \r
 Package=<5>\r
 {{{\r
@@ -135,7 +135,7 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
-Project: "gain_analysis"=.\src\share\gain_analysis\gain_analysis.dsp - Package Owner=<4>\r
+Project: "getopt"=.\src\share\getopt\getopt.dsp - Package Owner=<4>\r
 \r
 Package=<5>\r
 {{{\r
@@ -147,7 +147,7 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
-Project: "getopt"=.\src\share\getopt\getopt.dsp - Package Owner=<4>\r
+Project: "grabbag"=.\src\share\grabbag\grabbag.dsp - Package Owner=<4>\r
 \r
 Package=<5>\r
 {{{\r
@@ -155,6 +155,9 @@ Package=<5>
 \r
 Package=<4>\r
 {{{\r
+    Begin Project Dependency\r
+    Project_Dep_Name libFLAC\r
+    End Project Dependency\r
 }}}\r
 \r
 ###############################################################################\r
index 372877b..6f6c2ba 100644 (file)
@@ -58,10 +58,9 @@ libOggFLAC++: libFLAC
        (cd src/$@ ; $(MAKE) -f Makefile.lite $(CONFIG))
 
 share:
-       (cd src/$@/file_utils ; $(MAKE) -f Makefile.lite $(CONFIG))
        (cd src/$@/gain_analysis ; $(MAKE) -f Makefile.lite $(CONFIG))
        (cd src/$@/getopt ; $(MAKE) -f Makefile.lite $(CONFIG))
-       (cd src/$@/replaygain ; $(MAKE) -f Makefile.lite $(CONFIG))
+       (cd src/$@/grabbag ; $(MAKE) -f Makefile.lite $(CONFIG))
        (cd src/$@/utf8 ; $(MAKE) -f Makefile.lite $(CONFIG))
 
 flac: libFLAC libOggFLAC share
@@ -100,10 +99,9 @@ clean:
        -(cd src/libFLAC++ ; $(MAKE) -f Makefile.lite clean)
        -(cd src/libOggFLAC ; $(MAKE) -f Makefile.lite clean)
        -(cd src/libOggFLAC++ ; $(MAKE) -f Makefile.lite clean)
-       -(cd src/share/file_utils ; $(MAKE) -f Makefile.lite clean)
        -(cd src/share/gain_analysis ; $(MAKE) -f Makefile.lite clean)
        -(cd src/share/getopt ; $(MAKE) -f Makefile.lite clean)
-       -(cd src/share/replaygain ; $(MAKE) -f Makefile.lite clean)
+       -(cd src/share/grabbag ; $(MAKE) -f Makefile.lite clean)
        -(cd src/share/utf8 ; $(MAKE) -f Makefile.lite clean)
        -(cd src/flac ; $(MAKE) -f Makefile.lite clean)
        -(cd src/metaflac ; $(MAKE) -f Makefile.lite clean)
index 5eb5ba1..5ab64a7 100644 (file)
@@ -230,7 +230,7 @@ fi
 AM_PATH_XMMS(0.9.5.1, , AC_MSG_WARN([*** XMMS >= 0.9.5.1 not installed - xmms support will not be built]))
 AM_CONDITIONAL(FLaC__HAS_XMMS, test x$XMMS_INPUT_PLUGIN_DIR != x)
 
-SHARE_LIBS='$(top_builddir)/src/share/libreplaygain.a $(top_builddir)/src/share/libgain_analysis.a $(top_builddir)/src/share/libgetopt.a $(top_builddir)/src/share/libutf8.a $(top_builddir)/src/share/libfile_utils.a'
+SHARE_LIBS='$(top_builddir)/src/share/libgrabbag.a $(top_builddir)/src/share/libgain_analysis.a $(top_builddir)/src/share/libgetopt.a $(top_builddir)/src/share/libutf8.a'
 
 dnl check for i18n(internationalization); these are from libiconv/gettext
 AM_ICONV
@@ -384,10 +384,9 @@ AC_OUTPUT( \
        src/plugin_winamp3/Makefile \
        src/plugin_xmms/Makefile \
        src/share/Makefile \
-       src/share/file_utils/Makefile \
        src/share/gain_analysis/Makefile \
        src/share/getopt/Makefile \
-       src/share/replaygain/Makefile \
+       src/share/grabbag/Makefile \
        src/share/utf8/Makefile \
        src/test_libFLAC/Makefile \
        src/test_libFLAC++/Makefile \
@@ -401,6 +400,7 @@ AC_OUTPUT( \
        include/OggFLAC/Makefile \
        include/OggFLAC++/Makefile \
        include/share/Makefile \
+       include/share/grabbag/Makefile \
        doc/Makefile \
        doc/html/Makefile \
        doc/html/images/Makefile \
index 6aafc08..da52478 100644 (file)
@@ -2,8 +2,10 @@
 
 AUTOMAKE_OPTIONS = foreign
 
+SUBDIRS = grabbag
+
 EXTRA_DIST = \
-       file_utils.h \
        gain_analysis.h \
        getopt.h \
+       grabbag.h \
        utf8.h
index ca6410f..d8039be 100644 (file)
@@ -24,16 +24,16 @@ topdir = ../..
 PROGRAM_NAME = flac
 ifeq ($(DARWIN_BUILD),yes)
 INCLUDES     = -I./include -I$(topdir)/include
-LIBS         = -lreplaygain -lFLAC -lgain_analysis -lgetopt -lutf8 -lfile_utils -lc -lm
+LIBS         = -lgrabbag -lFLAC -lgain_analysis -lgetopt -lutf8 -lc -lm
 else
 #@@@ TODO: conditionalize ogg includes, defines, and -logg
 ifeq ($(SOLARIS_BUILD),yes)
 INCLUDES     = -I./include -I$(topdir)/include -I$(HOME)/local/include -DFLAC__HAS_OGG
-LIBS         = -lreplaygain -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lfile_utils -lm -L$(HOME)/local/lib -logg
+LIBS         = -lgrabbag -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg
 else
 #@@@ TODO: conditionalize ogg includes, defines, and -logg
 INCLUDES     = -I./include -I$(topdir)/include -I$(HOME)/local/include -DFLAC__HAS_OGG
-LIBS         = -lreplaygain -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lfile_utils -lm -L$(HOME)/local/lib -logg
+LIBS         = -lgrabbag -lOggFLAC -lFLAC -lgain_analysis -lgetopt -lutf8 -lm -L$(HOME)/local/lib -logg
 endif
 endif
 
index 94f9cf5..4b0ec70 100644 (file)
@@ -39,7 +39,7 @@ OBJS= $(C_FILES:.c=.obj)
 all: flac.exe\r
 \r
 flac.exe: $(OBJS)\r
-       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) replaygain.lib libOggFLAC.lib libFLAC.lib ogg_static.lib gain_analysis.lib getopt.lib utf8.lib file_utils.lib\r
+       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) grabbag.lib libOggFLAC.lib libFLAC.lib ogg_static.lib gain_analysis.lib getopt.lib utf8.lib\r
 \r
 clean:\r
        -del *.obj *.pch\r
index d0afee2..c92cd96 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdio.h> /* for FILE et al. */
 #include <string.h> /* for strcmp() */
 #include "FLAC/all.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
 #include "decode.h"
 
 #ifdef FLAC__HAS_OGG
@@ -206,7 +206,7 @@ FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__
        d->aopts = aopts;
        d->skip = skip;
 
-       d->inbasefilename = FLAC__file_utils_get_basename(infilename);
+       d->inbasefilename = grabbag__file_get_basename(infilename);
        d->outfilename = outfilename;
 
        d->samples_processed = 0;
@@ -229,7 +229,7 @@ FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__
 
        if(!d->test_only) {
                if(0 == strcmp(outfilename, "-")) {
-                       d->fout = FLAC__file_utils_get_binary_stdout();
+                       d->fout = grabbag__file_get_binary_stdout();
                }
                else {
                        if(0 == (d->fout = fopen(outfilename, "wb"))) {
@@ -243,7 +243,7 @@ FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__
 #ifdef FLAC__HAS_OGG
        if(d->is_ogg) {
                if (0 == strcmp(infilename, "-")) {
-                       d->fin = FLAC__file_utils_get_binary_stdin();
+                       d->fin = grabbag__file_get_binary_stdin();
                } else {
                        if (0 == (d->fin = fopen(infilename, "rb"))) {
                                fprintf(stderr, "%s: ERROR: can't open input file %s\n", d->inbasefilename, infilename);
index 739cd60..8fa48dd 100644 (file)
@@ -29,8 +29,7 @@
 #include <stdlib.h> /* for malloc */
 #include <string.h> /* for strcmp() */
 #include "FLAC/all.h"
-#include "share/file_utils.h"
-#include "share/replaygain.h"
+#include "share/grabbag.h"
 #include "encode.h"
 
 #ifdef HAVE_CONFIG_H
@@ -126,7 +125,7 @@ static int EncoderSession_finish_ok(EncoderSession *e, int info_align_carry, int
 static int EncoderSession_finish_error(EncoderSession *e);
 static FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t options, unsigned channels, unsigned bps, unsigned sample_rate);
 static FLAC__bool EncoderSession_process(EncoderSession *e, const FLAC__int32 * const buffer[], unsigned samples);
-static FLAC__bool convert_to_seek_table_template(char *requested_seek_points, int num_requested_seek_points, EncoderSession *e);
+static FLAC__bool convert_to_seek_table_template(const char *requested_seek_points, int num_requested_seek_points, EncoderSession *e);
 static void format_input(FLAC__int32 *dest[], unsigned wide_samples, FLAC__bool is_big_endian, FLAC__bool is_unsigned_samples, unsigned channels, unsigned bps);
 #ifdef FLAC__HAS_OGG
 static FLAC__StreamEncoderWriteStatus ogg_stream_encoder_write_callback(const OggFLAC__StreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data);
@@ -790,7 +789,7 @@ int flac__encode_raw(FILE *infile, long infilesize, const char *infilename, cons
        FLAC__ASSERT(!options.common.sector_align || infilesize >= 0);
        FLAC__ASSERT(!options.common.replay_gain || options.common.skip == 0);
        FLAC__ASSERT(!options.common.replay_gain || options.channels <= 2);
-       FLAC__ASSERT(!options.common.replay_gain || FLAC__replaygain_is_valid_sample_frequency(options.sample_rate));
+       FLAC__ASSERT(!options.common.replay_gain || grabbag__replaygain_is_valid_sample_frequency(options.sample_rate));
 
        if(!
                EncoderSession_construct(
@@ -994,7 +993,7 @@ FLAC__bool EncoderSession_construct(EncoderSession *e, FLAC__bool use_ogg, FLAC_
 
        e->is_stdout = (0 == strcmp(outfilename, "-"));
 
-       e->inbasefilename = FLAC__file_utils_get_basename(infilename);
+       e->inbasefilename = grabbag__file_get_basename(infilename);
        e->outfilename = outfilename;
 
        e->unencoded_size = 0;
@@ -1015,7 +1014,7 @@ FLAC__bool EncoderSession_construct(EncoderSession *e, FLAC__bool use_ogg, FLAC_
        e->seek_table_template = 0;
 
        if(e->is_stdout) {
-               e->fout = FLAC__file_utils_get_binary_stdout();
+               e->fout = grabbag__file_get_binary_stdout();
        }
 #ifdef FLAC__HAS_OGG
        else {
@@ -1192,12 +1191,12 @@ FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t optio
                        fprintf(stderr, "%s: ERROR, number of channels (%u) must be 1 or 2 for --replay-gain\n", e->inbasefilename, channels);
                        return false;
                }
-               if(!FLAC__replaygain_is_valid_sample_frequency(sample_rate)) {
+               if(!grabbag__replaygain_is_valid_sample_frequency(sample_rate)) {
                        fprintf(stderr, "%s: ERROR, invalid sample rate (%u) for --replay-gain\n", e->inbasefilename, sample_rate);
                        return false;
                }
                if(options.is_first_file) {
-                       if(!FLAC__replaygain_init(sample_rate)) {
+                       if(!grabbag__replaygain_init(sample_rate)) {
                                fprintf(stderr, "%s: ERROR initializing ReplayGain stage\n", e->inbasefilename);
                                return false;
                        }
@@ -1335,7 +1334,7 @@ FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t optio
 FLAC__bool EncoderSession_process(EncoderSession *e, const FLAC__int32 * const buffer[], unsigned samples)
 {
        if(e->replay_gain) {
-               if(!FLAC__replaygain_analyze(buffer, e->channels==2, e->bits_per_sample, samples))
+               if(!grabbag__replaygain_analyze(buffer, e->channels==2, e->bits_per_sample, samples))
                        fprintf(stderr, "%s: WARNING, error while calculating ReplayGain\n", e->inbasefilename);
        }
 
@@ -1353,73 +1352,36 @@ FLAC__bool EncoderSession_process(EncoderSession *e, const FLAC__int32 * const b
        }
 }
 
-FLAC__bool convert_to_seek_table_template(char *requested_seek_points, int num_requested_seek_points, EncoderSession *e)
+FLAC__bool convert_to_seek_table_template(const char *requested_seek_points, int num_requested_seek_points, EncoderSession *e)
 {
-       unsigned i;
-       char *pt = requested_seek_points, *q;
-       FLAC__bool only_placeholders = false;
-       FLAC__bool needs_warning = false;
+       FLAC__bool only_placeholders;
+       FLAC__bool has_real_points;
 
        if(num_requested_seek_points == 0)
                return true;
 
-       if(num_requested_seek_points < 0) {
-               strcpy(requested_seek_points, "100x<");
-               num_requested_seek_points = 1;
-       }
+       if(num_requested_seek_points < 0)
+               requested_seek_points = "100x;";
 
-       if(e->is_stdout) {
+       if(e->is_stdout)
                only_placeholders = true;
-       }
-#ifdef HAS_OGG
-       else if(e->is_ogg) {
+#ifdef FLAC__HAS_OGG
+       else if(e->use_ogg)
                only_placeholders = true;
-       }
 #endif
+       else
+               only_placeholders = false;
 
-       for(i = 0; i < (unsigned)num_requested_seek_points; i++) {
-               q = strchr(pt, '<');
-               FLAC__ASSERT(0 != q);
-               *q++ = '\0';
-
-               if(0 == strcmp(pt, "X")) { /* -S X */
-                       if(!FLAC__metadata_object_seektable_template_append_placeholders(e->seek_table_template, 1))
-                               return false;
-               }
-               else if(!only_placeholders) {
-                       if(pt[strlen(pt)-1] == 'x') { /* -S #x */
-                               if(e->total_samples_to_encode > 0) { /* we can only do these if we know the number of samples to encode up front */
-                                       if(!FLAC__metadata_object_seektable_template_append_spaced_points(e->seek_table_template, atoi(pt), e->total_samples_to_encode))
-                                               return false;
-                               }
-                       }
-                       else { /* -S # */
-                               FLAC__uint64 n = (unsigned)atoi(pt);
-                               if(!FLAC__metadata_object_seektable_template_append_point(e->seek_table_template, n))
-                                       return false;
-                       }
-               }
-               else
-                       needs_warning = true;
-
-               pt = q;
-       }
-
-       if(!FLAC__metadata_object_seektable_template_sort(e->seek_table_template, /*compact=*/true))
+       if(!grabbag__seektable_convert_specification_to_template(requested_seek_points, only_placeholders, e->total_samples_to_encode, e->sample_rate, e->seek_table_template, &has_real_points))
                return false;
 
-       if(needs_warning) {
-               if(e->is_stdout) {
-                       fprintf(stderr, "%s: WARNING, cannot write back seektable when encoding to stdout\n", e->inbasefilename);
-               }
-#ifdef HAS_OGG
-               else if(e->is_ogg) {
-                       fprintf(stderr, "%s: WARNING, cannot write back seektable when encoding to Ogg\n", e->inbasefilename);
-               }
+       if(has_real_points) {
+               if(e->is_stdout)
+                       fprintf(stderr, "%s: WARNING, cannot write back seekpoints when encoding to stdout\n", e->inbasefilename);
+#ifdef FLAC__HAS_OGG
+               else if(e->use_ogg)
+                       fprintf(stderr, "%s: WARNING, cannot write back seekpoints when encoding to Ogg\n", e->inbasefilename);
 #endif
-               else {
-                       FLAC__ASSERT(0);
-               }
        }
 
        return true;
index f4576d5..e9a2723 100644 (file)
@@ -51,7 +51,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\ogg_static.lib ..\..\obj\lib\replaygain.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\ogg_static.lib ..\..\obj\lib\grabbag.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /machine:I386\r
 \r
 !ELSEIF  "$(CFG)" == "flac - Win32 Debug"\r
 \r
@@ -76,7 +76,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\ogg_static.lib ..\..\obj\lib\replaygain.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\ogg_static.lib ..\..\obj\lib\grabbag.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
 \r
 !ENDIF \r
 \r
index e40b09b..f5a01d9 100644 (file)
@@ -23,7 +23,7 @@ topdir = ../..
 
 PROGRAM_NAME = metaflac
 INCLUDES     = -I./include -I$(topdir)/include
-LIBS         = -lreplaygain -lFLAC -lgain_analysis -lgetopt -lutf8 -lfile_utils -lm
+LIBS         = -lgrabbag -lFLAC -lgain_analysis -lgetopt -lutf8 -lm
 
 OBJS = \
        main.o
index 938eaae..53ddb9c 100644 (file)
@@ -33,7 +33,7 @@ OBJS= $(C_FILES:.c=.obj)
 all: metaflac.exe\r
 \r
 metaflac.exe: $(OBJS)\r
-       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) replaygain.lib libFLAC.lib gain_analysis.lib getopt.lib utf8.lib file_utils.lib\r
+       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) grabbag.lib libFLAC.lib gain_analysis.lib getopt.lib utf8.lib\r
 \r
 clean:\r
        -del *.obj *.pch\r
index 5cfe2d9..7cfdb97 100644 (file)
@@ -27,7 +27,7 @@ more powerful operations yet to add:
 
 #include "FLAC/assert.h"
 #include "FLAC/metadata.h"
-#include "share/replaygain.h"
+#include "share/grabbag.h"
 #include "share/utf8.h"
 #include <ctype.h>
 #include <locale.h>
@@ -45,10 +45,10 @@ more powerful operations yet to add:
 #endif
 
 /*
-   FLAC__share__getopt format struct; note we don't use short options so we just
+   share__getopt format struct; note we don't use short options so we just
    set the 'val' field to 0 everywhere to indicate a valid option.
 */
-static struct FLAC__share__option long_options_[] = {
+static struct share__option long_options_[] = {
        /* global options */
        { "preserve-modtime", 0, 0, 0 },
        { "with-filename", 0, 0, 0 },
@@ -367,10 +367,10 @@ FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options)
        int option_index = 1;
        FLAC__bool had_error = false;
 
-       while ((ret = FLAC__share__getopt_long(argc, argv, "", long_options_, &option_index)) != -1) {
+       while ((ret = share__getopt_long(argc, argv, "", long_options_, &option_index)) != -1) {
                switch (ret) {
                        case 0:
-                               had_error |= !parse_option(option_index, FLAC__share__optarg, options);
+                               had_error |= !parse_option(option_index, share__optarg, options);
                                break;
                        case '?':
                        case ':':
@@ -383,22 +383,22 @@ FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options)
        }
 
        if(options->prefix_with_filename == 2)
-               options->prefix_with_filename = (argc - FLAC__share__optind > 1);
+               options->prefix_with_filename = (argc - share__optind > 1);
 
-       if(FLAC__share__optind >= argc && !options->show_long_help && !options->show_version) {
+       if(share__optind >= argc && !options->show_long_help && !options->show_version) {
                fprintf(stderr,"ERROR: you must specify at least one FLAC file;\n");
                fprintf(stderr,"       metaflac cannot be used as a pipe\n");
                had_error = true;
        }
 
-       options->num_files = argc - FLAC__share__optind;
+       options->num_files = argc - share__optind;
 
        if(options->num_files > 0) {
                unsigned i = 0;
                if(0 == (options->filenames = malloc(sizeof(char *) * options->num_files)))
                        die("out of memory allocating space for file names list");
-               while(FLAC__share__optind < argc)
-                       options->filenames[i++] = local_strdup(argv[FLAC__share__optind++]);
+               while(share__optind < argc)
+                       options->filenames[i++] = local_strdup(argv[share__optind++]);
        }
 
        if(options->args.checks.num_major_ops > 0) {
@@ -1679,7 +1679,7 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu
                                return false;
                        }
                }
-               if(!FLAC__replaygain_is_valid_sample_frequency(sample_rate)) {
+               if(!grabbag__replaygain_is_valid_sample_frequency(sample_rate)) {
                        fprintf(stderr, "%s: ERROR: sample rate of %u Hz is not supported\n", filenames[i], sample_rate);
                        return false;
                }
@@ -1690,7 +1690,7 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu
        }
        FLAC__ASSERT(bits_per_sample >= FLAC__MIN_BITS_PER_SAMPLE && bits_per_sample <= FLAC__MAX_BITS_PER_SAMPLE);
 
-       if(!FLAC__replaygain_init(sample_rate))
+       if(!grabbag__replaygain_init(sample_rate))
                FLAC__ASSERT(0);
 
        if(
@@ -1700,17 +1700,17 @@ FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned nu
                die("out of memory allocating space for title gains/peaks");
 
        for(i = 0; i < num_files; i++) {
-               if(0 != (error = FLAC__replaygain_analyze_file(filenames[i], title_gains+i, title_peaks+i))) {
+               if(0 != (error = grabbag__replaygain_analyze_file(filenames[i], title_gains+i, title_peaks+i))) {
                        fprintf(stderr, "%s: ERROR: during analysis (%s)\n", filenames[i], error);
                        free(title_gains);
                        free(title_peaks);
                        return false;
                }
        }
-       FLAC__replaygain_get_album(&album_gain, &album_peak);
+       grabbag__replaygain_get_album(&album_gain, &album_peak);
 
        for(i = 0; i < num_files; i++) {
-               if(0 != (error = FLAC__replaygain_store_to_file(filenames[i], album_gain, album_peak, title_gains[i], title_peaks[i], preserve_modtime))) {
+               if(0 != (error = grabbag__replaygain_store_to_file(filenames[i], album_gain, album_peak, title_gains[i], title_peaks[i], preserve_modtime))) {
                        fprintf(stderr, "%s: ERROR: writing tags (%s)\n", filenames[i], error);
                        free(title_gains);
                        free(title_peaks);
index 9f4b5a3..7ee1882 100644 (file)
@@ -51,7 +51,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\replaygain.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\grabbag.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /machine:I386\r
 \r
 !ELSEIF  "$(CFG)" == "metaflac - Win32 Debug"\r
 \r
@@ -76,7 +76,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\replaygain.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\libFLAC.lib ..\..\obj\lib\grabbag.lib ..\..\obj\lib\gain_analysis.lib ..\..\obj\lib\getopt.lib ..\..\obj\lib\utf8.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
 \r
 !ENDIF \r
 \r
index cf7ab69..57171c9 100644 (file)
@@ -23,7 +23,7 @@ topdir = ../..
 
 LIB_NAME  = libxmms-flac
 INCLUDES  = $(shell xmms-config --cflags) -I./include -I$(topdir)/include -I..
-LIBS = $(topdir)/obj/lib/libFLAC.a $(topdir)/obj/lib/libplugin_common.a $(topdir)/obj/lib/libreplaygain.a $(topdir)/obj/lib/libgain_analysis.a $(topdir)/obj/lib/libfile_utils.a $(HOME)/local/lib/libid3.a -lstdc++ -lz
+LIBS = $(topdir)/obj/lib/libFLAC.a $(topdir)/obj/lib/libplugin_common.a $(topdir)/obj/lib/libgrabbag.a $(topdir)/obj/lib/libgain_analysis.a $(HOME)/local/lib/libid3.a -lstdc++ -lz
 
 OBJS = \
        charset.o \
index 5f5ea67..5503bfe 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "FLAC/all.h"
 #include "plugin_common/all.h"
-#include "share/replaygain.h"
+#include "share/grabbag.h"
 #include "configure.h"
 #include "wrap_id3.h"
 #include "charset.h"
@@ -494,9 +494,9 @@ void metadata_callback_(const FLAC__FileDecoder *decoder, const FLAC__StreamMeta
        }
        else if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
                double gain, peak;
-               if(FLAC__replaygain_load_from_vorbiscomment(metadata, flac_cfg.output.replaygain.album_mode, &gain, &peak)) {
+               if(grabbag__replaygain_load_from_vorbiscomment(metadata, flac_cfg.output.replaygain.album_mode, &gain, &peak)) {
                        file_info_.has_replaygain = true;
-                       file_info_.replay_scale = FLAC__replaygain_compute_scale_factor(peak, gain, (double)flac_cfg.output.replaygain.preamp, /*prevent_clipping=*/!flac_cfg.output.replaygain.hard_limit);
+                       file_info_.replay_scale = grabbag__replaygain_compute_scale_factor(peak, gain, (double)flac_cfg.output.replaygain.preamp, /*prevent_clipping=*/!flac_cfg.output.replaygain.hard_limit);
                }
        }
 }
index 9e16525..dc7dc37 100644 (file)
@@ -24,7 +24,11 @@ EXTRA_DIST = \
        test_libFLAC++.dsp
 
 noinst_PROGRAMS = test_libFLAC++
-test_libFLAC___LDADD = $(top_builddir)/src/libFLAC++/libFLAC++.la $(top_builddir)/src/libFLAC/libFLAC.la -lm
+test_libFLAC___LDADD = \
+       $(top_builddir)/src/share/grabbag/grabbag.la \
+       $(top_builddir)/src/libFLAC++/libFLAC++.la \
+       $(top_builddir)/src/libFLAC/libFLAC.la \
+       -lm
 test_libFLAC___SOURCES = \
        decoders.cpp \
        encoders.cpp \
index a5206bb..940a0f0 100644 (file)
@@ -23,7 +23,7 @@ topdir = ../..
 
 PROGRAM_NAME = test_libFLAC++
 INCLUDES     = -I$(topdir)/include
-LIBS         = -lFLAC++ -lFLAC -lfile_utils -lm
+LIBS         = -lgrabbag -lFLAC++ -lFLAC -lm
 OBJS = \
        decoders.o \
        encoders.o \
index 4a859b4..80edb31 100644 (file)
@@ -52,7 +52,7 @@ CPP_OBJS= $(CPP_FILES:.cpp=.obj)
 all: test_libFLAC++.exe\r
 \r
 test_libFLAC++.exe: $(C_OBJS) $(CPP_OBJS)\r
-       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(CPP_OBJS) $(C_OBJS) libFLAC++.lib libFLAC.lib file_utils.lib\r
+       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(CPP_OBJS) $(C_OBJS) grabbag.lib libFLAC++.lib libFLAC.lib\r
 \r
 clean:\r
        -del *.obj *.pch\r
index 8e86ae1..fe2c2c5 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
 #include "FLAC/assert.h"
 #include "FLAC/metadata.h" // for ::FLAC__metadata_object_is_equal()
 #include "FLAC++/decoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -2188,7 +2188,7 @@ bool test_decoders()
        if(!test_file_decoder())
                return false;
 
-       (void) FLAC__file_utils_remove_file(flacfilename_);
+       (void) grabbag__file_remove_file(flacfilename_);
        free_metadata_blocks_();
 
        return true;
index 893fef2..a5aad76 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
 #include "FLAC/assert.h"
 #include "FLAC++/decoder.h"
 #include "FLAC++/metadata.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
 #include <stdio.h>
 #include <stdlib.h> /* for malloc() */
 #include <string.h> /* for memcpy()/memset() */
@@ -363,8 +363,8 @@ static bool test_file_(const char *filename, bool ignore_metadata)
 
 static bool change_stats_(const char *filename, bool read_only)
 {
-       if(!FLAC__file_utils_change_stats(filename, read_only))
-               return die_("during FLAC__file_utils_change_stats()");
+       if(!grabbag__file_change_stats(filename, read_only))
+               return die_("during grabbag__file_change_stats()");
 
        return true;
 }
@@ -374,7 +374,7 @@ static bool remove_file_(const char *filename)
        while(our_metadata_.num_blocks > 0)
                delete_from_our_metadata_(0);
 
-       if(!FLAC__file_utils_remove_file(filename))
+       if(!grabbag__file_remove_file(filename))
                return die_("removing file");
 
        return true;
index e8ea56e..541e652 100644 (file)
@@ -51,7 +51,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
 \r
 !ELSEIF  "$(CFG)" == "test_libFLAC++ - Win32 Debug"\r
 \r
@@ -76,7 +76,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
 \r
 !ENDIF \r
 \r
index f4fa20a..2e13638 100644 (file)
@@ -24,7 +24,10 @@ CFLAGS = @CFLAGS@
 INCLUDES = -I$(top_srcdir)/src/libFLAC/include
 
 noinst_PROGRAMS = test_libFLAC
-test_libFLAC_LDADD = $(top_builddir)/src/libFLAC/libFLAC.la -lm
+test_libFLAC_LDADD = \
+       $(top_builddir)/src/share/grabbag/grabbag.la \
+       $(top_builddir)/src/libFLAC/libFLAC.la \
+       -lm
 test_libFLAC_SOURCES = \
        bitbuffer.c \
        decoders.c \
index 73c2278..611ff28 100644 (file)
@@ -23,7 +23,7 @@ topdir = ../..
 
 PROGRAM_NAME = test_libFLAC
 INCLUDES     = -I../libFLAC/include -I$(topdir)/include
-LIBS         = -lFLAC -lfile_utils -lm
+LIBS         = -lgrabbag -lFLAC -lm
 OBJS = \
        bitbuffer.o \
        decoders.o \
index e44273b..77b77d8 100644 (file)
@@ -41,7 +41,7 @@ OBJS= $(C_FILES:.c=.obj)
 all: test_libFLAC.exe\r
 \r
 test_libFLAC.exe: $(OBJS)\r
-       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) libFLAC.lib file_utils.lib\r
+       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) file_utils.lib libFLAC.lib\r
 \r
 clean:\r
        -del *.obj *.pch\r
index a055e81..63dd3ab 100644 (file)
@@ -23,7 +23,7 @@
 #include "FLAC/file_decoder.h"
 #include "FLAC/seekable_stream_decoder.h"
 #include "FLAC/stream_decoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -2076,7 +2076,7 @@ FLAC__bool test_decoders()
        if(!test_file_decoder())
                return false;
 
-       (void) FLAC__file_utils_remove_file(flacfilename_);
+       (void) grabbag__file_remove_file(flacfilename_);
        free_metadata_blocks_();
 
        return true;
index 291e10c..575a228 100644 (file)
@@ -22,7 +22,7 @@
 #include "FLAC/file_encoder.h"
 #include "FLAC/seekable_stream_encoder.h"
 #include "FLAC/stream_encoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -1123,7 +1123,7 @@ FLAC__bool test_encoders()
        if(!test_file_encoder())
                return false;
 
-       (void) FLAC__file_utils_remove_file(flacfilename_);
+       (void) grabbag__file_remove_file(flacfilename_);
        free_metadata_blocks_();
 
        return true;
index a3c8671..fd2bfe5 100644 (file)
@@ -21,7 +21,7 @@
 #include "FLAC/assert.h"
 #include "FLAC/file_decoder.h"
 #include "FLAC/metadata.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
 #include <stdio.h>
 #include <stdlib.h> /* for malloc() */
 
@@ -377,8 +377,8 @@ static FLAC__bool test_file_(const char *filename, void (*metadata_callback)(con
 
 static FLAC__bool change_stats_(const char *filename, FLAC__bool read_only)
 {
-       if(!FLAC__file_utils_change_stats(filename, read_only))
-               return die_("during FLAC__file_utils_change_stats()");
+       if(!grabbag__file_change_stats(filename, read_only))
+               return die_("during grabbag__file_change_stats()");
 
        return true;
 }
@@ -388,7 +388,7 @@ static FLAC__bool remove_file_(const char *filename)
        while(our_metadata_.num_blocks > 0)
                delete_from_our_metadata_(0);
 
-       if(!FLAC__file_utils_remove_file(filename))
+       if(!grabbag__file_remove_file(filename))
                return die_("removing file");
 
        return true;
index 8a2d91b..e88ffd6 100644 (file)
@@ -51,7 +51,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
 \r
 !ELSEIF  "$(CFG)" == "test_libFLAC - Win32 Debug"\r
 \r
@@ -76,7 +76,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
 \r
 !ENDIF \r
 \r
index d819118..367813a 100644 (file)
@@ -24,7 +24,13 @@ EXTRA_DIST = \
 CFLAGS = @CFLAGS@ @OGG_CFLAGS@
 
 noinst_PROGRAMS = test_libOggFLAC++
-test_libOggFLAC___LDADD = $(top_builddir)/src/libOggFLAC++/libOggFLAC++.la $(top_builddir)/src/libOggFLAC/libOggFLAC.la $(top_builddir)/src/libFLAC/libFLAC.la @OGG_LIBS@ -lm
+test_libOggFLAC___LDADD = \
+       $(top_builddir)/src/share/grabbag/grabbag.la \
+       $(top_builddir)/src/libOggFLAC++/libOggFLAC++.la \
+       $(top_builddir)/src/libOggFLAC/libOggFLAC.la \
+       $(top_builddir)/src/libFLAC/libFLAC.la \
+       @OGG_LIBS@ \
+       -lm
 test_libOggFLAC___SOURCES = \
        decoders.cpp \
        encoders.cpp \
index 9b71070..55135e4 100644 (file)
@@ -24,7 +24,7 @@ topdir = ../..
 PROGRAM_NAME = test_libOggFLAC++
 #@@@ TODO: conditionalize ogg lib path and -logg
 INCLUDES     = -I$(topdir)/include
-LIBS         = -lOggFLAC++ -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lfile_utils -lm
+LIBS         = -lgrabbag -lOggFLAC++ -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lm
 OBJS = \
        decoders.o \
        encoders.o \
index 078ac3e..fd77a45 100644 (file)
@@ -49,7 +49,7 @@ CPP_OBJS= $(CPP_FILES:.cpp=.obj)
 all: test_libOggFLAC++.exe\r
 \r
 test_libOggFLAC++.exe: $(C_OBJS) $(CPP_OBJS)\r
-       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(CPP_OBJS) $(C_OBJS) libOggFLAC++.lib libOggFLAC.lib libFLAC.lib ogg_static.lib file_utils.lib\r
+       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(CPP_OBJS) $(C_OBJS) file_utils.lib libOggFLAC++.lib libOggFLAC.lib libFLAC.lib ogg_static.lib\r
 \r
 clean:\r
        -del *.obj *.pch\r
index adc1ab3..fbae450 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
 #include "FLAC/assert.h"
 #include "FLAC/metadata.h" // for ::FLAC__metadata_object_is_equal()
 #include "OggFLAC++/decoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -867,7 +867,7 @@ bool test_decoders()
        if(!test_stream_decoder())
                return false;
 
-       (void) FLAC__file_utils_remove_file(oggflacfilename_);
+       (void) grabbag__file_remove_file(oggflacfilename_);
        free_metadata_blocks_();
 
        return true;
index dd89d2f..d7cca9f 100644 (file)
@@ -51,7 +51,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC++.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libOggFLAC++.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
 \r
 !ELSEIF  "$(CFG)" == "test_libOggFLAC++ - Win32 Debug"\r
 \r
@@ -76,7 +76,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC++.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libOggFLAC++.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC++.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
 \r
 !ENDIF \r
 \r
index 1e5b41a..080a288 100644 (file)
@@ -24,7 +24,12 @@ CFLAGS = @CFLAGS@ @OGG_CFLAGS@
 INCLUDES = 
 
 noinst_PROGRAMS = test_libOggFLAC
-test_libOggFLAC_LDADD = $(top_builddir)/src/libOggFLAC/libOggFLAC.la $(top_builddir)/src/libFLAC/libFLAC.la @OGG_LIBS@ -lm
+test_libOggFLAC_LDADD = \
+       $(top_builddir)/src/share/grabbag/grabbag.la \
+       $(top_builddir)/src/libOggFLAC/libOggFLAC.la \
+       $(top_builddir)/src/libFLAC/libFLAC.la \
+       @OGG_LIBS@ \
+       -lm
 test_libOggFLAC_SOURCES = \
        decoders.c \
        encoders.c \
index 8e6000e..ad3576b 100644 (file)
@@ -24,7 +24,7 @@ topdir = ../..
 PROGRAM_NAME = test_libOggFLAC
 #@@@ TODO: conditionalize ogg lib path and -logg
 INCLUDES     = -I$(topdir)/include
-LIBS         = -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lfile_utils -lm
+LIBS         = -lgrabbag -lOggFLAC -lFLAC -L$(HOME)/local/lib -logg -lm
 OBJS = \
        decoders.o \
        encoders.o \
index 9c14cc4..b363cfb 100644 (file)
@@ -37,7 +37,7 @@ OBJS= $(C_FILES:.c=.obj)
 all: test_libOggFLAC.exe\r
 \r
 test_libOggFLAC.exe: $(OBJS)\r
-       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) libOggFLAC.lib libFLAC.lib ogg_static.lib file_utils.lib\r
+       link.exe /libpath:"..\..\obj\lib" -out:../../obj/bin/$*.exe $(OBJS) file_utils.lib libOggFLAC.lib libFLAC.lib ogg_static.lib\r
 \r
 clean:\r
        -del *.obj *.pch\r
index 277b244..d9e6225 100644 (file)
@@ -21,7 +21,7 @@
 #include "metadata_utils.h"
 #include "FLAC/assert.h"
 #include "OggFLAC/stream_decoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -815,7 +815,7 @@ FLAC__bool test_decoders()
        if(!test_stream_decoder())
                return false;
 
-       (void) FLAC__file_utils_remove_file(oggflacfilename_);
+       (void) grabbag__file_remove_file(oggflacfilename_);
        free_metadata_blocks_();
 
        return true;
index ec6188e..aa7b56b 100644 (file)
@@ -20,7 +20,7 @@
 #include "file_utils.h"
 #include "FLAC/assert.h"
 #include "OggFLAC/stream_encoder.h"
-#include "share/file_utils.h"
+#include "share/grabbag.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -451,7 +451,7 @@ FLAC__bool test_encoders()
        if(!test_stream_encoder())
                return false;
 
-       (void) FLAC__file_utils_remove_file(oggflacfilename_);
+       (void) grabbag__file_remove_file(oggflacfilename_);
        free_metadata_blocks_();
 
        return true;
index 9bb2b86..2a91137 100644 (file)
@@ -51,7 +51,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /machine:I386\r
 \r
 !ELSEIF  "$(CFG)" == "test_libOggFLAC - Win32 Debug"\r
 \r
@@ -76,7 +76,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
-# ADD LINK32 ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 ..\..\obj\lib\grabbag.lib ..\..\obj\lib\libOggFLAC.lib ..\..\obj\lib\libFLAC.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r
 \r
 !ENDIF \r
 \r