Index: /libreplaygain/include/replaygain/gain_analysis.h
===================================================================
--- /libreplaygain/include/replaygain/gain_analysis.h	(revision 402)
+++ /libreplaygain/include/replaygain/gain_analysis.h	(revision 403)
@@ -26,4 +26,22 @@
  */
 
+/**
+ * Pseudo-code to process an album:
+ *
+ *    Float_t       l_samples [4096];
+ *    Float_t       r_samples [4096];
+ *    size_t        num_samples;
+ *    unsigned int  num_songs;
+ *    unsigned int  i;
+ *
+ *    gain_init_analysis ( 44100 );
+ *    for ( i = 1; i <= num_songs; i++ ) {
+ *        while ( ( num_samples = getSongSamples ( song[i], left_samples, right_samples ) ) > 0 )
+ *            gain_analyze_samples ( left_samples, right_samples, num_samples, 2 );
+ *        fprintf ("Recommended dB change for song %2d: %+6.2f dB\n", i, gain_get_title() );
+ *    }
+ *    fprintf ("Recommended dB change for whole album: %+6.2f dB\n", gain_get_album() );
+ */
+
 #ifndef GAIN_ANALYSIS_H
 #define GAIN_ANALYSIS_H
@@ -44,9 +62,19 @@
 typedef double  Float_t;         // Type used for filtering
 
-int     InitGainAnalysis ( long samplefreq );
-int     AnalyzeSamples   ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
-int	ResetSampleFrequency ( long samplefreq );
-Float_t   GetTitleGain     ( void );
-Float_t   GetAlbumGain     ( void );
+/// Here's the deal : Call
+int gain_init_analysis ( long samplefreq );
+/// to initialize everything. Call
+int gain_analyze_samples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
+/// as many times as you want, with as many or as few samples as you want.
+/// If mono, pass the sample buffer in through left_samples, leave
+/// right_samples NULL, and make sure num_channels = 1.
+
+Float_t gain_get_title ( void );
+/// will return the recommended dB level change for all samples analyzed
+/// SINCE THE LAST TIME you called gain_get_title() OR gain_init_analysis().
+
+Float_t gain_get_album ( void );
+/// will return the recommended dB level change for all samples analyzed
+/// since gain_init_analysis() was called and finalized with gain_get_title().
 
 #ifdef __cplusplus
Index: /libreplaygain/src/Makefile.am
===================================================================
--- /libreplaygain/src/Makefile.am	(revision 402)
+++ /libreplaygain/src/Makefile.am	(revision 403)
@@ -4,3 +4,3 @@
 libreplaygain_la_LDFLAGS = -no-undefined -version-info 1:0:0
 libreplaygain_la_SOURCES = gain_analysis.c
