/[pspp]/pspp/src/settings.c
ViewVC logotype

Diff of /pspp/src/settings.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by blp, Sun Dec 11 02:48:45 2005 UTC revision 1.2 by blp, Sun Dec 11 07:35:51 2005 UTC
# Line 20  Line 20 
20  #include <config.h>  #include <config.h>
21  #include "settings.h"  #include "settings.h"
22  #include <assert.h>  #include <assert.h>
23    #include <stdlib.h>
24  #include <time.h>  #include <time.h>
25  #include "format.h"  #include "format.h"
26  #include "val.h"  #include "val.h"
# Line 77  static struct custom_currency cc[CC_CNT] Line 78  static struct custom_currency cc[CC_CNT]
78      CC_INITIALIZER,      CC_INITIALIZER,
79    };    };
80    
 static gsl_rng *rng;  
   
81  static bool testing_mode = false;  static bool testing_mode = false;
82    
83  static int global_algorithm = ENHANCED;  static int global_algorithm = ENHANCED;
# Line 92  static void init_viewport (void); Line 91  static void init_viewport (void);
91  void  void
92  done_settings (void)  done_settings (void)
93  {  {
   if (rng != NULL)  
     gsl_rng_free (rng);  
   
94    free (prompt);    free (prompt);
95    free (cprompt);    free (cprompt);
96    free (dprompt);    free (dprompt);
# Line 494  set_endcmd (char endcmd_) Line 490  set_endcmd (char endcmd_)
490  /* Approximate maximum amount of memory to use for cases, in  /* Approximate maximum amount of memory to use for cases, in
491     bytes. */     bytes. */
492  size_t  size_t
493  get_workspace(void)  get_workspace (void)
494  {  {
495    return workspace;    return workspace;
496  }  }
# Line 540  set_cc (int idx, const struct custom_cur Line 536  set_cc (int idx, const struct custom_cur
536    cc[idx] = *cc_;    cc[idx] = *cc_;
537  }  }
538    
 /* 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);  
 }  
   
539  /* Are we in testing mode?  (e.g. --testing-mode command line  /* Are we in testing mode?  (e.g. --testing-mode command line
540     option) */     option) */
541  bool  bool

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26