From 3c12f4ea6c71f2775b73aa83edce01563b788fa6 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 26 Dec 2014 23:20:33 -0800
Subject: Fix include of base_class files


diff --git a/src/modules/MultiSyn/inst_tmpl/hash_itemp_tcdatap_t.cc b/src/modules/MultiSyn/inst_tmpl/hash_itemp_tcdatap_t.cc
index 1c4d1e5..54d3b77 100644
--- a/src/modules/MultiSyn/inst_tmpl/hash_itemp_tcdatap_t.cc
+++ b/src/modules/MultiSyn/inst_tmpl/hash_itemp_tcdatap_t.cc
@@ -50,7 +50,7 @@ template <> TCData* EST_THash< EST_Item*, TCData* >::Dummy_Value=0;
 
 #if defined(INSTANTIATE_TEMPLATES)
 
-#include "../base_class/EST_THash.cc"
+#include "base_class/EST_THash.cc"
 
 Instantiate_THash_T(EST_Item*, TCData*, TCDataP)
 
diff --git a/src/modules/MultiSyn/inst_tmpl/hash_s_itemlistp_t.cc b/src/modules/MultiSyn/inst_tmpl/hash_s_itemlistp_t.cc
index b2a443a..036806e 100644
--- a/src/modules/MultiSyn/inst_tmpl/hash_s_itemlistp_t.cc
+++ b/src/modules/MultiSyn/inst_tmpl/hash_s_itemlistp_t.cc
@@ -51,7 +51,7 @@ template <> ItemList* EST_THash< EST_String, ItemList* >::Dummy_Value=0;
 
 #if defined(INSTANTIATE_TEMPLATES)
 
-#include "../base_class/EST_THash.cc"
+#include "base_class/EST_THash.cc"
 
 Instantiate_TStringHash_T(ItemList *, ItemListP)
 
diff --git a/src/modules/MultiSyn/inst_tmpl/list_itemp_t.cc b/src/modules/MultiSyn/inst_tmpl/list_itemp_t.cc
index 45f6f18..78c513d 100644
--- a/src/modules/MultiSyn/inst_tmpl/list_itemp_t.cc
+++ b/src/modules/MultiSyn/inst_tmpl/list_itemp_t.cc
@@ -51,8 +51,8 @@ Declare_TList_T(EST_Item *, EST_ItemP)
 
 #if defined(INSTANTIATE_TEMPLATES)
 
-#include "../base_class/EST_TList.cc"
-#include "../base_class/EST_TSortable.cc"
+#include "base_class/EST_TList.cc"
+#include "base_class/EST_TSortable.cc"
 
 Instantiate_TList_T(EST_Item *, EST_ItemP)
 
diff --git a/src/modules/MultiSyn/inst_tmpl/list_scorepair_t.cc b/src/modules/MultiSyn/inst_tmpl/list_scorepair_t.cc
index b03fe22..1207bd4 100644
--- a/src/modules/MultiSyn/inst_tmpl/list_scorepair_t.cc
+++ b/src/modules/MultiSyn/inst_tmpl/list_scorepair_t.cc
@@ -45,8 +45,8 @@ Declare_TList(ScorePair)
 Declare_TSortable(ScorePair)
 
 #if defined(INSTANTIATE_TEMPLATES)
-#include "../base_class/EST_TList.cc"
-#include "../base_class/EST_TSortable.cc"
+#include "base_class/EST_TList.cc"
+#include "base_class/EST_TSortable.cc"
 Instantiate_TList(ScorePair);
 Instantiate_TSortable(ScorePair);
 #endif
diff --git a/src/modules/MultiSyn/inst_tmpl/list_strlist_t.cc b/src/modules/MultiSyn/inst_tmpl/list_strlist_t.cc
index 5ccf452..0760b64 100644
--- a/src/modules/MultiSyn/inst_tmpl/list_strlist_t.cc
+++ b/src/modules/MultiSyn/inst_tmpl/list_strlist_t.cc
@@ -46,6 +46,6 @@
 Declare_TList_T(EST_TList<EST_String>,STR_LIST)
 
 #if defined(INSTANTIATE_TEMPLATES)
-#include "../base_class/EST_TList.cc"
+#include "base_class/EST_TList.cc"
   Instantiate_TList_T(EST_StrList,STR_LIST);
 #endif
diff --git a/src/modules/MultiSyn/inst_tmpl/list_uttp_t.cc b/src/modules/MultiSyn/inst_tmpl/list_uttp_t.cc
index f0fbb8a..d1c0409 100644
--- a/src/modules/MultiSyn/inst_tmpl/list_uttp_t.cc
+++ b/src/modules/MultiSyn/inst_tmpl/list_uttp_t.cc
@@ -51,8 +51,8 @@ Declare_TList_T(EST_Utterance *, EST_UtteranceP)
 
 #if defined(INSTANTIATE_TEMPLATES)
 
-#include "../base_class/EST_TList.cc"
-#include "../base_class/EST_TSortable.cc"
+#include "base_class/EST_TList.cc"
+#include "base_class/EST_TSortable.cc"
 
 Instantiate_TList_T_MIN(EST_Utterance *, EST_UtteranceP)
 
diff --git a/src/modules/MultiSyn/inst_tmpl/list_voicemodulep_t.cc b/src/modules/MultiSyn/inst_tmpl/list_voicemodulep_t.cc
index 6258004..4eca26b 100644
--- a/src/modules/MultiSyn/inst_tmpl/list_voicemodulep_t.cc
+++ b/src/modules/MultiSyn/inst_tmpl/list_voicemodulep_t.cc
@@ -50,8 +50,8 @@ Declare_TList_T(DiphoneVoiceModule *, DiphoneVoiceModuleP)
 
 #if defined(INSTANTIATE_TEMPLATES)
 
-#include "../base_class/EST_TList.cc"
-#include "../base_class/EST_TSortable.cc"
+#include "base_class/EST_TList.cc"
+#include "base_class/EST_TSortable.cc"
 
 Instantiate_TList_T_MIN(DiphoneVoiceModule *, DiphoneVoiceModuleP)
 
