Must call getl_reading_script() to get proper value.
[pspp] / src / settings.c
index 749757bc6fd9526d4cd7e938f9fb8dce4d9f95be..3bd98c18ca47b177aaae8a0a9ee701c00d38817a 100644 (file)
@@ -20,6 +20,7 @@
 #include <config.h>
 #include "settings.h"
 #include <assert.h>
+#include <stdlib.h>
 #include <time.h>
 #include "format.h"
 #include "val.h"
@@ -66,7 +67,6 @@ static size_t workspace = 4L * 1024 * 1024;
 
 static struct fmt_spec default_format = {FMT_F, 8, 2};
 
-#define CC_CNT 5
 #define CC_INITIALIZER {"-", "", "", "", '.', ','}
 static struct custom_currency cc[CC_CNT] = 
   {
@@ -77,8 +77,6 @@ static struct custom_currency cc[CC_CNT] =
     CC_INITIALIZER,
   };
 
-static gsl_rng *rng;
-
 static bool testing_mode = false;
 
 static int global_algorithm = ENHANCED;
@@ -90,20 +88,17 @@ static int syntax = ENHANCED;
 static void init_viewport (void);
 
 void
-done_settings (void)
+settings_init (void)
 {
-  if (rng != NULL) 
-    gsl_rng_free (rng);
-
-  free (prompt);
-  free (cprompt);
-  free (dprompt);
+  init_viewport ();
 }
 
 void
-init_settings (void)
+settings_done (void)
 {
-  init_viewport ();
+  free (prompt);
+  free (cprompt);
+  free (dprompt);
 }
 
 /* Screen length in lines. */
@@ -494,7 +489,7 @@ set_endcmd (char endcmd_)
 /* Approximate maximum amount of memory to use for cases, in
    bytes. */
 size_t
-get_workspace(void)
+get_workspace (void)
 {
   return workspace;
 }
@@ -540,26 +535,6 @@ set_cc (int idx, const struct custom_currency *cc_)
   cc[idx] = *cc_;
 }
 
-/* Returns the current random number generator. */
-gsl_rng *
-get_rng (void)
-{
-  if (rng == NULL)
-    set_rng (time (0));
-  return rng;
-}
-
-/* Initializes or reinitializes the random number generator with
-   the given SEED. */
-void
-set_rng (unsigned long seed) 
-{
-  rng = gsl_rng_alloc (gsl_rng_mt19937);
-  if (rng == NULL)
-    xalloc_die ();
-  gsl_rng_set (rng, seed);
-}
-
 /* Are we in testing mode?  (e.g. --testing-mode command line
    option) */
 bool