#include <config.h>
#include "settings.h"
#include <assert.h>
+#include <stdlib.h>
#include <time.h>
#include "format.h"
#include "val.h"
static struct fmt_spec default_format = {FMT_F, 8, 2};
-#define CC_CNT 5
#define CC_INITIALIZER {"-", "", "", "", '.', ','}
static struct custom_currency cc[CC_CNT] =
{
CC_INITIALIZER,
};
-static gsl_rng *rng;
-
static bool testing_mode = false;
static int global_algorithm = 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. */
/* Approximate maximum amount of memory to use for cases, in
bytes. */
size_t
-get_workspace(void)
+get_workspace (void)
{
return workspace;
}
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