diff --git a/src/modules/MultiSyn/inst_tmpl/vector_jccp_t.cc b/src/modules/MultiSyn/inst_tmpl/vector_jccp_t.cc
index b243b5b..0915ebc 100644
--- a/src/modules/MultiSyn/inst_tmpl/vector_jccp_t.cc
+++ b/src/modules/MultiSyn/inst_tmpl/vector_jccp_t.cc
@@ -50,8 +50,8 @@ Declare_TSimpleVector_T(EST_JoinCostCache*,EST_JoinCostCacheP)
 
 #if defined(INSTANTIATE_TEMPLATES)
 
-#include "../base_class/EST_TSimpleVector.cc"
-#include "../base_class/EST_TVector.cc"
+#include "base_class/EST_TSimpleVector.cc"
+#include "base_class/EST_TVector.cc"
 
 Instantiate_TVector_T_MIN(EST_JoinCostCache*,EST_JoinCostCacheP)
 Instantiate_TSimpleVector(EST_JoinCostCache*)
-- 
1.8.3.4


From 2edebb55a8e24107e7cdbac69ed8b1212ea6f4be Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 26 Dec 2014 23:22:17 -0800
Subject: Adjust server access list for 127.0.0.1

Taken from Debian: 03-security-access_list.diff

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

diff --git a/lib/festival.scm b/lib/festival.scm
index 77b2292..928016d 100644
--- a/lib/festival.scm
+++ b/lib/festival.scm
@@ -433,7 +433,7 @@ a newline before they can get a connection.  It would be normal
 to set this for the particular server task.
 [see Server/client API]")
 
-(defvar server_access_list '(localhost)
+(defvar server_access_list '("127.0.0.1" "localhost\.localdomain" "localhost")
   "server_access_list
 If non-nil this is the exhaustive list of machines and domains
 from which clients may access the server.  This is a list of REGEXs
-- 
1.8.3.4


From f91d1bbb19479c4f9c4488f245072a4840cbb72a Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 26 Dec 2014 23:24:06 -0800
Subject: Add ALAW support

Backported from Debian: 04-codec-add-alaw.diff

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

diff --git a/examples/text2wave.sh b/examples/text2wave.sh
index 7f91200..ed0b1da 100755
--- a/examples/text2wave.sh
+++ b/examples/text2wave.sh
@@ -50,7 +50,7 @@
   Options
   -mode <string>  Explicit tts mode.
   -o ofile        File to save waveform (default is stdout).
-  -otype <string> Output waveform type: ulaw, snd, aiff, riff, nist etc.
+  -otype <string> Output waveform type: alaw, ulaw, snd, aiff, riff, nist etc.
                   (default is riff)
   -F <int>        Output frequency.
   -scale <float>  Volume factor
diff --git a/src/modules/diphone/di_io.cc b/src/modules/diphone/di_io.cc
index 8b53ccd..5559a1f 100644
--- a/src/modules/diphone/di_io.cc
+++ b/src/modules/diphone/di_io.cc
@@ -415,6 +415,16 @@ static void load_signal_file(DIPHONE_DATABASE *db, int i, int mode)
 		ulaw_to_short(ulaw,db->vox[i]->signal,db->vox[i]->nsamples);
 		wfree(ulaw);
 	    }
+	    else if (db->group_encoding == di_alaw)
+	    {
+		unsigned char *alaw = 
+		    walloc(unsigned char,db->vox[i]->nsamples);
+		db->vox[i]->signal = walloc(short,db->vox[i]->nsamples);
+		fseek(db->gfd,db->gsignalbase+(db->offsets[i]),SEEK_SET);
+		fread(alaw,sizeof(unsigned char),db->vox[i]->nsamples,db->gfd);
+		alaw_to_short(alaw,db->vox[i]->signal,db->vox[i]->nsamples);
+		wfree(alaw);
+	    }
 	    else
 	    {
 		cerr << "Diphone: unknown group type" << endl;
@@ -800,8 +810,13 @@ static void di_group_load_signal(DIPHONE_DATABASE *db)
 	}
 	else if (db->group_encoding == di_ulaw)
 	{
-	    db->allulawsignal = walloc(unsigned char,totsamples);
-	    fread(db->allulawsignal,sizeof(unsigned char),totsamples,db->gfd);
+	    db->allualawsignal = walloc(unsigned char,totsamples);
+	    fread(db->allualawsignal,sizeof(unsigned char),totsamples,db->gfd);
+	}
+	else if (db->group_encoding == di_alaw)
+	{
+	    db->allualawsignal = walloc(unsigned char,totsamples);
+	    fread(db->allualawsignal,sizeof(unsigned char),totsamples,db->gfd);
 	}
     }
     else
@@ -821,7 +836,13 @@ static void di_group_load_signal(DIPHONE_DATABASE *db)
 	    else if (db->group_encoding == di_ulaw)
 	    {
 		db->vox[i]->signal = walloc(short,samp_counts[i]);
-		ulaw_to_short(&db->allulawsignal[sample_offset],
+		ulaw_to_short(&db->allualawsignal[sample_offset],
+			      db->vox[i]->signal,samp_counts[i]);
+	    }
+	    else if (db->group_encoding == di_alaw)
+	    {
+		db->vox[i]->signal = walloc(short,samp_counts[i]);
+		alaw_to_short(&db->allualawsignal[sample_offset],
 			      db->vox[i]->signal,samp_counts[i]);
 	    }
 	    else
@@ -838,7 +859,7 @@ static void di_group_load_signal(DIPHONE_DATABASE *db)
 	sample_offset += samp_counts[i];
     }
     if (db->sig_access_type != di_direct)
-	if (db->group_encoding == di_ulaw)
+	if (db->group_encoding == di_ulaw || db->group_encoding == di_alaw)
 	    fseek(db->gfd,(long)sample_offset,SEEK_CUR);
 	else
 	    fseek(db->gfd,(long)sample_offset*sizeof(short),SEEK_CUR);
@@ -867,7 +888,7 @@ static void di_group_load_lpc_params(DIPHONE_DATABASE *db)
 	if (db->swap) 
 	    swap_bytes_float(db->allframes,totframes*db->lpc_order);
     }
