changeset 56:450712b21565

Added namespacing to enumerations and defines. Made most macros private.
author Jamie Bullock <jamie@postlude.co.uk>
date Mon, 29 Jan 2007 11:30:11 +0000
parents 4ea1a8838b14
children 184798bc9660
files configure.in doc/documentation.doxygen.in examples/puredata/xtract~.c examples/simpletest/simpletest.c src/delta.c src/descriptors.c src/init.c src/libxtract.c src/scalar.c src/vector.c xtract/libxtract.h xtract/xtract_delta.h xtract/xtract_macros.h xtract/xtract_scalar.h xtract/xtract_types.h xtract/xtract_vector.h
diffstat 16 files changed, 823 insertions(+), 903 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Sun Jan 21 14:40:23 2007 +0000
+++ b/configure.in	Mon Jan 29 11:30:11 2007 +0000
@@ -64,7 +64,7 @@
 # age to 0.
 XTRACT_SO_VERSION=0:0:0
 
-CFLAGS="$CFLAGS -pedantic -ansi -Wall -Werror -std=c99"
+CFLAGS="$CFLAGS -pedantic -ansi -Wall -Werror -std=c99 -I/usr/local/include"
 LDFLAGS="$LDFLAGS -lm"
 
 AC_ARG_WITH(pd_dir,
--- a/doc/documentation.doxygen.in	Sun Jan 21 14:40:23 2007 +0000
+++ b/doc/documentation.doxygen.in	Mon Jan 29 11:30:11 2007 +0000
@@ -1005,7 +1005,7 @@
 # undefined via #undef or recursively expanded use the := operator 
 # instead of the = operator.
 
-PREDEFINED             = XTRACT XTRACT_FFT 
+PREDEFINED             = XTRACT_H XTRACT_FFT 
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
 # this tag can be used to specify a list of macro names that should be expanded. 
--- a/examples/puredata/xtract~.c	Sun Jan 21 14:40:23 2007 +0000
+++ b/examples/puredata/xtract~.c	Mon Jan 29 11:30:11 2007 +0000
@@ -22,7 +22,6 @@
 #include <math.h>
 #include <string.h>
 
-#define XTRACT 
 #include "xtract/libxtract.h"
 
 #define BLOCKSIZE 1024
@@ -53,7 +52,7 @@
 
     return_code = xtract[x->feature]((float *)in, N, x->argv, &result);
 
-    if(return_code == FEATURE_NOT_IMPLEMENTED)
+    if(return_code == XTRACT_FEATURE_NOT_IMPLEMENTED)
 	pd_error(x, "Feature not implemented");
 
     /* set nan, inf or -inf to 0 */
@@ -76,7 +75,7 @@
     
     return_code = xtract[x->feature](tmp_in, N, x->argv, tmp_out);
     
-    if(return_code == FEATURE_NOT_IMPLEMENTED)
+    if(return_code == XTRACT_FEATURE_NOT_IMPLEMENTED)
 	pd_error(x, "Feature not implemented");
     
     n = N;
@@ -91,7 +90,7 @@
 
 static void xtract_dsp(t_xtract_tilde *x, t_signal **sp) {
 
-    if(x->feature_type == VECTOR)
+    if(x->feature_type == XTRACT_VECTOR)
         dsp_add(xtract_perform_vector, 4, 
             sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n);
             
@@ -106,7 +105,7 @@
     xtract_mel_filter *mf;
     t_int n, N, f, F, n_args, type;
     t_float *argv_max;
-    t_function_descriptor *fd;
+    xtract_function_descriptor_t *fd;
     char *p_name, *p_desc, *author;
     int *year;
 
@@ -123,7 +122,7 @@
     tmp = atom_getsymbol(argv);
 
     /* get function descriptors */
-    fd = (t_function_descriptor *)xtract_make_descriptors();
+    fd = (xtract_function_descriptor_t *)xtract_make_descriptors();
 
     /* iterate over descriptors */
     while(f--){
@@ -143,15 +142,15 @@
 		    argv_max = &fd[f].argv.max[n]; 
 		    post("Argument %d, max: %.2f", n, *argv_max);
 	}
-	if(type == MEL_FILTER){
+	if(type == XTRACT_MEL_FILTER){
 	    x->memory.argv = (size_t)(n_args * sizeof(xtract_mel_filter));
 	    x->argv = (xtract_mel_filter *)getbytes(x->memory.argv);
 	}
-	else if(type == INT){
+	else if(type == XTRACT_INT){
 	    x->memory.argv = (size_t)(n_args * sizeof(t_int));
 	    x->argv = (t_int *)getbytes(x->memory.argv);
 	}
-	else if (type == FLOAT){
+	else if (type == XTRACT_FLOAT){
 	    x->memory.argv = (size_t)(n_args * sizeof(t_float));
 	    x->argv = (t_float *)getbytes(x->memory.argv);
 	}
@@ -178,42 +177,43 @@
     
 
     /* do init if needed */
-    if(x->feature == MFCC){
+    if(x->feature == XTRACT_MFCC){
 
         mf = x->argv;
         
         mf->n_filters = 20;
         
-        post("xtract~: mfcc: filters = %d", ((xtract_mel_filter *)x->argv)->n_filters);
+        post("xtract~: mfcc: filters = %d", 
+		((xtract_mel_filter *)x->argv)->n_filters);
         mf->filters = 
             (t_float **)getbytes(mf->n_filters * sizeof(t_float *));
         for(n = 0; n < mf->n_filters; n++)
             mf->filters[n] = (float *)getbytes(N * sizeof(float));
                  
-        xtract_init_mfcc(N, NYQUIST, EQUAL_GAIN, 18000.0f,
+        xtract_init_mfcc(N, NYQUIST, XTRACT_EQUAL_GAIN, 18000.0f,
         80.0f, mf->n_filters, mf->filters);
     }
-    else if(x->feature == BARK_COEFFICIENTS)
+    else if(x->feature == XTRACT_BARK_COEFFICIENTS)
         xtract_init_bark(N, NYQUIST, x->argv);
     
-    if(x->feature == AUTOCORRELATION || x->feature == AUTOCORRELATION_FFT ||
-    x->feature == MFCC || x->feature == AMDF || x->feature == ASDF|| 
-    x->feature == DCT || x->feature == BARK_COEFFICIENTS || 
-    x->feature == SPECTRUM || x->feature == PEAK_SPECTRUM || 
-    x->feature == HARMONIC_SPECTRUM) 
-        x->feature_type = VECTOR;
+    if(x->feature == XTRACT_AUTOCORRELATION || x->feature == XTRACT_AUTOCORRELATION_FFT ||
+    x->feature == XTRACT_MFCC || x->feature == XTRACT_AMDF || x->feature == XTRACT_ASDF|| 
+    x->feature == XTRACT_DCT || x->feature == XTRACT_BARK_COEFFICIENTS || 
+    x->feature == XTRACT_SPECTRUM || x->feature == XTRACT_PEAK_SPECTRUM || 
+    x->feature == XTRACT_HARMONIC_SPECTRUM) 
+        x->feature_type = XTRACT_VECTOR;
                 
-    else if (x->feature == FLUX || x->feature == ATTACK_TIME || 
-            x->feature == DECAY_TIME || x->feature == DELTA) 
-        x->feature_type = DELTA;
+    else if (x->feature == XTRACT_FLUX || x->feature == XTRACT_ATTACK_TIME || 
+            x->feature == XTRACT_DECAY_TIME || x->feature == XTRACT_DELTA) 
+        x->feature_type = XTRACT_DELTA;
        
-    else x->feature_type = SCALAR;
+    else x->feature_type = XTRACT_SCALAR;
 
     /* argv through right inlet */
     inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("list"), gensym("list"));
 
     /* if feature is vector, create signal out */
-    if(x->feature_type == VECTOR) outlet_new(&x->x_obj, &s_signal);
+    if(x->feature_type == XTRACT_VECTOR) outlet_new(&x->x_obj, &s_signal);
 
     /* otherwise: float */
     else outlet_new(&x->x_obj, &s_float);
--- a/examples/simpletest/simpletest.c	Sun Jan 21 14:40:23 2007 +0000
+++ b/examples/simpletest/simpletest.c	Mon Jan 29 11:30:11 2007 +0000
@@ -16,7 +16,6 @@
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
-#define XTRACT 
 #include "xtract/libxtract.h"
 #include <stdio.h>
 
@@ -24,7 +23,7 @@
 
     float mean = 0, vector[] = {1, 2, 3};
     
-    xtract[MEAN]((void *)&vector, 3, NULL, (void *)&mean);
+    xtract[XTRACT_MEAN]((void *)&vector, 3, NULL, (void *)&mean);
 
     printf("\nThe mean of [1, 2, 3] = %.1f\n\n", mean);
 	
--- a/src/delta.c	Sun Jan 21 14:40:23 2007 +0000
+++ b/src/delta.c	Mon Jan 29 11:30:11 2007 +0000
@@ -24,25 +24,25 @@
 
 int xtract_flux(const float *data, const int N, const void *argv , float *result){
 
-    return FEATURE_NOT_IMPLEMENTED;
+    return XTRACT_FEATURE_NOT_IMPLEMENTED;
 
 }
 
 int xtract_attack_time(const float *data, const int N, const void *argv , float *result){
 
-    return FEATURE_NOT_IMPLEMENTED;
+    return XTRACT_FEATURE_NOT_IMPLEMENTED;
 
 }
 
 int xtract_decay_time(const float *data, const int N, const void *argv, float *result){
 
-    return FEATURE_NOT_IMPLEMENTED;
+    return XTRACT_FEATURE_NOT_IMPLEMENTED;
 
 }
 
 int xtract_delta_feature(const float *data, const int N, const void *argv, float *result){
 
-    return FEATURE_NOT_IMPLEMENTED;
+    return XTRACT_FEATURE_NOT_IMPLEMENTED;
 
 }
 
--- a/src/descriptors.c	Sun Jan 21 14:40:23 2007 +0000
+++ b/src/descriptors.c	Mon Jan 29 11:30:11 2007 +0000
@@ -19,26 +19,26 @@
  */
 
 #include "xtract/libxtract.h"
+#include "xtract_macros_private.h"
 #include <stdlib.h>
 #include <string.h>
 #define XTRACT
 
 void *xtract_make_descriptors(){
 
-    t_function_descriptor *fd, *d;
-    t_type *argv_type;
     int f , F;
-    char *name, *p_name, *desc, *p_desc, *author, *argv_donor;
+    char *name, *p_name, *desc, *p_desc, *author; 
     float *argv_min, *argv_max, *argv_def, *result_min, *result_max;
-    int *argc, *year;
-    t_vector *data_format; 
-    t_unit *data_unit, *argv_unit, *result_unit;
-    t_bool *is_scalar;
-    t_vector *result_format;
+    int *argc, *year, *argv_donor;
+    xtract_vector_t *data_format, *result_format; 
+    xtract_unit_t *data_unit, *argv_unit, *result_unit;
+    xtract_bool_t *is_scalar;
+    xtract_function_descriptor_t *fd, *d;
+    xtract_type_t *argv_type;
 
     f = F = XTRACT_FEATURES;
 
-    fd = malloc(XTRACT_FEATURES * sizeof(t_function_descriptor));
+    fd = malloc(XTRACT_FEATURES * sizeof(xtract_function_descriptor_t));
 
     /* FIX - this file probably needs a rewrite for readability */
 
@@ -50,71 +50,71 @@
 
 	switch(f){
 
-	    case  VARIANCE:
-	    case  STANDARD_DEVIATION:
-	    case  AVERAGE_DEVIATION:
-	    case  SPECTRAL_VARIANCE:
-	    case  SPECTRAL_STANDARD_DEVIATION:
-	    case  SPECTRAL_AVERAGE_DEVIATION:
-	    case  SPECTRAL_INHARMONICITY:
-	    case  ODD_EVEN_RATIO:
-	    case  LOWEST_VALUE:
-	    case  F0:
-	    case  FAILSAFE_F0:
-	    case  TONALITY:
+	    case XTRACT_VARIANCE:
+	    case XTRACT_STANDARD_DEVIATION:
+	    case XTRACT_AVERAGE_DEVIATION:
+	    case XTRACT_SPECTRAL_VARIANCE:
+	    case XTRACT_SPECTRAL_STANDARD_DEVIATION:
+	    case XTRACT_SPECTRAL_AVERAGE_DEVIATION:
+	    case XTRACT_SPECTRAL_INHARMONICITY:
+	    case XTRACT_ODD_EVEN_RATIO:
+	    case XTRACT_LOWEST_VALUE:
+	    case XTRACT_F0:
+	    case XTRACT_FAILSAFE_F0:
+	    case XTRACT_TONALITY:
 		*argc = 1;
-		*argv_type = FLOAT;
+		*argv_type = XTRACT_FLOAT;
 		break;
-	    case  SKEWNESS:
-	    case  KURTOSIS:
-	    case  SPECTRAL_SKEWNESS:
-	    case  SPECTRAL_KURTOSIS:
-	    case  SPECTRUM:
-	    case  PEAK_SPECTRUM:
-	    case  HARMONIC_SPECTRUM:
-	    case  NOISINESS:
-	    case  CREST:
-	    case  ROLLOFF:
+	    case XTRACT_SKEWNESS:
+	    case XTRACT_KURTOSIS:
+	    case XTRACT_SPECTRAL_SKEWNESS:
+	    case XTRACT_SPECTRAL_KURTOSIS:
+	    case XTRACT_SPECTRUM:
+	    case XTRACT_PEAK_SPECTRUM:
+	    case XTRACT_HARMONIC_SPECTRUM:
+	    case XTRACT_NOISINESS:
+	    case XTRACT_CREST:
+	    case XTRACT_ROLLOFF:
 		*argc = 2;
-		*argv_type = FLOAT;
+		*argv_type = XTRACT_FLOAT;
 		break;
-	    case  MFCC:
+	    case XTRACT_MFCC:
 		*argc = 1;
-		*argv_type = MEL_FILTER;
+		*argv_type = XTRACT_MEL_FILTER;
 		break;
-	    case  BARK_COEFFICIENTS:
-		*argc = BARK_BANDS;
-		*argv_type = INT;
+	    case XTRACT_BARK_COEFFICIENTS:
+		*argc = XTRACT_BARK_BANDS;
+		*argv_type = XTRACT_INT;
 		break;
-	    case  MEAN:
-	    case  SPECTRAL_MEAN:
-	    case  SPECTRAL_CENTROID:
-	    case  IRREGULARITY_K:
-	    case  IRREGULARITY_J:
-	    case  TRISTIMULUS_1:
-	    case  TRISTIMULUS_2:
-	    case  TRISTIMULUS_3:
-	    case  SMOOTHNESS:
-	    case  FLATNESS:
-	    case  SPREAD:
-	    case  ZCR:
-	    case  LOUDNESS:
-	    case  HIGHEST_VALUE:
-	    case  SUM:
-	    case  RMS_AMPLITUDE:
-	    case  POWER:
-	    case  SHARPNESS:
-	    case  SPECTRAL_SLOPE:
-	    case  HPS:
-	    case  FLUX: 
-	    case  ATTACK_TIME: 
-	    case  DECAY_TIME: 
-	    case  DELTA_FEATURE: 
-	    case  AUTOCORRELATION_FFT:
-	    case  DCT:
-	    case  AUTOCORRELATION:
-	    case  AMDF:
-	    case  ASDF:
+	    case XTRACT_MEAN:
+	    case XTRACT_SPECTRAL_MEAN:
+	    case XTRACT_SPECTRAL_CENTROID:
+	    case XTRACT_IRREGULARITY_K:
+	    case XTRACT_IRREGULARITY_J:
+	    case XTRACT_TRISTIMULUS_1:
+	    case XTRACT_TRISTIMULUS_2:
+	    case XTRACT_TRISTIMULUS_3:
+	    case XTRACT_SMOOTHNESS:
+	    case XTRACT_FLATNESS:
+	    case XTRACT_SPREAD:
+	    case XTRACT_ZCR:
+	    case XTRACT_LOUDNESS:
+	    case XTRACT_HIGHEST_VALUE:
+	    case XTRACT_SUM:
+	    case XTRACT_RMS_AMPLITUDE:
+	    case XTRACT_POWER:
+	    case XTRACT_SHARPNESS:
+	    case XTRACT_SPECTRAL_SLOPE:
+	    case XTRACT_HPS:
+	    case XTRACT_FLUX: 
+	    case XTRACT_ATTACK_TIME: 
+	    case XTRACT_DECAY_TIME: 
+	    case XTRACT_DELTA_FEATURE: 
+	    case XTRACT_AUTOCORRELATION_FFT:
+	    case XTRACT_DCT:
+	    case XTRACT_AUTOCORRELATION:
+	    case XTRACT_AMDF:
+	    case XTRACT_ASDF:
 	    default:
 		*argc = 0;
 		break;
@@ -127,163 +127,163 @@
 
 	switch (f) {
 	    /* argc = 1 */
-	    case  VARIANCE:
-	    case  SPECTRAL_VARIANCE:
-	    case  STANDARD_DEVIATION:
-	    case  AVERAGE_DEVIATION:
-	    case  SPECTRAL_STANDARD_DEVIATION:
-	    case  SPECTRAL_AVERAGE_DEVIATION:
-	    case  LOWEST_VALUE:
-	    case  TONALITY:
-	    case  MFCC:
-		*argv_min = ANY;
-		*argv_max = ANY;
-		*argv_def = ANY;
-		*argv_unit = ANY;
-	    case  SPECTRAL_INHARMONICITY:
-	    case  ODD_EVEN_RATIO:
+	    case XTRACT_VARIANCE:
+	    case XTRACT_SPECTRAL_VARIANCE:
+	    case XTRACT_STANDARD_DEVIATION:
+	    case XTRACT_AVERAGE_DEVIATION:
+	    case XTRACT_SPECTRAL_STANDARD_DEVIATION:
+	    case XTRACT_SPECTRAL_AVERAGE_DEVIATION:
+	    case XTRACT_LOWEST_VALUE:
+	    case XTRACT_TONALITY:
+	    case XTRACT_MFCC:
+		*argv_min = XTRACT_ANY;
+		*argv_max = XTRACT_ANY;
+		*argv_def = XTRACT_ANY;
+		*argv_unit = XTRACT_ANY;
+	    case XTRACT_SPECTRAL_INHARMONICITY:
+	    case XTRACT_ODD_EVEN_RATIO:
 		*argv_min = 0.f;
-		*argv_max = SR_UPPER_LIMIT / 2;
-		*argv_def = FUNDAMENTAL_DEFAULT;
-		*argv_unit = HERTZ;
-	    case  F0:
-	    case  FAILSAFE_F0:
-		*argv_min = SR_LOWER_LIMIT;
-		*argv_max = SR_UPPER_LIMIT;
-		*argv_def = SR_DEFAULT; 
-		*argv_unit = HERTZ;
+		*argv_max = XTRACT_SR_UPPER_LIMIT / 2;
+		*argv_def = XTRACT_FUNDAMENTAL_DEFAULT;
+		*argv_unit = XTRACT_HERTZ;
+	    case XTRACT_F0:
+	    case XTRACT_FAILSAFE_F0:
+		*argv_min = XTRACT_SR_LOWER_LIMIT;
+		*argv_max = XTRACT_SR_UPPER_LIMIT;
+		*argv_def = XTRACT_SR_DEFAULT; 
+		*argv_unit = XTRACT_HERTZ;
 	    /* argc = 2 */;
-	    case  ROLLOFF:
-		*argv_min  = FFT_BANDS_MIN;
-		*argv_max = FFT_BANDS_MAX;
-		*argv_def = SPEC_BW_DEF ;
-		*argv_unit = HERTZ;
+	    case XTRACT_ROLLOFF:
+		*argv_min  = XTRACT_FFT_BANDS_MIN;
+		*argv_max = XTRACT_FFT_BANDS_MAX;
+		*argv_def = XTRACT_SPEC_BW_DEF ;
+		*argv_unit = XTRACT_HERTZ;
 		*(argv_min + 1) = 0.f;
 		*(argv_max + 1) = 100.f;
 		*(argv_def + 1) = 95.f;
-		*(argv_unit + 1) = PERCENT;
-	    case  SPECTRUM:
-		*argv_min  = SR_LOWER_LIMIT / 2; 
-		*argv_max = SR_UPPER_LIMIT / 2;
-		*argv_def = SR_DEFAULT / 2;
-		*argv_unit = HERTZ;
+		*(argv_unit + 1) = XTRACT_PERCENT;
+	    case XTRACT_SPECTRUM:
+		*argv_min  = XTRACT_SR_LOWER_LIMIT / 2; 
+		*argv_max = XTRACT_SR_UPPER_LIMIT / 2;
+		*argv_def = XTRACT_SR_DEFAULT / 2;
+		*argv_unit = XTRACT_HERTZ;
 		*(argv_min + 1) = 0;
 		*(argv_max + 1) = 3 ;
 		*(argv_def + 1) = 0;
-		*(argv_unit + 1) = NONE;
-	    case  PEAK_SPECTRUM:
-		*argv_min  = SR_LOWER_LIMIT / 2; 
-		*argv_max = SR_UPPER_LIMIT / 2;
-		*argv_def = SR_DEFAULT / 2;
-		*argv_unit = HERTZ;
+		*(argv_unit + 1) = XTRACT_NONE;
+	    case XTRACT_PEAK_SPECTRUM:
+		*argv_min  = XTRACT_SR_LOWER_LIMIT / 2; 
+		*argv_max = XTRACT_SR_UPPER_LIMIT / 2;
+		*argv_def = XTRACT_SR_DEFAULT / 2;
+		*argv_unit = XTRACT_HERTZ;
 		*(argv_min + 1) = 0.f;
 		*(argv_max + 1) = 100.f ;
 		*(argv_def + 1) = 10.f ;
-		*(argv_unit + 1) = PERCENT;
-	    case  HARMONIC_SPECTRUM:
+		*(argv_unit + 1) = XTRACT_PERCENT;
+	    case XTRACT_HARMONIC_SPECTRUM:
 		*argv_min = 0.f;
-		*argv_max = SR_UPPER_LIMIT / 2;
-		*argv_def = FUNDAMENTAL_DEFAULT;
-		*argv_unit = HERTZ;
+		*argv_max = XTRACT_SR_UPPER_LIMIT / 2;
+		*argv_def = XTRACT_FUNDAMENTAL_DEFAULT;
+		*argv_unit = XTRACT_HERTZ;
 		*(argv_min + 1) = 0.f;
 		*(argv_max + 1) = 1.f ;
 		*(argv_def + 1) = .1f ;
-		*(argv_unit + 1) = NONE;
-	    case  NOISINESS:
-	    case  SKEWNESS:
-	    case  KURTOSIS:
-	    case  SPECTRAL_SKEWNESS:
-	    case  SPECTRAL_KURTOSIS:
-	    case  CREST:
-		*argv_min = NONE;
-		*argv_max = NONE;
-		*argv_def = NONE;
-		*argv_unit = NONE;
-		*(argv_min + 1) = NONE;
-		*(argv_max + 1) = NONE;
-		*(argv_def + 1) = NONE;
-		*(argv_unit + 1) = NONE;
-	    case  BARK_COEFFICIENTS:
+		*(argv_unit + 1) = XTRACT_NONE;
+	    case XTRACT_NOISINESS:
+	    case XTRACT_SKEWNESS:
+	    case XTRACT_KURTOSIS:
+	    case XTRACT_SPECTRAL_SKEWNESS:
+	    case XTRACT_SPECTRAL_KURTOSIS:
+	    case XTRACT_CREST:
+		*argv_min = XTRACT_NONE;
+		*argv_max = XTRACT_NONE;
+		*argv_def = XTRACT_NONE;
+		*argv_unit = XTRACT_NONE;
+		*(argv_min + 1) = XTRACT_NONE;
+		*(argv_max + 1) = XTRACT_NONE;
+		*(argv_def + 1) = XTRACT_NONE;
+		*(argv_unit + 1) = XTRACT_NONE;
+	    case XTRACT_BARK_COEFFICIENTS:
 	    /* BARK_COEFFICIENTS is special because argc = BARK_BANDS */
 	    default:
-		*argv_min = NONE;
-		*argv_max = NONE;
-		*argv_def = NONE;
-		*argv_unit = NONE;
+		*argv_min = XTRACT_NONE;
+		*argv_max = XTRACT_NONE;
+		*argv_def = XTRACT_NONE;
+		*argv_unit = XTRACT_NONE;
 	}
 
 	argv_donor = &d->argv.donor[0];
 
 	switch (f) {
 	    /* argc = 1 */
-	    case  VARIANCE:
-		*argv_donor = MEAN;
+	    case XTRACT_VARIANCE:
+		*argv_donor = XTRACT_MEAN;
 		break;
-	    case  SPECTRAL_VARIANCE:
-		*argv_donor = SPECTRAL_MEAN;
+	    case XTRACT_SPECTRAL_VARIANCE:
+		*argv_donor = XTRACT_SPECTRAL_MEAN;
 		break;
-	    case  STANDARD_DEVIATION:
-		*argv_donor = VARIANCE;
+	    case XTRACT_STANDARD_DEVIATION:
+		*argv_donor = XTRACT_VARIANCE;
 		break;
-	    case  AVERAGE_DEVIATION:
-		*argv_donor = MEAN;
+	    case XTRACT_AVERAGE_DEVIATION:
+		*argv_donor = XTRACT_MEAN;
 		break;
-	    case  SPECTRAL_STANDARD_DEVIATION:
-		*argv_donor = SPECTRAL_VARIANCE;
+	    case XTRACT_SPECTRAL_STANDARD_DEVIATION:
+		*argv_donor = XTRACT_SPECTRAL_VARIANCE;
 		break;
-	    case  SPECTRAL_AVERAGE_DEVIATION:
-		*argv_donor = SPECTRAL_MEAN;
+	    case XTRACT_SPECTRAL_AVERAGE_DEVIATION:
+		*argv_donor = XTRACT_SPECTRAL_MEAN;
 		break;
-	    case  SPECTRAL_INHARMONICITY:
-	    case  ODD_EVEN_RATIO:
-		*argv_donor = FAILSAFE_F0;
+	    case XTRACT_SPECTRAL_INHARMONICITY:
+	    case XTRACT_ODD_EVEN_RATIO:
+		*argv_donor = XTRACT_FAILSAFE_F0;
 		break;
-	    case  TONALITY:
-		*argv_donor = FLATNESS;
+	    case XTRACT_TONALITY:
+		*argv_donor = XTRACT_FLATNESS;
 		break;
-	    case  LOWEST_VALUE:
-	    case  F0:
-	    case  FAILSAFE_F0:
-		*argv_donor = ANY;
+	    case XTRACT_LOWEST_VALUE:
+	    case XTRACT_F0:
+	    case XTRACT_FAILSAFE_F0:
+		*argv_donor = XTRACT_ANY;
 		break;
-	    case  MFCC:
-		*argv_donor = INIT_MFCC;
+	    case XTRACT_MFCC:
+		*argv_donor = XTRACT_INIT_MFCC;
 		break;
 	    /* argc = 2 */;
-	    case  SPECTRUM:
-	    case  ROLLOFF:
-	    case  PEAK_SPECTRUM:
-		*argv_donor = ANY;
-		*(argv_donor + 1) = ANY;
+	    case XTRACT_SPECTRUM:
+	    case XTRACT_ROLLOFF:
+	    case XTRACT_PEAK_SPECTRUM:
+		*argv_donor = XTRACT_ANY;
+		*(argv_donor + 1) = XTRACT_ANY;
 		break;
-	    case  SKEWNESS:
-	    case  KURTOSIS:
-		*argv_donor = MEAN;
-		*(argv_donor + 1) = STANDARD_DEVIATION;
+	    case XTRACT_SKEWNESS:
+	    case XTRACT_KURTOSIS:
+		*argv_donor = XTRACT_MEAN;
+		*(argv_donor + 1) = XTRACT_STANDARD_DEVIATION;
 		break;
-	    case  SPECTRAL_SKEWNESS:
-	    case  SPECTRAL_KURTOSIS:
-		*argv_donor = SPECTRAL_MEAN;
-		*(argv_donor + 1) = SPECTRAL_STANDARD_DEVIATION;
+	    case XTRACT_SPECTRAL_SKEWNESS:
+	    case XTRACT_SPECTRAL_KURTOSIS:
+		*argv_donor = XTRACT_SPECTRAL_MEAN;
+		*(argv_donor + 1) = XTRACT_SPECTRAL_STANDARD_DEVIATION;
 		break;
-	    case  HARMONIC_SPECTRUM:
-		*argv_donor = FAILSAFE_F0;
-		*(argv_donor + 1) = ANY;
+	    case XTRACT_HARMONIC_SPECTRUM:
+		*argv_donor = XTRACT_FAILSAFE_F0;
+		*(argv_donor + 1) = XTRACT_ANY;
 		break;
-	    case  NOISINESS:
-		*argv_donor = SUM;
-		*(argv_donor + 1) = SUM;
+	    case XTRACT_NOISINESS:
+		*argv_donor = XTRACT_SUM;
+		*(argv_donor + 1) = XTRACT_SUM;
 		break;
-	    case  CREST:
-		*argv_donor = HIGHEST_VALUE;
-		*(argv_donor + 1) = SPECTRAL_MEAN;
+	    case XTRACT_CREST:
+		*argv_donor = XTRACT_HIGHEST_VALUE;
+		*(argv_donor + 1) = XTRACT_SPECTRAL_MEAN;
 		break;
 	    /* argc = BARK_BANDS */
-	    case  BARK_COEFFICIENTS:
-		*argv_donor = INIT_BARK;
+	    case XTRACT_BARK_COEFFICIENTS:
+		*argv_donor = XTRACT_INIT_BARK;
 		break;
 	    default:
-		*argv_donor = ANY;
+		*argv_donor = XTRACT_ANY;
 		break;
 	}
 
@@ -291,79 +291,79 @@
 
 	switch(f){
 
-	    case  MEAN: 
-	    case  VARIANCE:
-	    case  STANDARD_DEVIATION:
-	    case  AVERAGE_DEVIATION:
-	    case  SKEWNESS:
-	    case  KURTOSIS:
-	    case  LOWEST_VALUE:
-	    case  HIGHEST_VALUE:
-	    case  SUM:
-	    case  ZCR:
-		*data_format = ARBITRARY_SERIES;
+	    case XTRACT_MEAN: 
+	    case XTRACT_VARIANCE:
+	    case XTRACT_STANDARD_DEVIATION:
+	    case XTRACT_AVERAGE_DEVIATION:
+	    case XTRACT_SKEWNESS:
+	    case XTRACT_KURTOSIS:
+	    case XTRACT_LOWEST_VALUE:
+	    case XTRACT_HIGHEST_VALUE:
+	    case XTRACT_SUM:
+	    case XTRACT_ZCR:
+		*data_format = XTRACT_ARBITRARY_SERIES;
 		break;
-	    case  SPECTRAL_MEAN:
-	    case  SPECTRAL_VARIANCE:
-	    case  SPECTRAL_STANDARD_DEVIATION:
-	    case  SPECTRAL_AVERAGE_DEVIATION:
-	    case  SPECTRAL_SKEWNESS:
-	    case  SPECTRAL_KURTOSIS:
-	    case  SPECTRAL_CENTROID:
-	    case  SPECTRAL_SLOPE:
-	    case  PEAK_SPECTRUM:
-	    case  HARMONIC_SPECTRUM:
-	        *data_format = SPECTRAL;     
+	    case XTRACT_SPECTRAL_MEAN:
+	    case XTRACT_SPECTRAL_VARIANCE:
+	    case XTRACT_SPECTRAL_STANDARD_DEVIATION:
+	    case XTRACT_SPECTRAL_AVERAGE_DEVIATION:
+	    case XTRACT_SPECTRAL_SKEWNESS:
+	    case XTRACT_SPECTRAL_KURTOSIS:
+	    case XTRACT_SPECTRAL_CENTROID:
+	    case XTRACT_SPECTRAL_SLOPE:
+	    case XTRACT_PEAK_SPECTRUM:
+	    case XTRACT_HARMONIC_SPECTRUM:
+	        *data_format = XTRACT_SPECTRAL;     
 		break;
-	    case  ROLLOFF:
-	    case  NOISINESS:
-	    case  BARK_COEFFICIENTS:
-	    case  CREST:
-	    case  IRREGULARITY_K:
-	    case  IRREGULARITY_J:
-	    case  SMOOTHNESS:
-	    case  FLATNESS:
-	    case  SPREAD:
-	    case  RMS_AMPLITUDE:
-	    case  POWER:
-	    case  SHARPNESS:
-	    case  HPS:
-		*data_format = SPECTRAL_MAGNITUDES;
+	    case XTRACT_ROLLOFF:
+	    case XTRACT_NOISINESS:
+	    case XTRACT_BARK_COEFFICIENTS:
+	    case XTRACT_CREST:
+	    case XTRACT_IRREGULARITY_K:
+	    case XTRACT_IRREGULARITY_J:
+	    case XTRACT_SMOOTHNESS:
+	    case XTRACT_FLATNESS:
+	    case XTRACT_SPREAD:
+	    case XTRACT_RMS_AMPLITUDE:
+	    case XTRACT_POWER:
+	    case XTRACT_SHARPNESS:
+	    case XTRACT_HPS:
+		*data_format = XTRACT_SPECTRAL_MAGNITUDES;
 		break;
-	    case  SPECTRAL_INHARMONICITY:
-		*data_format = SPECTRAL_PEAKS;
+	    case XTRACT_SPECTRAL_INHARMONICITY:
+		*data_format = XTRACT_SPECTRAL_PEAKS;
 		break;
-	    case  ODD_EVEN_RATIO:
-		*data_format = SPECTRAL_HARMONICS_FREQUENCIES;
+	    case XTRACT_ODD_EVEN_RATIO:
+		*data_format = XTRACT_SPECTRAL_HARMONICS_FREQUENCIES;
 		break;
-	    case  F0:
-	    case  FAILSAFE_F0:
-	    case  SPECTRUM:
-	    case  MFCC:
-	    case  AUTOCORRELATION:
-	    case  AUTOCORRELATION_FFT:
-	    case  DCT:
-	    case  AMDF:
-	    case  ASDF:
-		*data_format = AUDIO_SAMPLES;
+	    case XTRACT_F0:
+	    case XTRACT_FAILSAFE_F0:
+	    case XTRACT_SPECTRUM:
+	    case XTRACT_MFCC:
+	    case XTRACT_AUTOCORRELATION:
+	    case XTRACT_AUTOCORRELATION_FFT:
+	    case XTRACT_DCT:
+	    case XTRACT_AMDF:
+	    case XTRACT_ASDF:
+		*data_format = XTRACT_AUDIO_SAMPLES;
 		break;
-	    case  TONALITY:
-		*data_format = NO_DATA;
+	    case XTRACT_TONALITY:
+		*data_format = XTRACT_NO_DATA;
 		break;
-	    case  TRISTIMULUS_1:
-	    case  TRISTIMULUS_2:
-	    case  TRISTIMULUS_3:
-		*data_format = SPECTRAL_HARMONICS_MAGNITUDES;
+	    case XTRACT_TRISTIMULUS_1:
+	    case XTRACT_TRISTIMULUS_2:
+	    case XTRACT_TRISTIMULUS_3:
+		*data_format = XTRACT_SPECTRAL_HARMONICS_MAGNITUDES;
 		break;
-	    case  LOUDNESS:
-		*data_format = BARK_COEFFS;
+	    case XTRACT_LOUDNESS:
+		*data_format = XTRACT_BARK_COEFFS;
 		break;
-	    case  FLUX: 
-	    case  ATTACK_TIME: 
-	    case  DECAY_TIME: 
-	    case  DELTA_FEATURE: 
+	    case XTRACT_FLUX: 
+	    case XTRACT_ATTACK_TIME: 
+	    case XTRACT_DECAY_TIME: 
+	    case XTRACT_DELTA_FEATURE: 
 	    default:
-		*data_format = NO_DATA;
+		*data_format = XTRACT_NO_DATA;
 		break;
 	}
 
@@ -371,64 +371,64 @@
 
 	switch(f){
 
-	    case  MEAN: 
-	    case  VARIANCE:
-	    case  STANDARD_DEVIATION:
-	    case  AVERAGE_DEVIATION:
-	    case  SKEWNESS:
-	    case  KURTOSIS:
-	    case  LOWEST_VALUE:
-	    case  HIGHEST_VALUE:
-	    case  SUM:
-	    case  ZCR:
-	    case  PEAK_SPECTRUM:
-	    case  TRISTIMULUS_1:
-	    case  TRISTIMULUS_2:
-	    case  TRISTIMULUS_3:
-	    case  DCT:
-	    case  AMDF:
-	    case  ASDF:
-	    case  IRREGULARITY_K:
-	    case  IRREGULARITY_J:
-	    case  ATTACK_TIME: 
-	    case  DECAY_TIME: 
-	    case  DELTA_FEATURE: 
-	    case  FLUX: 
-	    case  F0:
-	    case  FAILSAFE_F0:
-	    case  MFCC:
-	    case  AUTOCORRELATION:
-	    case  AUTOCORRELATION_FFT:
-	    case  ROLLOFF:
-	    case  NOISINESS:
-	    case  CREST:
-	    case  FLATNESS:
-	    case  POWER:
-	    case  BARK_COEFFICIENTS:
-	    case  RMS_AMPLITUDE:
-	    case  SMOOTHNESS:
-	    case  SPREAD:
-	    case  SHARPNESS:
-	    case  HPS:
-	    case  SPECTRUM:
-	    case  TONALITY:
-	    case  LOUDNESS:
-		*data_unit = ANY;
+	    case XTRACT_MEAN: 
+	    case XTRACT_VARIANCE:
+	    case XTRACT_STANDARD_DEVIATION:
+	    case XTRACT_AVERAGE_DEVIATION:
+	    case XTRACT_SKEWNESS:
+	    case XTRACT_KURTOSIS:
+	    case XTRACT_LOWEST_VALUE:
+	    case XTRACT_HIGHEST_VALUE:
+	    case XTRACT_SUM:
+	    case XTRACT_ZCR:
+	    case XTRACT_PEAK_SPECTRUM:
+	    case XTRACT_TRISTIMULUS_1:
+	    case XTRACT_TRISTIMULUS_2:
+	    case XTRACT_TRISTIMULUS_3:
+	    case XTRACT_DCT:
+	    case XTRACT_AMDF:
+	    case XTRACT_ASDF:
+	    case XTRACT_IRREGULARITY_K:
+	    case XTRACT_IRREGULARITY_J:
+	    case XTRACT_ATTACK_TIME: 
+	    case XTRACT_DECAY_TIME: 
+	    case XTRACT_DELTA_FEATURE: 
+	    case XTRACT_FLUX: 
+	    case XTRACT_F0:
+	    case XTRACT_FAILSAFE_F0:
+	    case XTRACT_MFCC:
+	    case XTRACT_AUTOCORRELATION:
+	    case XTRACT_AUTOCORRELATION_FFT:
+	    case XTRACT_ROLLOFF:
+	    case XTRACT_NOISINESS:
+	    case XTRACT_CREST:
+	    case XTRACT_FLATNESS:
+	    case XTRACT_POWER:
+	    case XTRACT_BARK_COEFFICIENTS:
+	    case XTRACT_RMS_AMPLITUDE:
+	    case XTRACT_SMOOTHNESS:
+	    case XTRACT_SPREAD:
+	    case XTRACT_SHARPNESS:
+	    case XTRACT_HPS:
+	    case XTRACT_SPECTRUM:
+	    case XTRACT_TONALITY:
+	    case XTRACT_LOUDNESS:
+		*data_unit = XTRACT_ANY;
 		break;
-	    case  SPECTRAL_MEAN:
-	    case  SPECTRAL_VARIANCE:
-	    case  SPECTRAL_STANDARD_DEVIATION:
-	    case  SPECTRAL_AVERAGE_DEVIATION:
-	    case  SPECTRAL_SKEWNESS:
-	    case  SPECTRAL_KURTOSIS:
-	    case  SPECTRAL_CENTROID:
-	    case  SPECTRAL_SLOPE:
-	    case  HARMONIC_SPECTRUM:
-	    case  SPECTRAL_INHARMONICITY:
-		*data_unit = ANY_AMPLITUDE_HERTZ;
+	    case XTRACT_SPECTRAL_MEAN:
+	    case XTRACT_SPECTRAL_VARIANCE:
+	    case XTRACT_SPECTRAL_STANDARD_DEVIATION:
+	    case XTRACT_SPECTRAL_AVERAGE_DEVIATION:
+	    case XTRACT_SPECTRAL_SKEWNESS:
+	    case XTRACT_SPECTRAL_KURTOSIS:
+	    case XTRACT_SPECTRAL_CENTROID:
+	    case XTRACT_SPECTRAL_SLOPE:
+	    case XTRACT_HARMONIC_SPECTRUM:
+	    case XTRACT_SPECTRAL_INHARMONICITY:
+		*data_unit = XTRACT_ANY_AMPLITUDE_HERTZ;
 		break;
-	    case  ODD_EVEN_RATIO:
-		*data_unit = HERTZ;
+	    case XTRACT_ODD_EVEN_RATIO:
+		*data_unit = XTRACT_HERTZ;
 		break;
 	}
 
@@ -442,22 +442,22 @@
 	*year = 0;
 
 	switch(f){
-	    case  MEAN: 
+	    case XTRACT_MEAN: 
 		strcpy(name, "mean");
 		strcpy(p_name, "Mean");
 		strcpy(desc, "Extract the mean of an input vector");
 		strcpy(p_desc, "Extract the mean of a range of values");
 		strcpy(author, "");
-		d->argv.type = NONE;
+		d->argv.type = XTRACT_NONE;
 		break;
-	    case  VARIANCE:
+	    case XTRACT_VARIANCE:
 		strcpy(name, "variance");
 		strcpy(p_name, "Variance");
 		strcpy(desc, "Extract the variance of an input vector");
 		strcpy(p_desc, "Extract the variance of a range of values");
 		strcpy(author, "");
 		break;
-	    case  STANDARD_DEVIATION:
+	    case XTRACT_STANDARD_DEVIATION:
 		strcpy(name, "standard_deviation");
 		strcpy(p_name, "Standard Deviation");
 		strcpy(desc, 
@@ -466,7 +466,7 @@
 			"Extract the standard deviation of a range of values");
 		strcpy(author, "");
 		break;
-	    case  AVERAGE_DEVIATION:
+	    case XTRACT_AVERAGE_DEVIATION:
 		strcpy(name, "average_deviation");
 		strcpy(p_name, "Average Deviation");
 		strcpy(desc, 
@@ -475,21 +475,21 @@
 			"Extract the average deviation of a range of values");
 		strcpy(author, "");
 		break;
-	   case  SPECTRAL_MEAN: 
+	   case XTRACT_SPECTRAL_MEAN: 
 		strcpy(name, "spectral_mean");
 		strcpy(p_name, "Spectral Mean");
 		strcpy(desc, "Extract the mean of an input spectrum");
 		strcpy(p_desc, "Extract the mean of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  SPECTRAL_VARIANCE:
+	    case XTRACT_SPECTRAL_VARIANCE:
 		strcpy(name, "spectral_variance");
 		strcpy(p_name, "Spectral Variance");
 		strcpy(desc, "Extract the variance of an input spectrum");
 		strcpy(p_desc, "Extract the variance of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  SPECTRAL_STANDARD_DEVIATION:
+	    case XTRACT_SPECTRAL_STANDARD_DEVIATION:
 		strcpy(name, "spectral_standard_deviation");
 		strcpy(p_name, "Spectral Standard Deviation");
 		strcpy(desc, 
@@ -498,7 +498,7 @@
 			"Extract the standard deviation of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  SPECTRAL_AVERAGE_DEVIATION:
+	    case XTRACT_SPECTRAL_AVERAGE_DEVIATION:
 		strcpy(name, "spectral_average_deviation");
 		strcpy(p_name, "Spectral Average Deviation");
 		strcpy(desc, 
@@ -507,7 +507,7 @@
 			"Extract the average deviation of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  ROLLOFF:
+	    case XTRACT_ROLLOFF:
 		strcpy(name, "spectral_rolloff");
 		strcpy(p_name, "Spectral Rolloff");
 		strcpy(desc, 
@@ -517,14 +517,14 @@
 		strcpy(author, "Bee Suan Ong");
 		*year = 2005;
 		break;
-	    case  SPECTRAL_INHARMONICITY:
+	    case XTRACT_SPECTRAL_INHARMONICITY:
 		strcpy(name, "spectral_inharmonicity");
 		strcpy(p_name, "Inharmonicity");
 		strcpy(desc, "Extract the inharmonicity of a spectrum");
 		strcpy(p_desc, 
 			"Extract the inharmonicity of an audio spectrum");
 		break;
-	    case  SPECTRUM:
+	    case XTRACT_SPECTRUM:
 		strcpy(name, "spectrum");
 		strcpy(p_name, "Spectrum");
 		strcpy(desc, 
@@ -533,7 +533,7 @@
 			"Extract the spectrum of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  ODD_EVEN_RATIO:
+	    case XTRACT_ODD_EVEN_RATIO:
 		strcpy(name, "odd_even_ratio");
 		strcpy(p_name, "Odd/Even Harmonic Ratio");
 		strcpy(desc, 
@@ -542,14 +542,14 @@
 		 "Extract the odd-to-even harmonic ratio of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  LOWEST_VALUE:
+	    case XTRACT_LOWEST_VALUE:
 		strcpy(name, "lowest_value");
 		strcpy(p_name, "Lowest Value");
 		strcpy(desc, "Extract the lowest value from an input vector");
 		strcpy(p_desc, "Extract the lowest value from a given range");
 		strcpy(author, "");
 		break;
-	    case  F0:
+	    case XTRACT_F0:
 		strcpy(name, "f0");
 		strcpy(p_name, "Fundamental Frequency");
 		strcpy(desc, "Extract the fundamental frequency	of a signal");
@@ -557,7 +557,7 @@
 			"Extract the fundamental frequency of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  FAILSAFE_F0:
+	    case XTRACT_FAILSAFE_F0:
 		strcpy(name, "failsafe_f0");
 		strcpy(p_name, "Fundamental Frequency (failsafe)");
 		strcpy(desc, "Extract the fundamental frequency of a signal");
@@ -565,7 +565,7 @@
 			"Extract the fundamental frequency of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  TONALITY:
+	    case XTRACT_TONALITY:
 		strcpy(name, "tonality");
 		strcpy(p_name, "Tonality");
 		strcpy(desc, "Extract the tonality of a spectrum");
@@ -573,21 +573,21 @@
 		strcpy(author, "Tristan Jehan");
 		*year = 2005;
 		break;
-	    case  SPECTRAL_SKEWNESS:
+	    case XTRACT_SPECTRAL_SKEWNESS:
 		strcpy(name, "spectral_skewness");
 		strcpy(p_name, "Spectral Skewness");
 		strcpy(desc, "Extract the skewness of an input spectrum");
 		strcpy(p_desc, "Extract the skewness of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  SPECTRAL_KURTOSIS:
+	    case XTRACT_SPECTRAL_KURTOSIS:
 		strcpy(name, "spectral_kurtosis");
 		strcpy(p_name, "Spectral Kurtosis");
 		strcpy(desc, "Extract the kurtosis of an input spectrum");
 		strcpy(p_desc, "Extract the kurtosis of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  PEAK_SPECTRUM:
+	    case XTRACT_PEAK_SPECTRUM:
 		strcpy(name, "peak_spectrum");
 		strcpy(p_name, "Peak Spectrum");
 		strcpy(desc, "Extract the spectral peaks from of a spectrum");
@@ -595,14 +595,14 @@
 			"Extract the spectral peaks from an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  HARMONIC_SPECTRUM:
+	    case XTRACT_HARMONIC_SPECTRUM:
 		strcpy(p_name, "harmonic_spectrum");
 		strcpy(p_name, "Harmonic Spectrum");
 		strcpy(desc, "Extract the harmonics from a spectrum");
 		strcpy(p_desc, "Extract the harmonics from an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  NOISINESS:
+	    case XTRACT_NOISINESS:
 		strcpy(name, "noisiness");
 		strcpy(p_name, "Noisiness");
 		strcpy(desc, "Extract the noisiness of a spectrum");
@@ -610,7 +610,7 @@
 		strcpy(author, "Tae Hong Park");
 		*year = 2000;
 		break;
-	    case  CREST:
+	    case XTRACT_CREST:
 		strcpy(name, "crest");
 		strcpy(p_name, "Spectral Crest Measure");
 		strcpy(desc, 
@@ -620,14 +620,14 @@
 		strcpy(author, "Peeters");
 		*year = 2003;
 		break;
-	    case  MFCC:
+	    case XTRACT_MFCC:
 		strcpy(name, "mfcc");
 		strcpy(p_name, "Mel-Frequency Cepstral Coefficients");
 		strcpy(desc, "Extract MFCC from a spectrum");
 		strcpy(p_desc, "Extract MFCC from an audio spectrum");
 		strcpy(author, "Rabiner");
 		break;
-	    case  BARK_COEFFICIENTS:
+	    case XTRACT_BARK_COEFFICIENTS:
 		strcpy(name, "bark_coefficients");
 		strcpy(p_name, "Bark Coefficients");
 		strcpy(desc, "Extract bark coefficients from a spectrum");
@@ -635,7 +635,7 @@
 			"Extract bark coefficients from an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  SPECTRAL_CENTROID:
+	    case XTRACT_SPECTRAL_CENTROID:
 		strcpy(name, "spectral_centroid");
 		strcpy(p_name, "Spectral Centroid");
 		strcpy(desc, "Extract the spectral centroid of a spectrum");
@@ -643,7 +643,7 @@
 			"Extract the spectral centroid of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  IRREGULARITY_K:
+	    case XTRACT_IRREGULARITY_K:
 		strcpy(name, "irregularity_k");
 		strcpy(p_name, "Irregularity I");
 		strcpy(desc, "Extract the irregularity of a spectrum");
@@ -652,7 +652,7 @@
 		strcpy(author, "Krimphoff");
 		*year = 1994;
 		break;
-	    case  IRREGULARITY_J:
+	    case XTRACT_IRREGULARITY_J:
 		strcpy(name, "irregularity_j");
 		strcpy(p_name, "Irregularity II");
 		strcpy(desc, "Extract the irregularity of a spectrum");
@@ -661,7 +661,7 @@
 		strcpy(author, "Jensen");
 		*year = 1999;
 		break;
-	    case  TRISTIMULUS_1:
+	    case XTRACT_TRISTIMULUS_1:
 		strcpy(name, "tristimulus_1");
 		strcpy(p_name, "Tristimulus I");
 		strcpy(desc, "Extract the tristimulus (type I) of a spectrum");
@@ -670,7 +670,7 @@
 		strcpy(author, "Pollard and Jansson");
 		*year = 1982;
 		break;
-	    case  TRISTIMULUS_2:
+	    case XTRACT_TRISTIMULUS_2:
 		strcpy(name, "tristimulus_2");
 		strcpy(p_name, "Tristimulus II");
 		strcpy(desc, "Extract the tristimulus (type II) of a spectrum");
@@ -679,7 +679,7 @@
 		strcpy(author, "Pollard and Jansson");
 		*year = 1982;
 		break;
-	    case  TRISTIMULUS_3:
+	    case XTRACT_TRISTIMULUS_3:
 		strcpy(name, "tristimulus_3");
 		strcpy(p_name, "Tristimulus III");
 		strcpy(desc, 
@@ -689,7 +689,7 @@
 		strcpy(author, "Pollard and Jansson");
 		*year = 1982;
 		break;
-	    case  SMOOTHNESS:
+	    case XTRACT_SMOOTHNESS:
 		strcpy(name, "smoothness");
 		strcpy(p_name, "Spectral Smoothness");
 		strcpy(desc, "Extract the spectral smoothness of a spectrum");
@@ -698,7 +698,7 @@
 		strcpy(author, "McAdams");
 		*year = 1999;
 		break;
-	    case  FLATNESS:
+	    case XTRACT_FLATNESS:
 		strcpy(name, "flatness");
 		strcpy(p_name, "Spectral Flatness");
 		strcpy(desc, "Extract the spectral flatness of a spectrum");
@@ -707,7 +707,7 @@
 		strcpy(author, "Tristan Jehan");
 		*year = 2005;
 		break;
-	    case  SPREAD:
+	    case XTRACT_SPREAD:
 		strcpy(name, "spread");
 		strcpy(p_name, "Spectral Spread");
 		strcpy(desc, "Extract the spectral spread of a spectrum");
@@ -716,7 +716,7 @@
 		strcpy(author, "Norman Casagrande");
 		*year = 2005;
 		break;
-	    case  ZCR:
+	    case XTRACT_ZCR:
 		strcpy(name, "zcr");
 		strcpy(p_name, "Zero Crossing Rate");
 		strcpy(desc, "Extract the zero crossing rate of a vector");
@@ -724,7 +724,7 @@
 			"Extract the zero crossing rate of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  LOUDNESS:
+	    case XTRACT_LOUDNESS:
 		strcpy(name, "loudness");
 		strcpy(p_name, "Loudness");
 		strcpy(desc, 
@@ -734,14 +734,14 @@
 		strcpy(author, "Moore, Glasberg et al");
 		*year = 2005;
 		break;
-	    case  HIGHEST_VALUE:
+	    case XTRACT_HIGHEST_VALUE:
 		strcpy(name, "highest_value");
 		strcpy(p_name, "Highest Value");
 		strcpy(desc, "Extract the highest value from an input vector");
 		strcpy(p_desc, "Extract the highest value from a given range");
 		strcpy(author, "");
 		break;
-	    case  SUM:
+	    case XTRACT_SUM:
 		strcpy(name, "sum");
 		strcpy(p_name, "Sum of Values");
 		strcpy(desc, 
@@ -750,14 +750,14 @@
 			"Extract the sum of the values in a given range");
 		strcpy(author, "");
 		break;
-	    case  RMS_AMPLITUDE:
+	    case XTRACT_RMS_AMPLITUDE:
 		strcpy(name, "rms_amplitude");
 		strcpy(p_name, "RMS Amplitude");
 		strcpy(desc, "Extract the RMS amplitude of a signal");
 		strcpy(p_desc, "Extract the RMS amplitude of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  POWER:
+	    case XTRACT_POWER:
 		strcpy(name, "power");
 		strcpy(p_name, "Spectral Power");
 		strcpy(desc, "Extract the spectral power of a spectrum");
@@ -766,7 +766,7 @@
 		strcpy(author, "Bee Suan Ong");
 		*year = 2005;
 		break;
-	    case  SHARPNESS:
+	    case XTRACT_SHARPNESS:
 		strcpy(name, "sharpness");
 		strcpy(p_name, "Spectral Sharpness");
 		strcpy(desc, "Extract the spectral sharpness of a spectrum");
@@ -774,7 +774,7 @@
 			"Extract the spectral sharpness of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  SPECTRAL_SLOPE:
+	    case XTRACT_SPECTRAL_SLOPE:
 		strcpy(name, "spectral_slope");
 		strcpy(p_name, "Spectral Slope");
 		strcpy(desc, "Extract the spectral slope of a spectrum");
@@ -782,7 +782,7 @@
 			"Extract the spectral slope of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  HPS:
+	    case XTRACT_HPS:
 		strcpy(name, "hps");
 		strcpy(p_name, "Harmonic Product Spectrum");
 		strcpy(desc, 
@@ -791,7 +791,7 @@
 		 "Extract the harmonic product spectrum of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  FLUX: 
+	    case XTRACT_FLUX: 
 		strcpy(name, "flux");
 		strcpy(p_name, "Spectral Flux");
 		strcpy(desc, "Extract the spectral flux of a spectrum");
@@ -799,42 +799,42 @@
 			"Extract the spectral flux of an audio spectrum");
 		strcpy(author, "");
 		break;
-	    case  ATTACK_TIME: 
+	    case XTRACT_ATTACK_TIME: 
 		strcpy(name, "attack_time");
 		strcpy(p_name, "Attack Time");
 		strcpy(desc, "Extract the attack time of a signal");
 		strcpy(p_desc, "Extract the attack time of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  DECAY_TIME: 
+	    case XTRACT_DECAY_TIME: 
 		strcpy(name, "decay_time");
 		strcpy(p_name, "Decay Time");
 		strcpy(desc, "Extract the decay time of a signal");
 		strcpy(p_desc, "Extract the decay time of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  DELTA_FEATURE: 
+	    case XTRACT_DELTA_FEATURE: 
 		strcpy(name, "delta_feature");
 		strcpy(p_name, "Delta Feature");
 		strcpy(desc, "Extract the time derivative of a feature");
 		strcpy(p_desc, "Extract the time derivative of a feature");
 		strcpy(author, "");
 		break;
-	    case  AUTOCORRELATION_FFT:
+	    case XTRACT_AUTOCORRELATION_FFT:
 		strcpy(name, "autocorrelation_fft");
 		strcpy(p_name, "Autocorrelation (FFT method)");
 		strcpy(desc, "Extract the autocorrelation of a signal");
 		strcpy(p_desc, "Extract the autocorrelation of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  DCT:
+	    case XTRACT_DCT:
 		strcpy(name, "dct");
 		strcpy(p_name, "Discrete Cosine Transform");
 		strcpy(desc, "Extract the DCT of a signal");
 		strcpy(p_desc, "Extract the DCT of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  AUTOCORRELATION:
+	    case XTRACT_AUTOCORRELATION:
 		strcpy(name, "autocorrelation");
 		strcpy(p_name, "Autocorrelation");
 		strcpy(desc, "Extract the autocorrelation of a signal");
@@ -842,14 +842,14 @@
 			"Extract the autocorrelation of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  AMDF:
+	    case XTRACT_AMDF:
 		strcpy(name, "amdf");
 		strcpy(p_name, "Average Magnitude Difference Function");
 		strcpy(desc, "Extract the AMDF of a signal");
 		strcpy(p_desc, "Extract the AMDF of an audio signal");
 		strcpy(author, "");
 		break;
-	    case  ASDF:
+	    case XTRACT_ASDF:
 		strcpy(name, "asdf");
 		strcpy(p_name, "Average Squared Difference Function");
 		strcpy(desc, "Extract the ASDF of a signal");
@@ -868,71 +868,71 @@
 
 	switch(f){
 
-	    case  VARIANCE:
-	    case  STANDARD_DEVIATION:
-	    case  AVERAGE_DEVIATION:
-	    case  SPECTRAL_VARIANCE:
-	    case  SPECTRAL_STANDARD_DEVIATION:
-	    case  SPECTRAL_AVERAGE_DEVIATION:
-	    case  SPECTRAL_INHARMONICITY:
-	    case  ODD_EVEN_RATIO:
-	    case  LOWEST_VALUE:
-	    case  F0:
-	    case  FAILSAFE_F0:
-	    case  TONALITY:
+	    case XTRACT_VARIANCE:
+	    case XTRACT_STANDARD_DEVIATION:
+	    case XTRACT_AVERAGE_DEVIATION:
+	    case XTRACT_SPECTRAL_VARIANCE:
+	    case XTRACT_SPECTRAL_STANDARD_DEVIATION:
+	    case XTRACT_SPECTRAL_AVERAGE_DEVIATION:
+	    case XTRACT_SPECTRAL_INHARMONICITY:
+	    case XTRACT_ODD_EVEN_RATIO:
+	    case XTRACT_LOWEST_VALUE:
+	    case XTRACT_F0:
+	    case XTRACT_FAILSAFE_F0:
+	    case XTRACT_TONALITY:
 		*argc = 1;
-		*argv_type = FLOAT;
+		*argv_type = XTRACT_FLOAT;
 		break;
-	    case  SKEWNESS:
-	    case  KURTOSIS:
-	    case  SPECTRAL_SKEWNESS:
-	    case  SPECTRAL_KURTOSIS:
-	    case  SPECTRUM:
-	    case  PEAK_SPECTRUM:
-	    case  HARMONIC_SPECTRUM:
-	    case  NOISINESS:
-	    case  CREST:
-	    case  ROLLOFF:
+	    case XTRACT_SKEWNESS:
+	    case XTRACT_KURTOSIS:
+	    case XTRACT_SPECTRAL_SKEWNESS:
+	    case XTRACT_SPECTRAL_KURTOSIS:
+	    case XTRACT_SPECTRUM:
+	    case XTRACT_PEAK_SPECTRUM:
+	    case XTRACT_HARMONIC_SPECTRUM:
+	    case XTRACT_NOISINESS:
+	    case XTRACT_CREST:
+	    case XTRACT_ROLLOFF:
 		*argc = 2;
-		*argv_type = FLOAT;
+		*argv_type = XTRACT_FLOAT;
 		break;
-	    case  MFCC:
+	    case XTRACT_MFCC:
 		*argc = 1;
-		*argv_type = MEL_FILTER;
+		*argv_type = XTRACT_MEL_FILTER;
 		break;
-	    case  BARK_COEFFICIENTS:
-		*argc = BARK_BANDS;
-		*argv_type = INT;
+	    case XTRACT_BARK_COEFFICIENTS:
+		*argc = XTRACT_BARK_BANDS;
+		*argv_type = XTRACT_INT;
 		break;
-	    case  MEAN:
-	    case  SPECTRAL_MEAN:
-	    case  SPECTRAL_CENTROID:
-	    case  IRREGULARITY_K:
-	    case  IRREGULARITY_J:
-	    case  TRISTIMULUS_1:
-	    case  TRISTIMULUS_2:
-	    case  TRISTIMULUS_3:
-	    case  SMOOTHNESS:
-	    case  FLATNESS:
-	    case  SPREAD:
-	    case  ZCR:
-	    case  LOUDNESS:
-	    case  HIGHEST_VALUE:
-	    case  SUM:
-	    case  RMS_AMPLITUDE:
-	    case  POWER:
-	    case  SHARPNESS:
-	    case  SPECTRAL_SLOPE:
-	    case  HPS:
-	    case  FLUX: 
-	    case  ATTACK_TIME: 
-	    case  DECAY_TIME: 
-	    case  DELTA_FEATURE: 
-	    case  AUTOCORRELATION_FFT:
-	    case  DCT:
-	    case  AUTOCORRELATION:
-	    case  AMDF:
-	    case  ASDF:
+	    case XTRACT_MEAN:
+	    case XTRACT_SPECTRAL_MEAN:
+	    case XTRACT_SPECTRAL_CENTROID:
+	    case XTRACT_IRREGULARITY_K:
+	    case XTRACT_IRREGULARITY_J:
+	    case XTRACT_TRISTIMULUS_1:
+	    case XTRACT_TRISTIMULUS_2:
+	    case XTRACT_TRISTIMULUS_3:
+	    case XTRACT_SMOOTHNESS:
+	    case XTRACT_FLATNESS:
+	    case XTRACT_SPREAD:
+	    case XTRACT_ZCR:
+	    case XTRACT_LOUDNESS:
+	    case XTRACT_HIGHEST_VALUE:
+	    case XTRACT_SUM:
+	    case XTRACT_RMS_AMPLITUDE:
+	    case XTRACT_POWER:
+	    case XTRACT_SHARPNESS:
+	    case XTRACT_SPECTRAL_SLOPE:
+	    case XTRACT_HPS:
+	    case XTRACT_FLUX: 
+	    case XTRACT_ATTACK_TIME: 
+	    case XTRACT_DECAY_TIME: 
+	    case XTRACT_DELTA_FEATURE: 
+	    case XTRACT_AUTOCORRELATION_FFT:
+	    case XTRACT_DCT:
+	    case XTRACT_AUTOCORRELATION:
+	    case XTRACT_AMDF:
+	    case XTRACT_ASDF:
 	    default:
 		*argc = 0;
 		break;
@@ -941,61 +941,61 @@
 	is_scalar = &d->is_scalar;
 
 	switch(f){
-	    case  MEAN:
-	    case  VARIANCE:
-	    case  STANDARD_DEVIATION:
-	    case  AVERAGE_DEVIATION:
-	    case  SKEWNESS:
-	    case  KURTOSIS:
-	    case  SPECTRAL_MEAN:
-	    case  SPECTRAL_VARIANCE:
-	    case  SPECTRAL_STANDARD_DEVIATION:
-	    case  SPECTRAL_AVERAGE_DEVIATION:
-	    case  SPECTRAL_SKEWNESS:
-	    case  SPECTRAL_KURTOSIS:
-	    case  SPECTRAL_CENTROID:
-	    case  IRREGULARITY_K:
-	    case  IRREGULARITY_J:
-	    case  TRISTIMULUS_1:
-	    case  TRISTIMULUS_2:
-	    case  TRISTIMULUS_3:
-	    case  SMOOTHNESS:
-	    case  SPREAD:
-	    case  ZCR:
-	    case  ROLLOFF:
-	    case  LOUDNESS:
-	    case  FLATNESS:
-	    case  TONALITY:
-	    case  CREST:
-	    case  NOISINESS:
-	    case  RMS_AMPLITUDE:
-	    case  SPECTRAL_INHARMONICITY:
-	    case  POWER:
-	    case  ODD_EVEN_RATIO:
-	    case  SHARPNESS:
-	    case  SPECTRAL_SLOPE:
-	    case  LOWEST_VALUE:
-	    case  HIGHEST_VALUE:
-	    case  SUM:
-	    case  HPS:
-	    case  F0:
-	    case  FAILSAFE_F0:
-		*is_scalar = TRUE;
+	    case XTRACT_MEAN:
+	    case XTRACT_VARIANCE:
+	    case XTRACT_STANDARD_DEVIATION:
+	    case XTRACT_AVERAGE_DEVIATION:
+	    case XTRACT_SKEWNESS:
+	    case XTRACT_KURTOSIS:
+	    case XTRACT_SPECTRAL_MEAN:
+	    case XTRACT_SPECTRAL_VARIANCE:
+	    case XTRACT_SPECTRAL_STANDARD_DEVIATION:
+	    case XTRACT_SPECTRAL_AVERAGE_DEVIATION:
+	    case XTRACT_SPECTRAL_SKEWNESS:
+	    case XTRACT_SPECTRAL_KURTOSIS:
+	    case XTRACT_SPECTRAL_CENTROID:
+	    case XTRACT_IRREGULARITY_K:
+	    case XTRACT_IRREGULARITY_J:
+	    case XTRACT_TRISTIMULUS_1:
+	    case XTRACT_TRISTIMULUS_2:
+	    case XTRACT_TRISTIMULUS_3:
+	    case XTRACT_SMOOTHNESS:
+	    case XTRACT_SPREAD:
+	    case XTRACT_ZCR:
+	    case XTRACT_ROLLOFF:
+	    case XTRACT_LOUDNESS:
+	    case XTRACT_FLATNESS:
+	    case XTRACT_TONALITY:
+	    case XTRACT_CREST:
+	    case XTRACT_NOISINESS:
+	    case XTRACT_RMS_AMPLITUDE:
+	    case XTRACT_SPECTRAL_INHARMONICITY:
+	    case XTRACT_POWER:
+	    case XTRACT_ODD_EVEN_RATIO:
+	    case XTRACT_SHARPNESS:
+	    case XTRACT_SPECTRAL_SLOPE:
+	    case XTRACT_LOWEST_VALUE:
+	    case XTRACT_HIGHEST_VALUE:
+	    case XTRACT_SUM:
+	    case XTRACT_HPS:
+	    case XTRACT_F0:
+	    case XTRACT_FAILSAFE_F0:
+		*is_scalar = XTRACT_TRUE;
 		break;
-	    case  AUTOCORRELATION:
-	    case  AMDF:
-	    case  ASDF:
-	    case  BARK_COEFFICIENTS:
-	    case  PEAK_SPECTRUM:
-	    case  SPECTRUM:
-	    case  AUTOCORRELATION_FFT:
-	    case  MFCC:
-	    case  DCT:
-	    case  HARMONIC_SPECTRUM:
-		*is_scalar = FALSE;
+	    case XTRACT_AUTOCORRELATION:
+	    case XTRACT_AMDF:
+	    case XTRACT_ASDF:
+	    case XTRACT_BARK_COEFFICIENTS:
+	    case XTRACT_PEAK_SPECTRUM:
+	    case XTRACT_SPECTRUM:
+	    case XTRACT_AUTOCORRELATION_FFT:
+	    case XTRACT_MFCC:
+	    case XTRACT_DCT:
+	    case XTRACT_HARMONIC_SPECTRUM:
+		*is_scalar = XTRACT_FALSE;
 		break;
 	    default:
-		*is_scalar = TRUE;
+		*is_scalar = XTRACT_TRUE;
 		break;
 
 	}
@@ -1007,66 +1007,66 @@
 	    result_max = &d->result.scalar.max;
 
 	    switch(f){
-		case  MEAN:
-		case  VARIANCE:
-		case  STANDARD_DEVIATION:
-		case  AVERAGE_DEVIATION:
-		case  SKEWNESS:
-		case  KURTOSIS:
-		case  RMS_AMPLITUDE:
-		case  LOWEST_VALUE:
-		case  HIGHEST_VALUE:
-		case  SUM:
-		    *result_unit = ANY;
-		    *result_min = ANY;
-		    *result_max = ANY;
+		case XTRACT_MEAN:
+		case XTRACT_VARIANCE:
+		case XTRACT_STANDARD_DEVIATION:
+		case XTRACT_AVERAGE_DEVIATION:
+		case XTRACT_SKEWNESS:
+		case XTRACT_KURTOSIS:
+		case XTRACT_RMS_AMPLITUDE:
+		case XTRACT_LOWEST_VALUE:
+		case XTRACT_HIGHEST_VALUE:
+		case XTRACT_SUM:
+		    *result_unit = XTRACT_ANY;
+		    *result_min = XTRACT_ANY;
+		    *result_max = XTRACT_ANY;
 		    break;
-		case  SPECTRAL_SKEWNESS:
-		case  SPECTRAL_KURTOSIS:
-		case  IRREGULARITY_K:
-		case  IRREGULARITY_J:
-		case  TRISTIMULUS_1:
-		case  TRISTIMULUS_2:
-		case  TRISTIMULUS_3:
-		case  NOISINESS:
-		case  SMOOTHNESS:
-		    *result_unit = NONE;
-		    *result_min = ANY; /* FIX: need to check these */
-		    *result_max = ANY;
+		case XTRACT_SPECTRAL_SKEWNESS:
+		case XTRACT_SPECTRAL_KURTOSIS:
+		case XTRACT_IRREGULARITY_K:
+		case XTRACT_IRREGULARITY_J:
+		case XTRACT_TRISTIMULUS_1:
+		case XTRACT_TRISTIMULUS_2:
+		case XTRACT_TRISTIMULUS_3:
+		case XTRACT_NOISINESS:
+		case XTRACT_SMOOTHNESS:
+		    *result_unit = XTRACT_NONE;
+		    *result_min = XTRACT_ANY; /* FIX: need to check these */
+		    *result_max = XTRACT_ANY;
 		    break;
-		case  SPECTRAL_MEAN:
-		case  SPECTRAL_VARIANCE:
-		case  SPECTRAL_STANDARD_DEVIATION:
-		case  SPECTRAL_AVERAGE_DEVIATION:
-		case  SPECTRAL_CENTROID:
-		case  SPREAD:
-		case  F0:
-		case  FAILSAFE_F0:
-		case  HPS:
-		case  ROLLOFF:
-		    *result_unit = HERTZ;
+		case XTRACT_SPECTRAL_MEAN:
+		case XTRACT_SPECTRAL_VARIANCE:
+		case XTRACT_SPECTRAL_STANDARD_DEVIATION:
+		case XTRACT_SPECTRAL_AVERAGE_DEVIATION:
+		case XTRACT_SPECTRAL_CENTROID:
+		case XTRACT_SPREAD:
+		case XTRACT_F0:
+		case XTRACT_FAILSAFE_F0:
+		case XTRACT_HPS:
+		case XTRACT_ROLLOFF:
+		    *result_unit = XTRACT_HERTZ;
 		    *result_min = 0.f;
-		    *result_max = SR_UPPER_LIMIT / 2;
-		case  ZCR:
-		    *result_unit = HERTZ;
+		    *result_max = XTRACT_SR_UPPER_LIMIT / 2;
+		case XTRACT_ZCR:
+		    *result_unit = XTRACT_HERTZ;
 		    *result_min = 0.f;
-		    *result_max = ANY;
-		case  ODD_EVEN_RATIO:
-		    *result_unit = NONE;
+		    *result_max = XTRACT_ANY;
+		case XTRACT_ODD_EVEN_RATIO:
+		    *result_unit = XTRACT_NONE;
 		    *result_min = 0.f;
 		    *result_max = 1.f; 
-		case  LOUDNESS:
-		case  FLATNESS:
-		case  TONALITY:
-		case  CREST:
-		case  SPECTRAL_INHARMONICITY:
-		case  POWER:
-		case  SHARPNESS:
-		case  SPECTRAL_SLOPE:
+		case XTRACT_LOUDNESS:
+		case XTRACT_FLATNESS:
+		case XTRACT_TONALITY:
+		case XTRACT_CREST:
+		case XTRACT_SPECTRAL_INHARMONICITY:
+		case XTRACT_POWER:
+		case XTRACT_SHARPNESS:
+		case XTRACT_SPECTRAL_SLOPE:
 		default:
-		    *result_unit = UNKNOWN;
-		    *result_min = UNKNOWN;
-		    *result_max = UNKNOWN; 
+		    *result_unit = XTRACT_UNKNOWN;
+		    *result_min = XTRACT_UNKNOWN;
+		    *result_max = XTRACT_UNKNOWN; 
 	    }
 	}
 	else {
@@ -1077,24 +1077,24 @@
 	    result_format = &d->result.vector.format;
 
 	    switch(f) {
-		case  AUTOCORRELATION:
-		case  AMDF:
-		case  ASDF:
-		case  DCT:
-		    *result_format = ARBITRARY_SERIES;
-		    *result_unit = ANY;
-		case  BARK_COEFFICIENTS:
-		    *result_format = BARK_COEFFS;
-		    *result_unit = UNKNOWN; /* FIX: check */
-		case  PEAK_SPECTRUM:
-		case  SPECTRUM:
-		case  HARMONIC_SPECTRUM:
-		    *result_format = SPECTRAL;
-		    *result_unit = ANY_AMPLITUDE_HERTZ;
-		case  AUTOCORRELATION_FFT:
-		case  MFCC:
-		    *result_format = MEL_COEFFS;
-		    *result_unit = UNKNOWN; /* FIX: check */
+		case XTRACT_AUTOCORRELATION:
+		case XTRACT_AMDF:
+		case XTRACT_ASDF:
+		case XTRACT_DCT:
+		    *result_format = XTRACT_ARBITRARY_SERIES;
+		    *result_unit = XTRACT_ANY;
+		case XTRACT_BARK_COEFFICIENTS:
+		    *result_format = XTRACT_BARK_COEFFS;
+		    *result_unit = XTRACT_UNKNOWN; /* FIX: check */
+		case XTRACT_PEAK_SPECTRUM:
+		case XTRACT_SPECTRUM:
+		case XTRACT_HARMONIC_SPECTRUM:
+		    *result_format = XTRACT_SPECTRAL;
+		    *result_unit = XTRACT_ANY_AMPLITUDE_HERTZ;
+		case XTRACT_AUTOCORRELATION_FFT:
+		case XTRACT_MFCC:
+		    *result_format = XTRACT_MEL_COEFFS;
+		    *result_unit = XTRACT_UNKNOWN; /* FIX: check */
 		default:
 		    break;
 	    }
@@ -1110,7 +1110,7 @@
 	free(fd);
     }
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 
--- a/src/init.c	Sun Jan 21 14:40:23 2007 +0000
+++ b/src/init.c	Mon Jan 29 11:30:11 2007 +0000
@@ -46,7 +46,7 @@
 
     if(mel_peak == NULL || height_norm == NULL || 
                     lin_peak == NULL || fft_peak == NULL)
-                    return MALLOC_FAILED;
+                    return XTRACT_MALLOC_FAILED;
     
     M = N >> 1;
 
@@ -64,7 +64,7 @@
 
     for (n = 0; n < freq_bands; n++){
         /*roll out normalised gain of each peak*/
-        if (style == EQUAL_GAIN){
+        if (style == XTRACT_EQUAL_GAIN){
             height = 1;	
             norm_fact = norm;
         }
@@ -118,7 +118,7 @@
     free(height_norm);
     free(fft_peak);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 
 }
 
@@ -126,7 +126,7 @@
 
     float  edges[] = {0, 100, 200, 300, 400, 510, 630, 770, 920, 1080, 1270, 1480, 1720, 2000, 2320, 2700, 3150, 3700, 4400, 5300, 6400, 7700, 9500, 12000, 15500, 20500, 27000}; /* Takes us up to sr = 54kHz (CCRMA: JOS)*/
 
-    int M, bands = BARK_BANDS;
+    int M, bands = XTRACT_BARK_BANDS;
     
     M = N >> 1;
     
@@ -134,5 +134,5 @@
         band_limits[bands] = edges[bands] / nyquist * M;
         /*FIX shohuld use rounding, but couldn't get it to work */
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
--- a/src/libxtract.c	Sun Jan 21 14:40:23 2007 +0000
+++ b/src/libxtract.c	Mon Jan 29 11:30:11 2007 +0000
@@ -20,7 +20,7 @@
 
 
 #include "xtract/libxtract.h"
-#define XTRACT
+#define XTRACT_H
 
 int(*xtract[])(const float *, const int, const void *, float *) = {
     /* xtract_scalar.h */
@@ -81,53 +81,3 @@
     xtract_harmonic_spectrum
 };
 
-
-/*char *xtract_help_strings[] = {
-   "xtract_mean",
-   "xtract_variance",
-   "xtract_standard_deviation",
-   "xtract_average_deviation",
-   "xtract_skewness",
-   "xtract_kurtosis",
-   "xtract_centroid",
-   "xtract_irregularity_k",
-   "xtract_irregularity_j",
-   "xtract_tristimulus_1",
-   "xtract_tristimulus_2",
-   "xtract_tristimulus_3",
-   "xtract_smoothness",
-   "xtract_spread",
-   "xtract_zcr",
-   "xtract_rolloff",
-   "xtract_loudness",
-   "xtract_flatness",
-   "xtract_tonality",
-   "xtract_crest",
-   "xtract_noisiness",
-   "xtract_rms_amplitude",
-   "xtract_inharmonicity",
-   "xtract_power",
-   "xtract_odd_even_ratio",
-   "xtract_sharpness",
-   "xtract_slope",
-   "xtract_lowest_value",
-   "xtract_highest_value",
-   "xtract_sum",
-   "xtract_hps",
-   "xtract_f0",
-   "xtract_failsafe_f0",
-   "xtract_flux",
-   "xtract_attack_time",
-   "xtract_decay_time",
-   "xtract_delta_feature",
-   "xtract_autocorrelation",
-   "xtract_amdf",
-   "xtract_asdf",
-   "xtract_bark_coefficients",
-   "xtract_peaks",
-   "xtract_magnitude_spectrum",
-   "xtract_autocorrelation_fft",
-   "xtract_mfcc",
-   "xtract_dct",
-   "xtract_harmonics"
-   }; */
--- a/src/scalar.c	Sun Jan 21 14:40:23 2007 +0000
+++ b/src/scalar.c	Mon Jan 29 11:30:11 2007 +0000
@@ -22,6 +22,7 @@
 /* xtract_scalar.c: defines functions that extract a feature as a single value from an input vector */
 
 #include "xtract/libxtract.h"
+#include "xtract_macros_private.h"
 #include "math.h"
 #include <stdlib.h>
 #include <string.h>
@@ -35,7 +36,7 @@
 
     *result /= N;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_variance(const float *data, const int N, const void *argv, float *result){
@@ -47,14 +48,14 @@
 
     *result = *result / (N - 1);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_standard_deviation(const float *data, const int N, const void *argv, float *result){
 
     *result = sqrt(*(float *)argv);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_average_deviation(const float *data, const int N, const void *argv, float *result){
@@ -66,7 +67,7 @@
 
     *result /= N;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_skewness(const float *data, const int N, const void *argv,  float *result){
@@ -82,7 +83,7 @@
 
     *result /= N;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_kurtosis(const float *data, const int N, const void *argv,  float *result){
@@ -99,7 +100,7 @@
     *result /= N;
     *result -= 3.0f;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_spectral_centroid(const float *data, const int N, const void *argv,  float *result){
@@ -119,7 +120,7 @@
 
     *result = FA / A;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_spectral_mean(const float *data, const int N, const void *argv, float *result){
@@ -146,14 +147,14 @@
 
     *result = *result / (A - 1);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_spectral_standard_deviation(const float *data, const int N, const void *argv, float *result){
 
     *result = sqrt(*(float *)argv);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_spectral_average_deviation(const float *data, const int N, const void *argv, float *result){
@@ -174,7 +175,7 @@
 
     *result /= A;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_spectral_skewness(const float *data, const int N, const void *argv,  float *result){
@@ -197,7 +198,7 @@
 
     *result /= A;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_spectral_kurtosis(const float *data, const int N, const void *argv,  float *result){
@@ -221,7 +222,7 @@
     *result /= A;
     *result -= 3.0f;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_irregularity_k(const float *data, const int N, const void *argv, float *result){
@@ -232,7 +233,7 @@
     for(n = 1; n < M; n++)
 	*result += fabs(data[n] - (data[n-1] + data[n] + data[n+1]) / 3);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_irregularity_j(const float *data, const int N, const void *argv, float *result){
@@ -248,7 +249,7 @@
 
     *result = num / den;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_tristimulus_1(const float *data, const int N, const void *argv, float *result){
@@ -269,7 +270,7 @@
 
     *result = p1 / den;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_tristimulus_2(const float *data, const int N, const void *argv, float *result){
@@ -294,7 +295,7 @@
 
     *result = (p2 + p3 + p4)  / den;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_tristimulus_3(const float *data, const int N, const void *argv, float *result){
@@ -316,7 +317,7 @@
 
     *result = num / den;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_smoothness(const float *data, const int N, const void *argv, float *result){
@@ -339,7 +340,7 @@
 
     free(input);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_spread(const float *data, const int N, const void *argv, float *result){
@@ -350,13 +351,13 @@
 
     while(n--){
 	temp = n - *(float *)argv;
-	num += SQ(temp) * data[n];
+	num += XTRACT_SQ(temp) * data[n];
 	den += data[n];
     }
 
     *result = sqrt(num / den);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_zcr(const float *data, const int N, const void *argv, float *result){
@@ -368,7 +369,7 @@
 
     *result /= N;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_rolloff(const float *data, const int N, const void *argv, float *result){
@@ -389,17 +390,17 @@
     *result = n * ((float *)argv)[0];
     /* *result = (n / (float)N) * (((float *)argv)[1] * .5); */
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_loudness(const float *data, const int N, const void *argv, float *result){
 
     int n = N, rv;
 
-    if(n > BARK_BANDS) 
-	rv = BAD_VECTOR_SIZE; 
+    if(n > XTRACT_BARK_BANDS) 
+	rv = XTRACT_BAD_VECTOR_SIZE; 
     else
-	rv = SUCCESS;
+	rv = XTRACT_SUCCESS;
 
     while(n--)
 	*result += pow(data[n], 0.23);
@@ -426,15 +427,15 @@
     num = pow(num, 1.f / N);
     den /= N;
 
-    if(num < VERY_SMALL_NUMBER) 
-	num = VERY_SMALL_NUMBER;
+    if(num < XTRACT_VERY_SMALL_NUMBER) 
+	num = XTRACT_VERY_SMALL_NUMBER;
 
-    if(den < VERY_SMALL_NUMBER) 
-	den = VERY_SMALL_NUMBER;
+    if(den < XTRACT_VERY_SMALL_NUMBER) 
+	den = XTRACT_VERY_SMALL_NUMBER;
 
     *result = num / den;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 
 }
 
@@ -446,9 +447,9 @@
 
     sfmdb = (sfm > 0 ? ((10 * log10(sfm)) / -60) : 0);
 
-    *result = MIN(sfmdb, 1);
+    *result = XTRACT_MIN(sfmdb, 1);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_crest(const float *data, const int N, const void *argv, float *result){
@@ -462,7 +463,7 @@
 
     *result = max / mean;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 
 }
 
@@ -479,7 +480,7 @@
 
     *result = i / p;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 
 }
 
@@ -487,11 +488,11 @@
 
     int n = N;
 
-    while(n--) *result += SQ(data[n]);
+    while(n--) *result += XTRACT_SQ(data[n]);
 
     *result = sqrt(*result / N);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_spectral_inharmonicity(const float *data, const int N, const void *argv, float *result){
@@ -505,19 +506,19 @@
     freqs = data + n;
 
     while(n--){
-	num += abs(freqs[n] - n * fund) * SQ(amps[n]);
-	den += SQ(amps[n]);
+	num += abs(freqs[n] - n * fund) * XTRACT_SQ(amps[n]);
+	den += XTRACT_SQ(amps[n]);
     }
 
     *result = (2 * num) / (fund * den); 
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 
 int xtract_power(const float *data, const int N, const void *argv, float *result){
 
-    return FEATURE_NOT_IMPLEMENTED;
+    return XTRACT_FEATURE_NOT_IMPLEMENTED;
 
 }
 
@@ -542,7 +543,7 @@
 
     *result = num / den;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_sharpness(const float *data, const int N, const void *argv, float *result){
@@ -552,10 +553,10 @@
 
     sl = g = temp = 0.f;
 
-    if(n > BARK_BANDS) 
-	rv = BAD_VECTOR_SIZE; 
+    if(n > XTRACT_BARK_BANDS) 
+	rv = XTRACT_BAD_VECTOR_SIZE; 
     else
-	rv = SUCCESS;
+	rv = XTRACT_SUCCESS;
 
 
     while(n--){
@@ -574,10 +575,10 @@
 
     const float *freqs, *amps; 
     float f, a,
-	  F, A, FA, FSQ; /* sums of freqs, amps, freq * amps, freq squared */
+	  F, A, FA, FXTRACT_SQ; /* sums of freqs, amps, freq * amps, freq squared */
     int n, M; 
     
-    F = A = FA = FSQ = 0.f;
+    F = A = FA = FXTRACT_SQ = 0.f;
     n = M = N >> 1;
 
     amps = data;
@@ -589,12 +590,12 @@
 	F += f;
 	A += a;
 	FA += f * a;
-	FSQ += f * f;
+	FXTRACT_SQ += f * f;
     }
 
-    *result = (1.f / A) * (M * FA - F * A) / (M * FSQ - F * F); 
+    *result = (1.f / A) * (M * FA - F * A) / (M * FXTRACT_SQ - F * F); 
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 
 }
 
@@ -607,10 +608,10 @@
 
     while(n--){
        if((temp = data[n]) > *(float *)argv)	
-	    *result = MIN(*result, data[n]);
+	    *result = XTRACT_MIN(*result, data[n]);
     }
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_highest_value(const float *data, const int N, const void *argv, float *result){
@@ -620,9 +621,9 @@
     *result = data[--n];
 
     while(n--) 
-	*result = MAX(*result, data[n]);
+	*result = XTRACT_MAX(*result, data[n]);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 
@@ -633,7 +634,7 @@
     while(n--)
 	*result += *data++;
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 
 }
 
@@ -695,7 +696,7 @@
     free(coeffs3);
     free(product);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 
@@ -762,12 +763,12 @@
 	    f0 = sr / (tau + (err_tau_x / err_tau_1));
 	    *result = f0;
 	    free(input);
-	    return SUCCESS;
+	    return XTRACT_SUCCESS;
 	}
     }
     *result = -0;
     free(input);
-    return NO_RESULT;
+    return XTRACT_NO_RESULT;
 }
 
 int xtract_failsafe_f0(const float *data, const int N, const void *argv, float *result){
@@ -776,7 +777,7 @@
 
     return_code = xtract_f0(data, N, argv, result);
 
-    if(return_code == NO_RESULT){
+    if(return_code == XTRACT_NO_RESULT){
 
 	magnitudes = (float *)malloc(N * sizeof(float));
 	peaks = (float *)malloc(N * sizeof(float));
@@ -791,7 +792,7 @@
 	free(peaks);
     }
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 
 }
 
--- a/src/vector.c	Sun Jan 21 14:40:23 2007 +0000
+++ b/src/vector.c	Mon Jan 29 11:30:11 2007 +0000
@@ -22,6 +22,7 @@
 /* xtract_vector.c: defines functions that extract a feature as a single value from an input vector */
 
 #include "xtract/libxtract.h"
+#include "xtract_macros_private.h"
 #include <math.h>
 #include <string.h>
 #include <stdlib.h>
@@ -32,78 +33,78 @@
 
 int xtract_spectrum(const float *data, const int N, const void *argv, float *result){
 
-    float *input, *rfft, nyquist, temp;
+    float *input, *rfft, q, temp;
     size_t bytes;
     int n , NxN, M, vector;
     fftwf_plan plan;
 
     M = N >> 1;
-    NxN = SQ(N);
+    NxN = XTRACT_SQ(N);
 
     rfft = (float *)fftwf_malloc(N * sizeof(float));
     input = (float *)malloc(bytes = N * sizeof(float));
     input = memcpy(input, data, bytes);
 
-    nyquist = *(float *)argv;
+    q = *(float *)argv;
     vector = (int)*((float *)argv+1);
 
-    CHECK_nyquist;
+    XTRACT_CHECK_q;
 
     plan = fftwf_plan_r2r_1d(N, input, rfft, FFTW_R2HC, FFTW_ESTIMATE);
     
     fftwf_execute(plan);
 
     switch(vector){
-	case MAGNITUDE_SPECTRUM:
+	case XTRACT_MAGNITUDE_SPECTRUM:
 	    for(n = 0; n < M; n++){
-		result[n] = sqrt(SQ(rfft[n]) + SQ(rfft[N - n])) / N; 
-		result[M + n] = n * nyquist;
+		result[n] = sqrt(XTRACT_SQ(rfft[n]) + XTRACT_SQ(rfft[N - n])) / N; 
+		result[M + n] = n * q;
 	    }
 	    break;
-	case LOG_MAGNITUDE_SPECTRUM:
+	case XTRACT_LOG_MAGNITUDE_SPECTRUM:
 	    for(n = 0; n < M; n++){
-		if ((temp = SQ(rfft[n]) + SQ(rfft[N - n])) > LOG_LIMIT)
+		if ((temp = XTRACT_SQ(rfft[n]) + XTRACT_SQ(rfft[N - n])) > XTRACT_LOG_LIMIT)
 		    temp = log(sqrt(temp) / N);
 		else
-		    temp = LOG_LIMIT_DB;
+		    temp = XTRACT_LOG_LIMIT_DB;
 		/*Normalise*/
-		result[n] = (temp + DB_SCALE_OFFSET) / DB_SCALE_OFFSET; 
-		result[M + n] = n * nyquist;
+		result[n] = (temp + XTRACT_DB_SCALE_OFFSET) / XTRACT_DB_SCALE_OFFSET; 
+		result[M + n] = n * q;
 	    }
 	    break;
-	case POWER_SPECTRUM:
+	case XTRACT_POWER_SPECTRUM:
 	    for(n = 0; n < M; n++){
-		result[n] = (SQ(rfft[n]) + SQ(rfft[N - n])) / NxN;
-		result[M + n] = n * nyquist;
+		result[n] = (XTRACT_SQ(rfft[n]) + XTRACT_SQ(rfft[N - n])) / NxN;
+		result[M + n] = n * q;
 	    }
 	    break;
-	case LOG_POWER_SPECTRUM:
+	case XTRACT_LOG_POWER_SPECTRUM:
 	    for(n = 0; n < M; n++){
-		if ((temp = SQ(rfft[n]) + SQ(rfft[N - n])) > LOG_LIMIT)
+		if ((temp = XTRACT_SQ(rfft[n]) + XTRACT_SQ(rfft[N - n])) > XTRACT_LOG_LIMIT)
 		    temp = log(temp / NxN);
 		else
-		    temp = LOG_LIMIT_DB; 		
-		result[n] = (temp + DB_SCALE_OFFSET) / DB_SCALE_OFFSET; 
-		result[M + n] = n * nyquist;
+		    temp = XTRACT_LOG_LIMIT_DB; 		
+		result[n] = (temp + XTRACT_DB_SCALE_OFFSET) / XTRACT_DB_SCALE_OFFSET; 
+		result[M + n] = n * q;
 	    }
 	    break;
 	default:
 	    /* MAGNITUDE_SPECTRUM */
 	    for(n = 0; n < M; n++){
-		result[n] = sqrt(SQ(rfft[n]) + SQ(rfft[N - n])) / N; 
-		result[M + n] = n * nyquist;
+		result[n] = sqrt(XTRACT_SQ(rfft[n]) + XTRACT_SQ(rfft[N - n])) / N; 
+		result[M + n] = n * q;
 	    }
 	    break;
     }
     
     /* result[0] = fabs(temp[0]) / N  */
-    result[M] = nyquist * .5;
+    result[N] = q * M;
     
     fftwf_destroy_plan(plan);
     fftwf_free(rfft);
     free(input);
     
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_autocorrelation_fft(const float *data, const int N, const void *argv, float *result){
@@ -128,7 +129,7 @@
     fftwf_free(temp);
     free(input);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_mfcc(const float *data, const int N, const void *argv, float *result){
@@ -147,7 +148,7 @@
         for(n = 0; n < N; n++){
             result[filter] += input[n] * f->filters[filter][n];
         }
-        if(result[filter] < LOG_LIMIT) result[filter] = LOG_LIMIT;
+        if(result[filter] < XTRACT_LOG_LIMIT) result[filter] = XTRACT_LOG_LIMIT;
         result[filter] = log(result[filter]);
     }
 
@@ -157,7 +158,7 @@
 
     free(input);
     
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_dct(const float *data, const int N, const void *argv, float *result){
@@ -176,7 +177,7 @@
     fftwf_destroy_plan(plan);
     free(input);
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 #else
@@ -223,7 +224,7 @@
         result[n] = corr / N;
     }
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_amdf(const float *data, const int N, const void *argv, float *result){
@@ -242,7 +243,7 @@
         result[n] = md / N;
     }
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_asdf(const float *data, const int N, const void *argv, float *result){
@@ -255,12 +256,12 @@
        sd = 0;
         for(i = 0; i < N - n; i++){
             /*sd = 1;*/
-            sd += SQ(data[i] - data[i + n]);
+            sd += XTRACT_SQ(data[i] - data[i + n]);
         }
         result[n] = sd / N;
     }
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_bark_coefficients(const float *data, const int N, const void *argv, float *result){
@@ -269,47 +270,47 @@
 
     limits = (int *)argv;
     
-    for(band = 0; band < BARK_BANDS; band++){
+    for(band = 0; band < XTRACT_BARK_BANDS; band++){
         for(n = limits[band]; n < limits[band + 1]; n++)
             result[band] += data[n];
     }
 
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 
 int xtract_peak_spectrum(const float *data, const int N, const void *argv, float *result){
 
-    float threshold, max, y, y2, y3, p, nyquist, *input = NULL;
+    float threshold, max, y, y2, y3, p, q, *input = NULL;
     size_t bytes;
-    int n = N, M, rv = SUCCESS;
+    int n = N, M, rv = XTRACT_SUCCESS;
 
-    threshold = max = y = y2 = y3 = p = nyquist = 0.f;
+    threshold = max = y = y2 = y3 = p = q = 0.f;
     
     if(argv != NULL){
-        nyquist = ((float *)argv)[0];
+        q = ((float *)argv)[0];
         threshold = ((float *)argv)[1];
     }
     else
-        rv = BAD_ARGV;
+        rv = XTRACT_BAD_ARGV;
 
     if(threshold < 0 || threshold > 100){
         threshold = 0;
-        rv = BAD_ARGV;
+        rv = XTRACT_BAD_ARGV;
     }
 
-    CHECK_nyquist;
+    XTRACT_CHECK_q;
 
     input = (float *)malloc(bytes = N * sizeof(float));
 
     if(input != NULL)
 	input = memcpy(input, data, bytes);
     else
-	return MALLOC_FAILED;
+	return XTRACT_MALLOC_FAILED;
 
     M = N >> 1;
 
     while(n--)
-        max = MAX(max, input[n]);
+        max = XTRACT_MAX(max, input[n]);
     
     threshold *= .01 * max;
 
@@ -319,7 +320,7 @@
     for(n = 1; n < M; n++){
         if(input[n] >= threshold){
             if(input[n] > input[n - 1] && input[n] > input[n + 1]){
-                result[M + n] = nyquist * (n + (p = .5 * (y = input[n-1] - 
+                result[M + n] = q * (n + (p = .5 * (y = input[n-1] - 
 				(y3 = input[n+1])) / (input[n - 1] - 2 * 
 				    (y2 = input[n]) + input[n + 1])));
                 result[n] = y2 - .25 * (y - y3) * p;
@@ -336,7 +337,7 @@
     }	  
    
     free(input);
-    return (rv ? rv : SUCCESS);
+    return (rv ? rv : XTRACT_SUCCESS);
 }
 	    
 int xtract_harmonic_spectrum(const float *data, const int N, const void *argv, float *result){
@@ -368,6 +369,6 @@
 	else
 	    result[n] = result[M + n] = 0.f;
     }
-    return SUCCESS;
+    return XTRACT_SUCCESS;
 }
 	    
--- a/xtract/libxtract.h	Sun Jan 21 14:40:23 2007 +0000
+++ b/xtract/libxtract.h	Mon Jan 29 11:30:11 2007 +0000
@@ -56,178 +56,178 @@
 #define XTRACT_FEATURES 53
     
 /** \brief Enumeration of features, elements are used as indixes to an array of pointers to feature extracton functions */
-enum features_ {
-    MEAN,
-    VARIANCE,
-    STANDARD_DEVIATION,
-    AVERAGE_DEVIATION,
-    SKEWNESS,
-    KURTOSIS,
-    SPECTRAL_MEAN,
-    SPECTRAL_VARIANCE,
-    SPECTRAL_STANDARD_DEVIATION,
-    SPECTRAL_AVERAGE_DEVIATION,
-    SPECTRAL_SKEWNESS,
-    SPECTRAL_KURTOSIS,
-    SPECTRAL_CENTROID,
-    IRREGULARITY_K,
-    IRREGULARITY_J,
-    TRISTIMULUS_1,
-    TRISTIMULUS_2,
-    TRISTIMULUS_3,
-    SMOOTHNESS,
-    SPREAD,
-    ZCR,
-    ROLLOFF,
-    LOUDNESS,
-    FLATNESS,
-    TONALITY,
-    CREST,
-    NOISINESS,
-    RMS_AMPLITUDE,
-    SPECTRAL_INHARMONICITY,
-    POWER,
-    ODD_EVEN_RATIO,
-    SHARPNESS,
-    SPECTRAL_SLOPE,
-    LOWEST_VALUE,
-    HIGHEST_VALUE,
-    SUM,
-    HPS,
-    F0,
-    FAILSAFE_F0,
-    FLUX,
-    ATTACK_TIME,
-    DECAY_TIME,
-    DELTA_FEATURE,
-    AUTOCORRELATION,
-    AMDF,
-    ASDF,
-    BARK_COEFFICIENTS,
-    PEAK_SPECTRUM,
-    SPECTRUM,
-    AUTOCORRELATION_FFT,
-    MFCC,
-    DCT,
-    HARMONIC_SPECTRUM
+enum xtract_features_ {
+    XTRACT_MEAN,
+    XTRACT_VARIANCE,
+    XTRACT_STANDARD_DEVIATION,
+    XTRACT_AVERAGE_DEVIATION,
+    XTRACT_SKEWNESS,
+    XTRACT_KURTOSIS,
+    XTRACT_SPECTRAL_MEAN,
+    XTRACT_SPECTRAL_VARIANCE,
+    XTRACT_SPECTRAL_STANDARD_DEVIATION,
+    XTRACT_SPECTRAL_AVERAGE_DEVIATION,
+    XTRACT_SPECTRAL_SKEWNESS,
+    XTRACT_SPECTRAL_KURTOSIS,
+    XTRACT_SPECTRAL_CENTROID,
+    XTRACT_IRREGULARITY_K,
+    XTRACT_IRREGULARITY_J,
+    XTRACT_TRISTIMULUS_1,
+    XTRACT_TRISTIMULUS_2,
+    XTRACT_TRISTIMULUS_3,
+    XTRACT_SMOOTHNESS,
+    XTRACT_SPREAD,
+    XTRACT_ZCR,
+    XTRACT_ROLLOFF,
+    XTRACT_LOUDNESS,
+    XTRACT_FLATNESS,
+    XTRACT_TONALITY,
+    XTRACT_CREST,
+    XTRACT_NOISINESS,
+    XTRACT_RMS_AMPLITUDE,
+    XTRACT_SPECTRAL_INHARMONICITY,
+    XTRACT_POWER,
+    XTRACT_ODD_EVEN_RATIO,
+    XTRACT_SHARPNESS,
+    XTRACT_SPECTRAL_SLOPE,
+    XTRACT_LOWEST_VALUE,
+    XTRACT_HIGHEST_VALUE,
+    XTRACT_SUM,
+    XTRACT_HPS,
+    XTRACT_F0,
+    XTRACT_FAILSAFE_F0,
+    XTRACT_FLUX,
+    XTRACT_ATTACK_TIME,
+    XTRACT_DECAY_TIME,
+    XTRACT_DELTA_FEATURE,
+    XTRACT_AUTOCORRELATION,
+    XTRACT_AMDF,
+    XTRACT_ASDF,
+    XTRACT_BARK_COEFFICIENTS,
+    XTRACT_PEAK_SPECTRUM,
+    XTRACT_SPECTRUM,
+    XTRACT_AUTOCORRELATION_FFT,
+    XTRACT_MFCC,
+    XTRACT_DCT,
+    XTRACT_HARMONIC_SPECTRUM
 };
 
 /** \brief Enumeration of feature initialisation functions */
-enum feature_init_ {
-    INIT_MFCC = 100,
-    INIT_BARK
+enum xtract_feature_init_ {
+    XTRACT_INIT_MFCC = 100,
+    XTRACT_INIT_BARK
 };
 
 /** \brief Enumeration of feature types */
-enum feature_types_ {
-    SCALAR,
-    VECTOR,
-    DELTA
+enum xtract_feature_types_ {
+    XTRACT_SCALAR,
+    XTRACT_VECTOR,
+    XTRACT_DELTA
 };
 
 /** \brief Enumeration of mfcc types */
-enum mfcc_types_ {
-    EQUAL_GAIN,
-    EQUAL_AREA
+enum xtract_mfcc_types_ {
+    XTRACT_EQUAL_GAIN,
+    XTRACT_EQUAL_AREA
 };
 
 /** \brief Enumeration of return codes */
-enum return_codes_ {
-    SUCCESS,
-    MALLOC_FAILED,
-    BAD_ARGV,
-    BAD_VECTOR_SIZE,
-    NO_RESULT,
-    FEATURE_NOT_IMPLEMENTED
+enum xtract_return_codes_ {
+    XTRACT_SUCCESS,
+    XTRACT_MALLOC_FAILED,
+    XTRACT_BAD_ARGV,
+    XTRACT_BAD_VECTOR_SIZE,
+    XTRACT_NO_RESULT,
+    XTRACT_FEATURE_NOT_IMPLEMENTED
 };
 
 /** \brief Enumeration of spectrum types */
-enum spectrum_ {
-    MAGNITUDE_SPECTRUM,
-    LOG_MAGNITUDE_SPECTRUM,
-    POWER_SPECTRUM,
-    LOG_POWER_SPECTRUM
+enum xtract_spectrum_ {
+    XTRACT_MAGNITUDE_SPECTRUM,
+    XTRACT_LOG_MAGNITUDE_SPECTRUM,
+    XTRACT_POWER_SPECTRUM,
+    XTRACT_LOG_POWER_SPECTRUM
 };
 
 /** \brief Enumeration of data types*/
 typedef enum type_ {
-    FLOAT,
-    FLOATARRAY,
-    INT,
-    MEL_FILTER
-} t_type;
+    XTRACT_FLOAT,
+    XTRACT_FLOATARRAY,
+    XTRACT_INT,
+    XTRACT_MEL_FILTER
+} xtract_type_t;
 
 /** \brief Enumeration of units*/
 typedef enum unit_ {
     /* NONE, ANY */
-    HERTZ = 2,
-    ANY_AMPLITUDE_HERTZ,
-    DBFS,
-    DBFS_HERTZ,
-    PERCENT,
-    SONE
-} t_unit;
+    XTRACT_HERTZ = 2,
+    XTRACT_ANY_AMPLITUDE_HERTZ,
+    XTRACT_DBFS,
+    XTRACT_DBFS_HERTZ,
+    XTRACT_PERCENT,
+    XTRACT_SONE
+} xtract_unit_t;
 
 /** \brief Boolean */
 typedef enum {
-    FALSE,
-    TRUE
-} t_bool;
+    XTRACT_FALSE,
+    XTRACT_TRUE
+} xtract_bool_t;
 
 /** \brief Enumeration of vector format types*/
-typedef enum vector_ {
+typedef enum xtract_vector_ {
     /* N/2 magnitude/log-magnitude/power/log-power coeffs and N/2 frequencies */
-    SPECTRAL,     
+    XTRACT_SPECTRAL,     
     /* N spectral amplitudes */
-    SPECTRAL_MAGNITUDES, 
+    XTRACT_SPECTRAL_MAGNITUDES, 
     /* N/2 magnitude/log-magnitude/power/log-power peak coeffs and N/2 
      * frequencies */
-    SPECTRAL_PEAKS,
+    XTRACT_SPECTRAL_PEAKS,
     /* N spectral peak amplitudes */
-    SPECTRAL_PEAK_MAGNITUDES,
+    XTRACT_SPECTRAL_PEAK_MAGNITUDES,
     /* N/2 magnitude/log-magnitude/power/log-power harmonic peak coeffs and N/2 
      * frequencies */
-    SPECTRAL_HARMONICS,
+    XTRACT_SPECTRAL_HARMONICS,
     /* N spectral harmonic amplitudes */
-    SPECTRAL_HARMONICS_MAGNITUDES,
+    XTRACT_SPECTRAL_HARMONICS_MAGNITUDES,
     /* N spectral harmonic frequencies */
-    SPECTRAL_HARMONICS_FREQUENCIES,
-    ARBITRARY_SERIES,
-    AUDIO_SAMPLES,
-    MEL_COEFFS, 
-    BARK_COEFFS,
-    NO_DATA
-} t_vector;
+    XTRACT_SPECTRAL_HARMONICS_FREQUENCIES,
+    XTRACT_ARBITRARY_SERIES,
+    XTRACT_AUDIO_SAMPLES,
+    XTRACT_MEL_COEFFS, 
+    XTRACT_BARK_COEFFS,
+    XTRACT_NO_DATA
+} xtract_vector_t;
 
 /** \brief Data structure containing useful information about functions provided by LibXtract. */
-typedef struct _function_descriptor {
+typedef struct _xtract_function_descriptor {
 
     struct {
-	char name[MAX_NAME_LENGTH];
-	char p_name[MAX_NAME_LENGTH]; /* pretty name */
-	char desc[MAX_DESC_LENGTH];
-	char p_desc[MAX_DESC_LENGTH]; /* pretty description */
-	char author[MAX_AUTHOR_LENGTH];
+	char name[XTRACT_MAX_NAME_LENGTH];
+	char p_name[XTRACT_MAX_NAME_LENGTH]; /* pretty name */
+	char desc[XTRACT_MAX_DESC_LENGTH];
+	char p_desc[XTRACT_MAX_DESC_LENGTH]; /* pretty description */
+	char author[XTRACT_MAX_AUTHOR_LENGTH];
 	int year;
     } algo;
 
     struct {
-	t_vector format;
-	t_unit unit;
+	xtract_vector_t format;
+	xtract_unit_t unit;
     } data;
 
     int argc;
 
     struct {
-	t_type type; /* type of the array/value pointed to by argv */
-	float min[MAXARGS];
-	float max[MAXARGS];
-	float def[MAXARGS]; /* defaults */
-	t_unit unit[MAXARGS];
-	char donor[MAXARGS]; /* suggested donor functions for argv */
+	xtract_type_t type; /* type of the array/value pointed to by argv */
+	float min[XTRACT_MAXARGS];
+	float max[XTRACT_MAXARGS];
+	float def[XTRACT_MAXARGS]; /* defaults */
+	xtract_unit_t unit[XTRACT_MAXARGS];
+	int donor[XTRACT_MAXARGS]; /* suggested donor functions for argv */
     } argv;
 
-    t_bool is_scalar;
+    xtract_bool_t is_scalar;
 
     /* The result.<> entries in descritors.c need to be checked */
     union {
@@ -235,17 +235,17 @@
 	struct {
 	    float min;
 	    float max;	   
-	    t_unit unit;
+	    xtract_unit_t unit;
 	} scalar;
 
 	struct {
-	    t_vector format;
-	    t_unit unit;
+	    xtract_vector_t format;
+	    xtract_unit_t unit;
 	} vector;
 
     } result;
 
-} t_function_descriptor;
+} xtract_function_descriptor_t;
 
 /**
  *                                                                          
@@ -293,15 +293,9 @@
  * The calling function may additionally make some tests against the value returned by xtract
  * 
  */
-#ifdef XTRACT
+#ifdef XTRACT_H
 extern int(*xtract[XTRACT_FEATURES])(const float *data, const int N, const void *argv, float *result);
 
-/** \brief An array of pointers to function descriptors
- *
- * Defined in libxtract.c. This is an array of pointers to function descriptors designed to be queried for useful information such as the expected input and output units of a function, or the number of arguments it takes.
- */
-//extern t_function_descriptor *xtract_help[XTRACT_FEATURES];
-
 #endif
 
 /** \brief A structure to store a set of n_filters Mel filters */
@@ -314,7 +308,7 @@
  * 
  * It is up to the caller to pass in a pointer to memory allocated for freq_bands arrays of length N. This function populates these arrays with magnitude coefficients representing the mel filterbank on a linear scale 
  */
-int xtract_init_mfcc(int N, float nyquist, int style, float freq_max, float freq_min, int freq_bands, float **fft_tables);
+int xtract_init_mfcc(int N, float nyquist, int style, float freq_min, float freq_max, int freq_bands, float **fft_tables);
 
 /** \brief A function to initialise bark filter bounds
  * 
--- a/xtract/xtract_delta.h	Sun Jan 21 14:40:23 2007 +0000
+++ b/xtract/xtract_delta.h	Mon Jan 29 11:30:11 2007 +0000
@@ -20,8 +20,8 @@
 
 /** \file xtract_delta.h: declares functions that extract a feature as a single value or vector from more than one input vector */
 
-#ifndef XTRACT_DELTA
-#define XTRACT_DELTA
+#ifndef XTRACT_DELTA_H
+#define XTRACT_DELTA_H
 
 #ifdef __cplusplus
 extern "C" {
--- a/xtract/xtract_macros.h	Sun Jan 21 14:40:23 2007 +0000
+++ b/xtract/xtract_macros.h	Mon Jan 29 11:30:11 2007 +0000
@@ -20,48 +20,23 @@
 
 
 
-/** \file xtract_delta.h: defines useful macros */
+/** \file xtract_macros.h: defines useful public macros */
 
-#ifndef XTRACT_MACROS
-#define XTRACT_MACROS
+#ifndef XTRACT_MACROS_H
+#define XTRACT_MACROS_H
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <stdio.h>
-
-#define SQ(a) ((a) * (a))
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#define NEEDS_FFTW printf("LibXtract must be compiled with fftw support to use this function.\n")
-
-#define VERY_SMALL_NUMBER 2e-42
-#define LOG_LIMIT VERY_SMALL_NUMBER
-#define LOG_LIMIT_DB -96
-#define DB_SCALE_OFFSET 96
-#define VERY_BIG_NUMBER 2e42
-#define SR_UPPER_LIMIT 192000
-#define SR_LOWER_LIMIT 22050
-#define SR_DEFAULT 44100
-#define FUNDAMENTAL_DEFAULT 440
-#define CHECK_nyquist if(!nyquist) nyquist = SR_DEFAULT / N
-#define SR_LIMIT SR_UPPER_LIMIT
-#define FFT_BANDS_MIN 16
-#define FFT_BANDS_MAX 65536
-#define FFT_BANDS_DEF 1024
-#define SPEC_BW_MIN 0.168 /* Minimum spectral bandwidth (= SR_LOWER_LIMIT / \
-		      FFT_BANDS_MAX*/ 
-#define SPEC_BW_MAX 12000 /* SR_UPPER_LIMIT / FFT_BANDS_MIN */
-#define SPEC_BW_DEF 43.066 /* SR_DEFAULT / FFT_BANDS_DEF */
-#define BARK_BANDS 26
-#define NONE 0
-#define ANY -1
-#define UNKNOWN -2
-#define MAXARGS 4
-#define MAX_NAME_LENGTH 64
-#define MAX_AUTHOR_LENGTH 128
-#define MAX_DESC_LENGTH 256
+#define XTRACT_BARK_BANDS 26
+#define XTRACT_NONE 0
+#define XTRACT_ANY -1
+#define XTRACT_UNKNOWN -2
+#define XTRACT_MAXARGS 4
+#define XTRACT_MAX_NAME_LENGTH 64
+#define XTRACT_MAX_AUTHOR_LENGTH 128
+#define XTRACT_MAX_DESC_LENGTH 256
 
 #ifdef __cplusplus
 }
--- a/xtract/xtract_scalar.h	Sun Jan 21 14:40:23 2007 +0000
+++ b/xtract/xtract_scalar.h	Mon Jan 29 11:30:11 2007 +0000
@@ -20,8 +20,8 @@
 
 /** \file xtract_scalar.h: declares functions that extract a feature as a single value from an input vector */
 
-#ifndef XTRACT_SCALAR
-#define XTRACT_SCALAR
+#ifndef XTRACT_SCALAR_H
+#define XTRACT_SCALAR_H
 
 #ifdef __cplusplus
 extern "C" {
--- a/xtract/xtract_types.h	Sun Jan 21 14:40:23 2007 +0000
+++ b/xtract/xtract_types.h	Mon Jan 29 11:30:11 2007 +0000
@@ -20,8 +20,8 @@
 
 /* \file xtract_types.h: declares specialised variable types used by libxtract */
 
-#ifndef XTRACT_TYPES
-#define XTRACT_TYPES
+#ifndef XTRACT_TYPES_H
+#define XTRACT_TYPES_H
 
 #ifdef __cplusplus
 extern "C" {
--- a/xtract/xtract_vector.h	Sun Jan 21 14:40:23 2007 +0000
+++ b/xtract/xtract_vector.h	Mon Jan 29 11:30:11 2007 +0000
@@ -20,8 +20,8 @@
 
 /* xtract_scalar.h: declares functions that extract a feature as a vector from an input vector */
 
-#ifndef XTRACT_VECTOR
-#define XTRACT_VECTOR
+#ifndef XTRACT_VECTOR_H
+#define XTRACT_VECTOR_H
 
 #ifdef __cplusplus
 extern "C" {