-
+AM_CFLAGS = -fpic
Index: /libreplaygain/src/gain_analysis.c
===================================================================
--- /libreplaygain/src/gain_analysis.c	(revision 402)
+++ /libreplaygain/src/gain_analysis.c	(revision 403)
@@ -32,47 +32,4 @@
 
 /*
- *  Here's the deal. Call
- *
- *    InitGainAnalysis ( long samplefreq );
- *
- *  to initialize everything. Call
- *
- *    AnalyzeSamples ( const Float_t*  left_samples,
- *                     const Float_t*  right_samples,
- *                     size_t          num_samples,
- *                     int             num_channels );
- *
- *  as many times as you want, with as many or as few samples as you want.
- *  If mono, pass the sample buffer in through left_samples, leave
- *  right_samples NULL, and make sure num_channels = 1.
- *
- *    GetTitleGain()
- *
- *  will return the recommended dB level change for all samples analyzed
- *  SINCE THE LAST TIME you called GetTitleGain() OR InitGainAnalysis().
- *
- *    GetAlbumGain()
- *
- *  will return the recommended dB level change for all samples analyzed
- *  since InitGainAnalysis() was called and finalized with GetTitleGain().
- *
- *  Pseudo-code to process an album:
- *
- *    Float_t       l_samples [4096];
- *    Float_t       r_samples [4096];
- *    size_t        num_samples;
- *    unsigned int  num_songs;
- *    unsigned int  i;
- *
- *    InitGainAnalysis ( 44100 );
- *    for ( i = 1; i <= num_songs; i++ ) {
- *        while ( ( num_samples = getSongSamples ( song[i], left_samples, right_samples ) ) > 0 )
- *            AnalyzeSamples ( left_samples, right_samples, num_samples, 2 );
- *        fprintf ("Recommended dB change for song %2d: %+6.2f dB\n", i, GetTitleGain() );
- *    }
- *    fprintf ("Recommended dB change for whole album: %+6.2f dB\n", GetAlbumGain() );
- */
-
-/*
  *  So here's the main source of potential code confusion:
  *
@@ -81,5 +38,5 @@
  *  AND up to <filter order> number of previous filtered samples.
  *
- *  I set up the AnalyzeSamples routine to minimize memory usage and interface
+ *  I set up the gain_analyze_samples routine to minimize memory usage and interface
  *  complexity. The speed isn't compromised too much (I don't think), but the
  *  internal complexity is higher than it should be for such a relatively
@@ -115,24 +72,24 @@
 #define PINK_REF                64.82 //298640883795                              // calibration value
 
-Float_t          linprebuf [MAX_ORDER * 2];
-Float_t*         linpre;                                          // left input samples, with pre-buffer
-Float_t          lstepbuf  [MAX_SAMPLES_PER_WINDOW + MAX_ORDER];
-Float_t*         lstep;                                           // left "first step" (i.e. post first filter) samples
-Float_t          loutbuf   [MAX_SAMPLES_PER_WINDOW + MAX_ORDER];
-Float_t*         lout;                                            // left "out" (i.e. post second filter) samples
-Float_t          rinprebuf [MAX_ORDER * 2];
-Float_t*         rinpre;                                          // right input samples ...
-Float_t          rstepbuf  [MAX_SAMPLES_PER_WINDOW + MAX_ORDER];
-Float_t*         rstep;
-Float_t          routbuf   [MAX_SAMPLES_PER_WINDOW + MAX_ORDER];
-Float_t*         rout;
-long             sampleWindow;                                    // number of samples required to reach number of milliseconds required for RMS window
-long             totsamp;
-double           lsum;
-double           rsum;
-int              freqindex;
-int              first;
-static Uint32_t  A [(size_t)(STEPS_per_dB * MAX_dB)];
-static Uint32_t  B [(size_t)(STEPS_per_dB * MAX_dB)];
+static Float_t  linprebuf [MAX_ORDER * 2];
+static Float_t* linpre;                                          // left input samples, with pre-buffer
+static Float_t  lstepbuf  [MAX_SAMPLES_PER_WINDOW + MAX_ORDER];
+static Float_t* lstep;                                           // left "first step" (i.e. post first filter) samples
+static Float_t  loutbuf   [MAX_SAMPLES_PER_WINDOW + MAX_ORDER];
+static Float_t* lout;                                            // left "out" (i.e. post second filter) samples
+static Float_t  rinprebuf [MAX_ORDER * 2];
+static Float_t* rinpre;                                          // right input samples ...
+static Float_t  rstepbuf  [MAX_SAMPLES_PER_WINDOW + MAX_ORDER];
+static Float_t* rstep;
+static Float_t  routbuf   [MAX_SAMPLES_PER_WINDOW + MAX_ORDER];
+static Float_t* rout;
+static long     sampleWindow;                                    // number of samples required to reach number of milliseconds required for RMS window
+static long     totsamp;
+static double   lsum;
+static double   rsum;
+static int      freqindex;
+static int      first;
+static Uint32_t A [(size_t)(STEPS_per_dB * MAX_dB)];
+static Uint32_t B [(size_t)(STEPS_per_dB * MAX_dB)];
 
 // for each filter:
@@ -232,5 +189,5 @@
 // returns a INIT_GAIN_ANALYSIS_OK if successful, INIT_GAIN_ANALYSIS_ERROR if not
 
-int
+static int
 ResetSampleFrequency ( long samplefreq ) {
     int  i;
@@ -265,5 +222,5 @@
 
 int
-InitGainAnalysis ( long samplefreq )
+gain_init_analysis ( long samplefreq )
 {
     if (ResetSampleFrequency(samplefreq) != INIT_GAIN_ANALYSIS_OK) {
@@ -290,5 +247,5 @@
 
 int
-AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels )
+gain_analyze_samples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels )
 {
     const Float_t*  curleft;
@@ -443,5 +400,5 @@
 
 Float_t
-GetTitleGain ( void )
+gain_get_title ( void )
 {
     Float_t  retval;
@@ -465,5 +422,5 @@
 
 Float_t
-GetAlbumGain ( void )
+gain_get_album ( void )
 {
     return analyzeResult ( B, sizeof(B)/sizeof(*B) );