-    else if (db->group_encoding == di_ulaw) // its as shorts
+    else if (db->group_encoding == di_ulaw || db->group_encoding == di_alaw) // its as shorts
     {
 	db->allframesshort = walloc(short,totframes*db->lpc_order);
 	fread(db->allframesshort,sizeof(short),
@@ -885,7 +906,7 @@ static void di_group_load_lpc_params(DIPHONE_DATABASE *db)
 	    for (j=0;j<db->lpc[i]->nframes;j++)
 		db->lpc[i]->f[j] = 
 		    &db->allframes[(frame_offset+j)*db->lpc_order];
-	else if (db->group_encoding == di_ulaw)
+	else if (db->group_encoding == di_ulaw || db->group_encoding == di_alaw)
 	{
 	    int fixedpoint = FALSE;
 	    if (siod_get_lval("lpc_fixedpoint",NULL) != NIL)
@@ -1031,6 +1052,13 @@ void di_save_grouped_db(const EST_Pathname &filename, DIPHONE_DATABASE *db)
 	    fwrite(ulaw,sizeof(unsigned char),db->vox[i]->nsamples,fd);
 	    wfree(ulaw);
 	}
+	else if (db->group_encoding == di_alaw)
+	{
+	    unsigned char *alaw = walloc(unsigned char,db->vox[i]->nsamples);
+	    short_to_alaw(db->vox[i]->signal,alaw,db->vox[i]->nsamples);
+	    fwrite(alaw,sizeof(unsigned char),db->vox[i]->nsamples,fd);
+	    wfree(alaw);
+	}
 	else
 	{
 	    cerr << "Diphone: unknown group type for dumping" << endl;
@@ -1058,7 +1086,7 @@ void di_save_grouped_db(const EST_Pathname &filename, DIPHONE_DATABASE *db)
 		for (j=0; j<db->lpc[i]->nframes; j++)
 		    fwrite(db->lpc[i]->f[j],sizeof(float),db->lpc_order,fd);
 	    }
-	    else if (db->group_encoding == di_ulaw) // saved as shorts
+	    else if (db->group_encoding == di_ulaw || db->group_encoding == di_alaw) // saved as shorts
 	    {   
 		short *sh = new short[db->lpc_order];
 		
diff --git a/src/modules/diphone/diphone.cc b/src/modules/diphone/diphone.cc
index f6b6768..0a3ea33 100644
--- a/src/modules/diphone/diphone.cc
+++ b/src/modules/diphone/diphone.cc
@@ -180,6 +180,8 @@ void di_fixed_parameters(DIPHONE_DATABASE *db,LISP params)
 	db->group_encoding = di_raw;
     else if (streq(db->group_encoding_str,"ulaw"))
 	db->group_encoding = di_ulaw;
+    else if (streq(db->group_encoding_str,"alaw"))
+	db->group_encoding = di_alaw;
     else
     {
 	cerr << "Diphone: unknown group encoding" << endl;
@@ -218,7 +220,7 @@ static void delete_diphone_db(DIPHONE_DATABASE *db)
     {
 	wfree(db->indx[0]->diph);  // ptr to the whole diphname table
 	wfree(db->allsignal);
-	wfree(db->allulawsignal);
+	wfree(db->allualawsignal);
 	wfree(db->allframes);
     }
     for (i=0; i < db->nindex; i++)
@@ -275,7 +277,7 @@ DIPHONE_DATABASE *make_diphone_db(void)
     db->alternates_before = NIL;
     db->alternates_after = NIL;
     db->allsignal = 0;
-    db->allulawsignal = 0;
+    db->allualawsignal = 0;
     db->offsets = 0;
     db->gfd = 0;
     db->default_diphone = 0;
diff --git a/src/modules/diphone/diphone.h b/src/modules/diphone/diphone.h
index 737c9a9..723abdc 100644
--- a/src/modules/diphone/diphone.h
+++ b/src/modules/diphone/diphone.h
@@ -41,7 +41,7 @@
 
 enum di_sigaccess_t {di_direct, di_dynamic, di_ondemand};
 enum di_db_type_t {di_pcm, di_lpc};
-enum di_group_encode_t {di_raw, di_ulaw };
+enum di_group_encode_t {di_raw, di_ulaw, di_alaw };
 enum di_group_t {di_grouped, di_ungrouped};
 
 typedef struct {
@@ -109,7 +109,7 @@ typedef struct DD_STRUCT {
     int lpc_pitch_synch;    /* True if lpc frames are pitch synchronous */
 
     short *allsignal;                /* used in group files */
-    unsigned char *allulawsignal;
+    unsigned char *allualawsignal;
     float *allframes;
     short *allframesshort;
 
diff --git a/src/modules/donovan/t2s.h b/src/modules/donovan/t2s.h
index d870e87..19c5767 100644
--- a/src/modules/donovan/t2s.h
+++ b/src/modules/donovan/t2s.h
@@ -261,10 +261,6 @@ void tags(CONFIG *config, BUFFER *buffer, LING_LIST *ling_list);
 /* transcribe.c  */
 void transcribe(CONFIG *config, LING_LIST *ling_list);
 
-/* ulaw.c  */
-unsigned char linear2ulaw(int sample);
-int ulaw2linear(unsigned char ulawbyte);
-
 /* utils.c  */
 char **split(char *in);
 void tidy_split(char **root);
-- 
1.8.3.4


From 166b48d3baf174d83a2b61f069b85aba2f453f4d Mon Sep 17 00:00:00 2001
From: Sergio Oller <sergioller@gmail.com>
Date: Fri, 26 Dec 2014 23:25:07 -0800
Subject: Save waves in parts

Taken from Debian: 05-performance-combine-waves.diff

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

diff --git a/examples/text2wave.sh b/examples/text2wave.sh
index ed0b1da..d6af881 100755
--- a/examples/text2wave.sh
+++ b/examples/text2wave.sh
@@ -63,6 +63,8 @@
 (gc-status nil)
 
 ;;; Default argument values
+(defvar fp nil)
+(defvar totalnumsamples 0)
 (defvar outfile "-")
 (defvar output_type 'riff)
 (defvar frequency nil)  ;; default is no frequency modification
@@ -70,6 +72,7 @@
 (defvar mode nil)
 (defvar volume "1.0")
 (defvar wavefiles nil)
+(defvar an_utt nil)
 
 ;;; Get options
 (define (get_options)
@@ -127,39 +130,40 @@
   (format stderr "%s: %s\n" "text2wave" message)
   (text2wave_help))
 
-(define (save_record_wave utt)
+    
+(define (save_record_wave_fp utt)
 "Saves the waveform and records its so it can be joined into a 
 a single waveform at the end."
-  (let ((fn (make_tmp_filename)))
-    (utt.save.wave utt fn)
-    (set! wavefiles (cons fn wavefiles))
-    utt))
-
-(define (combine_waves)
-  "Join all the waves together into the desired output file
-and delete the intermediate ones."
-  (let ((wholeutt (utt.synth (Utterance Text ""))))
-    (mapcar
-     (lambda (d) 
-       (utt.import.wave wholeutt d t)
-       (delete-file d))
-     (reverse wavefiles))
-    (if frequency
-	(utt.wave.resample wholeutt (parse-number frequency)))
-    (if (not (equal? volume "1.0"))
-	(begin
-	  (utt.wave.rescale wholeutt (parse-number volume))))
-    (utt.save.wave wholeutt outfile output_type)
-    ))
+  (if (eq? totalnumsamples 0)
+        (wave.save.header fp (utt.wave utt) output_type nil 
+                (list (list "numsamples" 0)))
+  )
+  (set! totalnumsamples (+ totalnumsamples 
+                           (get_param 'num_samples (wave.info (utt.wave utt)) 0)
+                        )
+  )
+  (if frequency
+	   (utt.wave.resample utt (parse-number frequency))
+  )
+  (if (not (equal? volume "1.0"))
+	  (begin
+	    (utt.wave.rescale utt (parse-number volume))
+    )
+  )
+  (wave.save.data.fp (utt.wave utt) fp output_type nil)
+  (set! an_utt utt)
+)
 
 ;;;
 ;;; Redefine what happens to utterances during text to speech 
 ;;;
-(set! tts_hooks (list utt.synth save_record_wave))
+(set! tts_hooks (list utt.synth save_record_wave_fp))
 
 (define (main)
   (get_options)
 
+  (set! fp (fopen outfile "wb"))
+
   ;; do the synthesis
   (mapcar
    (lambda (f) 
@@ -168,8 +172,12 @@ and delete the intermediate ones."
 	 (tts_file f (tts_find_text_mode f auto-text-mode-alist))))
    text_files)
 
-  ;; Now put the waveforms together at again
-  (combine_waves)
+  ;; Now update the header
+  (fseek fp 0 0)
+  (wave.save.header fp (utt.wave an_utt) output_type nil 
+                (list (list "numsamples" totalnumsamples))
+  )
+  (fclose fp)
 )
 
 ;;;  Do the work
diff --git a/src/arch/festival/wave.cc b/src/arch/festival/wave.cc
index a44c5e7..aa46d1c 100644
--- a/src/arch/festival/wave.cc
+++ b/src/arch/festival/wave.cc
@@ -42,6 +42,7 @@
 #include <cstdlib>
 #include "festival.h"
 #include "festivalP.h"
+#include "EST_Wave.h"
 
 #ifdef WIN32
 #include "winsock2.h"
@@ -101,6 +102,141 @@ static LISP wave_save(LISP lwave,LISP fname,LISP ftype,LISP stype)
     return truth;
 }
 
+static LISP wave_save_data_fp(LISP lwave, LISP lfp, LISP ftype, LISP stype)
+{
+    EST_Wave *w = wave(lwave);
+    EST_String filetype,sampletype;
+    FILE * fp;
+    
+    fp = get_c_file(lfp, stdout);
+
+    if (ftype == NIL)
+    {
+	if (ft_get_param("Wavefiletype"))
+	    filetype = get_c_string(ft_get_param("Wavefiletype"));
+	else
+	    filetype = "nist";
+    }
+    else
+	filetype = get_c_string(ftype);
+    if (stype == NIL)
+    {
+	if (ft_get_param("Wavesampletype"))
+	    sampletype = get_c_string(ft_get_param("Wavesampletype"));
+	else
+	    sampletype = "short";
+    }
+    else
+	sampletype = get_c_string(stype);
+    
+    if (w->save_file_data(fp,filetype,sampletype,EST_NATIVE_BO) != write_ok)
+    {
+	cerr << "utt.save.wave.fp: failed to write wave" << endl;
+	festival_error();
+    }
+
+    return truth;
+}
+
+
+
+static LISP wave_save_fp(LISP lwave, LISP lfp, LISP ftype, LISP stype)
+{
+    EST_Wave *w = wave(lwave);
+    EST_String filetype,sampletype;
+    FILE * fp;
+    
+    fp = get_c_file(lfp, stdout);
+
+    if (ftype == NIL)
+    {
+	if (ft_get_param("Wavefiletype"))
+	    filetype = get_c_string(ft_get_param("Wavefiletype"));
+	else
+	    filetype = "nist";
+    }
+    else
+	filetype = get_c_string(ftype);
+    if (stype == NIL)
+    {
+	if (ft_get_param("Wavesampletype"))
+	    sampletype = get_c_string(ft_get_param("Wavesampletype"));
+	else
+	    sampletype = "short";
+    }
+    else
+	sampletype = get_c_string(stype);
+    
+    if (w->save_file(fp,filetype,sampletype,EST_NATIVE_BO) != write_ok)
+    {
+	cerr << "utt.save.wave.data.fp: failed to write wave" << endl;
+	festival_error();
+    }
+
+    return truth;
+}
+
+
+
+static LISP wave_save_header_fp(LISP arglist)
+{
+    LISP lfp = car(arglist);
+    arglist = cdr(arglist);
+    LISP lwave = car(arglist);
+    arglist = cdr(arglist);
+    LISP lftype = car(arglist);
+    arglist = cdr(arglist);
+    LISP lstype = car(arglist);
+    arglist = cdr(arglist);
+    LISP force_values = car(arglist);
+    arglist = cdr(arglist);
+
+    FILE *fp;
+    fp = get_c_file(lfp, NULL);
+    EST_String ftype, stype;
+    EST_Wave *w = wave(lwave);
+
+    int num_samples = w->num_samples();
+    int num_channels = w->num_channels();
+    int sample_rate = w->sample_rate();
+    int bo = EST_NATIVE_BO;
+    
+    num_samples = (int) get_param_float("numsamples", force_values, (float) num_samples);
+    num_channels = (int) get_param_float("numchannels", force_values, (float) num_channels);
+    sample_rate = (int) get_param_float("samplerate", force_values, (float) sample_rate);
+    bo = (int) get_param_float("bo", force_values, (float) bo);
+    
+    if (lftype == NIL)
+    {
+	    if (ft_get_param("Wavefiletype"))
+	        ftype = get_c_string(ft_get_param("Wavefiletype"));
+	    else
+	        ftype = "nist";
+    }
+    else
+	    ftype = get_c_string(lftype);
+    
+    if (lstype == NIL)
+    {
+        if (ft_get_param("Wavesampletype"))
+            stype = get_c_string(ft_get_param("Wavesampletype"));
+        else
+            stype = "short";
+    }
+    else
+        stype = get_c_string(lstype);
+    
+    
+    if (wave_io_save_header(fp, num_samples, num_channels,
+                        sample_rate, stype, bo, ftype) != write_ok)
+    {
+        cerr << "utt.save.wave.header: failed" << endl;
+	    festival_error();
+    }
+    
+    return truth;
+}
+
 static LISP wave_load(LISP fname,LISP ftype,LISP stype,LISP srate)
 {
     EST_Wave *w = new EST_Wave;
@@ -594,7 +730,31 @@ static LISP send_sexpr_to_client(LISP l)
 void festival_wave_init(void)
 {
     // declare utterance (wave) specific Lisp functions 
-
+    init_lsubr("wave.save.header", wave_save_header_fp,
+ "(wave.save.header FILEPOINTER WAVE FILETYPE SAMPLETYPE OVERRIDEPARAMS)\n\
+  Write a wave header of format FILETYPE to FILEPOINTER.\n\
+  Header parameters are read first from WAVE and SAMPLETYPE,\n\
+  and can be overridden with OVERRIDEPARAMS\n\
+  OVERRIDEPARAMS = ( (\"numsamples\" 84000)\n\
+                     (\"numchannels\" 1)\n\
+                     (\"samplerate\" 16000)\n\
+                     (\"bo\" 10)\n\
+                     (\"numsamples\" 16000)\n\
+                    )");
+    init_subr_4("wave.save.fp", wave_save_fp,
+ "(wave.save.fp WAVE FILEPOINTER FILETYPE SAMPLETYPE)\n\
+  Write WAVE to FILEPOINTER, respecting FILETYPE and SAMPLETYPE if specified\n\
+  if these last two arguments are unspecified the global parameters\n\
+  Wavefiletype and Wavesampletype are used.  Returns t is successful\n\
+  and throws an error if not.");  
+    init_subr_4("wave.save.data.fp", wave_save_data_fp,
+ "(wave.save.data.fp WAVE FILEPOINTER FILETYPE SAMPLETYPE)\n\
+  Write WAVE to FILEPOINTER, respecting FILETYPE and SAMPLETYPE if specified\n\
+  ignoring any file header.\n\
+  if these last two arguments are unspecified the global parameters\n\
+  Wavefiletype and Wavesampletype are used.  Returns t is successful\n\
+  and throws an error if not. It can be used with wave.save.header\n\
+  in order to concatenate several waves.");  
     init_subr_4("wave.save",wave_save,
  "(wave.save WAVE FILENAME FILETYPE SAMPLETYPE)\n\
   Save WAVE in FILENAME, respecting FILETYPE and SAMPLETYPE if specifed\n\
-- 
1.8.3.4


From 3a9c107c997e6301f96cfc9e7060ced0583ded40 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 26 Dec 2014 23:28:01 -0800
Subject: Fix memory allocation

Author: Peter Drysdale

Backported from Debian: 10-fix-memory-allocations.diff

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

diff --git a/src/modules/hts_engine/HTS_pstream.c b/src/modules/hts_engine/HTS_pstream.c
index e8cc184..8a3e3b2 100644
--- a/src/modules/hts_engine/HTS_pstream.c
+++ b/src/modules/hts_engine/HTS_pstream.c
@@ -324,7 +324,7 @@ HTS_Boolean HTS_PStreamSet_create(HTS_PStreamSet * pss, HTS_SStreamSet * sss, do
       /* copy dynamic window */
       pst->win_l_width = (int *) HTS_calloc(pst->win_size, sizeof(int));
       pst->win_r_width = (int *) HTS_calloc(pst->win_size, sizeof(int));
-      pst->win_coefficient = (double **) HTS_calloc(pst->win_size, sizeof(double));
+      pst->win_coefficient = (double **) HTS_calloc(pst->win_size, sizeof(double *));
       for (j = 0; j < pst->win_size; j++) {
          pst->win_l_width[j] = HTS_SStreamSet_get_window_left_width(sss, i, j);
          pst->win_r_width[j] = HTS_SStreamSet_get_window_right_width(sss, i, j);
diff --git a/src/modules/hts_engine/HTS_sstream.c b/src/modules/hts_engine/HTS_sstream.c
index 95b18ac..6d1f35e 100644
--- a/src/modules/hts_engine/HTS_sstream.c
+++ b/src/modules/hts_engine/HTS_sstream.c
@@ -293,7 +293,7 @@ HTS_Boolean HTS_SStreamSet_create(HTS_SStreamSet * sss, HTS_ModelSet * ms, HTS_L
       sst->win_max_width = HTS_ModelSet_get_window_max_width(ms, i);
       sst->win_l_width = (int *) HTS_calloc(sst->win_size, sizeof(int));
       sst->win_r_width = (int *) HTS_calloc(sst->win_size, sizeof(int));
-      sst->win_coefficient = (double **) HTS_calloc(sst->win_size, sizeof(double));
+      sst->win_coefficient = (double **) HTS_calloc(sst->win_size, sizeof(double *));
       for (j = 0; j < sst->win_size; j++) {
          sst->win_l_width[j] = HTS_ModelSet_get_window_left_width(ms, i, j);
          sst->win_r_width[j] = HTS_ModelSet_get_window_right_width(ms, i, j);
-- 
1.8.3.4


From b9a00a59bd1696379d77a93816ea4a9e0a59a4ab Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 26 Dec 2014 23:29:34 -0800
Subject: Replace multiple debug write calls by one

Backported from Debian: 13-performance-single-cdebug-output.diff

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

diff --git a/src/modules/UniSyn_diphone/UniSyn_diphone.cc b/src/modules/UniSyn_diphone/UniSyn_diphone.cc
index eaf05ca..8689469 100644
--- a/src/modules/UniSyn_diphone/UniSyn_diphone.cc
+++ b/src/modules/UniSyn_diphone/UniSyn_diphone.cc
@@ -123,10 +123,10 @@ LISP us_diphone_init(LISP args)
     }
     else
     {
-	*cdebug << ":" << get_param_str("grouped",args,"") << ":" << endl;
-	*cdebug << "index grouped:" << d_index->grouped << endl;
-	*cdebug << "true:" << true << endl;
-	*cdebug << "false:" << false << endl;
+	*cdebug << ":" << get_param_str("grouped",args,"") << ":" << endl
+	        << "index grouped:" << d_index->grouped << endl
+	        << "true:" << true << endl
+	        << "false:" << false << endl;
 	
 	d_index->coef_dir = get_param_str("coef_dir",args,"");
 	d_index->sig_dir = get_param_str("sig_dir",args,"");
-- 
1.8.3.4


From 9d99721191fac1ae64165b602af13c945c8e6771 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 26 Dec 2014 23:12:45 -0800
Subject: Add missing include


diff --git a/src/modules/clustergen/mlsa_resynthesis.cc b/src/modules/clustergen/mlsa_resynthesis.cc
index 5fc1baa..e4fba21 100644
--- a/src/modules/clustergen/mlsa_resynthesis.cc
+++ b/src/modules/clustergen/mlsa_resynthesis.cc
@@ -41,6 +41,7 @@
   Written for HTS Engine API 1.07 (Jan 2013)
 */
 
+#include <stdint.h>
 #include <sys/types.h>
 
 #include <EST_walloc.h>
-- 
1.8.3.4


From 521a9a67840df161b3bc90b82cc9ce802510c13e Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 26 Dec 2014 23:20:09 -0800
Subject: Fix use of fgetpos()


diff --git a/src/modules/hts_engine/HTS_misc.c b/src/modules/hts_engine/HTS_misc.c
index 97eeee7..7af3c25 100644
--- a/src/modules/hts_engine/HTS_misc.c
+++ b/src/modules/hts_engine/HTS_misc.c
@@ -245,7 +245,7 @@ size_t HTS_ftell(HTS_File * fp)
    } else if (fp->type == HTS_FILE) {
       fpos_t pos;
       fgetpos((FILE *) fp->pointer, &pos);
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(__APPLE__)
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(__APPLE__) || defined(__HAIKU__)
       return (size_t) pos;
 #else
       return (size_t) pos.__pos;
-- 
1.8.3.4


From 46f3fe1d2273b13f5a327a7d7d03ef8359488ab0 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 26 Dec 2014 23:09:50 -0800
Subject: Add config/config

Inspired by Debian patch 01-config_config.diff.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

diff --git a/config/config b/config/config
new file mode 100644
index 0000000..383b149
--- /dev/null
+++ b/config/config
@@ -0,0 +1,74 @@
+########################################################-*-mode:Makefile-*-
+##                                                                       ##
+##  Festival: local configuration file                                   ##
+##                                                                       ##
+###########################################################################
+##
+##  Specific config file for local installation
+##
+
+###########################################################################
+## Which speech tools to use
+
+EST=$(portPackageLinksDir)/speech_tools$(secondaryArchSuffix)_devel/$(relativeDevelopLibDir)/speech_tools$(secondaryArchSuffix)
+
+###########################################################################
+## Where the festival tree will be installed.
+## 
+## The default is that festival will remain where it is compiled.
+##
+## You may need to set this explicitly if automounter or NFS
+## side effects cause problems
+
+FESTIVAL_HOME := $(shell (cd $(TOP); pwd))
+
+###########################################################################
+## Feature selection.
+##
+## Select modules to include.
+
+## Non Free PSOLA synthesis.  This isn't distributed with festival because
+## of a patent, if you have src/modules/diphone/di_psolaTM.cc you can
+## include this feature.
+# INCLUDE_PSOLA_TM=1
+
+##  Support for TCL. So that festival may eval TCL commands and TCL may eval
+## festival commands.  This was added to support the CSLU toolkit but
+## others may want it too.
+# INCLUDE_TCL=1
+
+###########################################################################
+## Take most settings from speech tools.
+
+include $(EST)/config/system.mak
+include $(EST)/config/config
+
+###########################################################################
+## Add any extra modules you wish to include
+
+## These sub modules are *optional* and unless you know what they are
+## you probabaly don't want them or need them.  They are typically
+## new code that isn't yet stable yet and being used for research or
+## old code left in for compatibility for some users  
+
+## Experimental UniSyn, metrical tree, phonological structure matching
+## code
+# ALSO_INCLUDE += UniSyn_phonology UniSyn_selection
+## Cluster unit selection code as described in "Building Voices in
+## Festival", again experimental and suitable for research purposes only.
+ALSO_INCLUDE += clunits clustergen hts_engine MultiSyn
+
+## Old diphone code that will be delete, left in only for some
+## compatibility
+# ALSO_INCLUDE += diphone
+
+## Other (non-Edinburgh) modules may also be specified here (e.g. OGI code),
+
+ALSO_INCLUDE +=
+
+###########################################################################
+##
+## Describe your local system below by redefining things defined
+## in config/configs/default.mak.
+
+
-- 
1.8.3.4


From de3485cabba208df2ad622e7a6bafa07e291c140 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Fri, 26 Dec 2014 23:10:57 -0800
Subject: config/make_system: Copy system.mak from speech_tools


diff --git a/config/make_system.mak b/config/make_system.mak
index 5acf40a..5f81464 100644
--- a/config/make_system.mak
+++ b/config/make_system.mak
@@ -39,6 +39,5 @@
  ###########################################################################
 
 system.mak : config
-	@echo Check system type >&2
-	@/bin/sh  $(TOP)/config/system.sh $(TOP)/config/systems > system.mak
+	cp $(EST)/config/system.mak system.mak
 
-- 
1.8.3.4


From b329b31eaa2c9532b0b8b08e732a94e3dbe3b5a2 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Sat, 27 Dec 2014 11:58:23 -0800
Subject: Include config in make_system

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

diff --git a/config/make_system.mak b/config/make_system.mak
index 5f81464..13dbdc4 100644
--- a/config/make_system.mak
+++ b/config/make_system.mak
@@ -38,6 +38,7 @@
  ##                                                                       ##
  ###########################################################################
 
+include $(TOP)/config/config
 system.mak : config
 	cp $(EST)/config/system.mak system.mak
 
-- 
1.8.3.4


From f0b692b108d3c676cb8c5c4b38b0a1b7fa5c51f0 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Sat, 27 Dec 2014 00:03:25 -0800
Subject: Fix file system layout

Inspired by Debian patch 20-debian-filesystem-standard.diff

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

diff --git a/examples/Makefile b/examples/Makefile
index b677cb9..170369f 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -54,8 +54,7 @@ include $(TOP)/config/common_make_rules
 
 $(ALL) : % : %.sh
 	rm -f $@
-	@echo "#!/bin/sh" >$@
-	@echo "\"true\" ; exec "$(FESTIVAL_HOME)/bin/festival --script '$$0 $$*' >>$@
+	@echo "#!$(binDir)/festival --script" >$@
 	cat $< >>$@
 	chmod +x $@
 
diff --git a/examples/text2wave.sh b/examples/text2wave.sh
index d6af881..cf62ef7 100755
--- a/examples/text2wave.sh
+++ b/examples/text2wave.sh
@@ -40,7 +40,7 @@
 
 ;;; Because this is a --script type file I has to explicitly
 ;;; load the initfiles: init.scm and user's .festivalrc
-(load (path-append libdir "init.scm"))
+(load (path-append datadir "init.scm"))
 
 ;;; Process command line arguments
 (define (text2wave_help)
diff --git a/lib/festival.scm b/lib/festival.scm.in
similarity index 99%
rename from lib/festival.scm
rename to lib/festival.scm.in
index 928016d..69d2796 100644
--- a/lib/festival.scm
+++ b/lib/festival.scm.in
@@ -552,13 +552,13 @@ Doing stuff
 (define (intro)
 "(intro)
  Synthesize an introduction to the Festival Speech Synthesis System."
-  (tts (path-append libdir "../examples/intro.text") nil))
+  (tts (path-append datadir "@DOCDIR@/examples/intro.text") nil))
 
 (define (intro-spanish)
 "(intro-spanish)
  Synthesize an introduction to the Festival Speech Synthesis System
  in spanish.  Spanish voice must already be selected for this."
-  (tts (path-append libdir "../examples/spintro.text") nil))
+  (tts (path-append datadir "@DOCDIR@/examples/spintro.text") nil))
 
 (define (na_play FILENAME)
 "(play_wave FILENAME)
diff --git a/lib/init.scm b/lib/init.scm
index 90bccb7..42b9b68 100644
--- a/lib/init.scm
+++ b/lib/init.scm
@@ -36,7 +36,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;;;  Basic siod library (need this before load_library or require works)
-(load (path-append libdir "siod.scm"))
+(load (path-append datadir "siod.scm"))
 
 (defvar home-directory (or (getenv "HOME") "/")
   "home-directory
diff --git a/lib/lexicons.scm b/lib/lexicons.scm.in
similarity index 98%
rename from lib/lexicons.scm
rename to lib/lexicons.scm.in
index 574c8fa..66dba14 100644
--- a/lib/lexicons.scm
+++ b/lib/lexicons.scm.in
@@ -42,10 +42,10 @@
 ;;;  you should set lexdir in sitevars.scm
 
 (defvar lexdir 
-  (if (probe_file (path-append libdir "dicts"))
-      (path-append libdir "dicts/")
+  (if (probe_file (path-append datadir "dicts"))
+      (path-append datadir "dicts/")
       ;; else we'll guess we're in the CSTR filespace
-      (path-as-directory "/projects/festival/lib/dicts/"))
+      (path-as-directory "@DATADIR@/dicts/"))
   "lexdir
   The directory where the lexicon(s) are, by default.")
 
diff --git a/lib/phrase.scm b/lib/phrase.scm
index bbabba6..e0a82c3 100644
--- a/lib/phrase.scm
+++ b/lib/phrase.scm
@@ -93,7 +93,7 @@ in Token return punc, otherwise 0."
 
 (require 'pos)   ;; for part of speech map
 
-(defvar pbreak_ngram_dir libdir
+(defvar pbreak_ngram_dir datadir
   "pbreak_ngram_dir
   The directory containing the ngram models for predicting phrase
   breaks.  By default this is the standard library directory.")
diff --git a/lib/soleml-mode.scm b/lib/soleml-mode.scm
index 9856fb2..27b7279 100644
--- a/lib/soleml-mode.scm
+++ b/lib/soleml-mode.scm
@@ -330,7 +330,7 @@ Flatten alist arguments."
        (list 'exit_func soleml_exit_func)
        '(analysis_type xxml)
        (list 'filter 
-	     (format nil "%s -D %s " sgml_parse_progname libdir))))
+	     (format nil "%s -D %s " sgml_parse_progname datadir))))
     tts_text_modes))
 
 (provide 'soleml-mode)
diff --git a/lib/voices.scm b/lib/voices.scm.in
similarity index 99%
rename from lib/voices.scm
rename to lib/voices.scm.in
index 168d842..df50b15 100644
--- a/lib/voices.scm
+++ b/lib/voices.scm.in
@@ -42,7 +42,7 @@
 ;; The path to search for voices is created from the load-path with
 ;; an extra list of directories appended.
 
-(defvar system-voice-path '( )
+(defvar system-voice-path '("@DATADIR@/voices")
   "system-voice-path
    Additional directory not near the load path where voices can be
    found, this can be redefined in lib/sitevars.scm if desired.")
diff --git a/src/arch/festival/Makefile b/src/arch/festival/Makefile
index fe49726..1b5eafe 100644
--- a/src/arch/festival/Makefile
+++ b/src/arch/festival/Makefile
@@ -62,6 +62,6 @@ LOCAL_DEFINES += $(FESTIVAL_DEFINES)
 LOCAL_INCLUDES += $(FESTIVAL_INCLUDES)
 
 festival.o: festival.cc
-	$(CXX_COMMAND_TEMPLATES) -DFTNAME='$(PROJECT_NAME)' -DFTLIBDIRC='$(FTLIBDIR)' -DFTVERSION='$(PROJECT_VERSION)' -DFTSTATE='$(PROJECT_STATE)'  -DFTDATE='$(PROJECT_DATE)' -DFTOSTYPE=\"$(SYSTEM_TYPE)\" festival.cc
+	$(CXX_COMMAND_TEMPLATES) -DFTNAME='$(PROJECT_NAME)' -DFTVERSION='$(PROJECT_VERSION)' -DFTSTATE='$(PROJECT_STATE)'  -DFTDATE='$(PROJECT_DATE)' -DFTOSTYPEC='$(SYSTEM_TYPE)' festival.cc
 
 
diff --git a/src/arch/festival/festival.cc b/src/arch/festival/festival.cc.in
similarity index 97%
rename from src/arch/festival/festival.cc
rename to src/arch/festival/festival.cc.in
index 59abcdd..bea032c 100644
--- a/src/arch/festival/festival.cc
+++ b/src/arch/festival/festival.cc.in
@@ -60,6 +60,9 @@ void festival_load_default_files(void);
 #define STRINGIZE(S) _S_S_S(S)
 
 const char *festival_version =  STRINGIZE(FTVERSION) ":" STRINGIZE(FTSTATE) " " STRINGIZE(FTDATE);
+const char *festival_libdir = "@LIBDIR@";
+const char *festival_datadir = "@DATADIR@";
+const char *festival_sysconfdir = "/boot/home/config/settings";
 
 // Allow the path to be passed in without quotes because Windoze command line
 // is stupid
@@ -79,7 +82,6 @@ const char *festival_version =  STRINGIZE(FTVERSION) ":" STRINGIZE(FTSTATE) " "
 #define FTOSTYPE ""
 #endif
 
-const char *festival_libdir = FTLIBDIR;
 ostream *cdebug;
 static int festival_server_port = 1314;
 static EST_StrList sub_copyrights;
@@ -307,7 +309,7 @@ void festival_load_default_files(void)
     EST_String userinitfile, home_str, initfile;
 
     // Load library init first
-    initfile = (EST_String)EST_Pathname(festival_libdir).as_directory() + 
+    initfile = (EST_String)EST_Pathname(festival_datadir).as_directory() +
 	"init.scm";
     if (access((const char *)initfile,R_OK) == 0)
 	vload(initfile,FALSE);
@@ -323,6 +325,8 @@ void festival_lisp_vars(void)
     int major,minor,subminor;
     
     siod_set_lval("libdir",strintern(festival_libdir));
+    siod_set_lval("datadir",strintern(festival_datadir));
+    siod_set_lval("sysconfdir",strintern(festival_sysconfdir));
     if (!streq(FTOSTYPE,""))
 	siod_set_lval("*ostype*",cintern(FTOSTYPE));
     siod_set_lval("festival_version",
@@ -356,6 +360,7 @@ void festival_lisp_vars(void)
     if (mplayer_supported)
 	proclaim_module("mplayeraudio");
     
+#if 0 /* /usr/lib/festival/etc/machine -- ??? */
     // Add etc-dir path and machine specific directory etc/$OSTYPE
     char *etcdir = walloc(char,strlen(festival_libdir)+strlen("etc/")+
 			  strlen(FTOSTYPE)+3);
@@ -376,6 +381,7 @@ void festival_lisp_vars(void)
     
     wfree(etcdir);
     wfree(etcdircommon);
+#endif
     return;
 }
 
diff --git a/src/include/festival.h b/src/include/festival.h
index e03c432..c11d5b8 100644
--- a/src/include/festival.h
+++ b/src/include/festival.h
@@ -138,6 +138,7 @@ const EST_String utt_type(EST_Utterance &utt);
 void add_item_features(EST_Item *s,LISP features);
 
 extern const char *festival_libdir;
+extern const char *festival_datadir;
 
 //  Module specific LISP/etc definitions
 void festival_init_modules(void);
diff --git a/src/main/festival_main.cc b/src/main/festival_main.cc
index f1af602..d12e984 100644
--- a/src/main/festival_main.cc
+++ b/src/main/festival_main.cc
@@ -88,6 +88,8 @@ static void festival_main(int argc, char **argv)
         "In evaluation mode \"filenames\" starting with ( are evaluated inline\n"+
 	"Festival Speech Synthesis System: "+ festival_version +"\n"+
 	"-q            Load no default setup files\n"+
+	"--datadir <string>\n"+
+	"              Set data directory pathname\n"+
 	"--libdir <string>\n"+
         "              Set library directory pathname\n"+
         "-b            Run in batch mode (no interaction)\n"+
@@ -127,6 +129,12 @@ static void festival_main(int argc, char **argv)
 	festival_libdir = wstrdup(al.val("--libdir"));
     else if (getenv("FESTLIBDIR") != 0)
 	festival_libdir = getenv("FESTLIBDIR");
+
+    if (al.present("--datadir"))
+	festival_datadir = wstrdup(al.val("--datadir"));
+    else if (getenv("FESTDATADIR") != 0)
+	festival_datadir = getenv("FESTDATADIR");
+
     if (al.present("--heap"))
 	heap_size = al.ival("--heap");
 
-- 
1.8.3.4

