File indexing completed on 2024-11-15 09:42:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef __G_RAND_H__
0028 #define __G_RAND_H__
0029
0030 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
0031 #error "Only <glib.h> can be included directly."
0032 #endif
0033
0034 #include <glib/gtypes.h>
0035
0036 G_BEGIN_DECLS
0037
0038 typedef struct _GRand GRand;
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 GLIB_AVAILABLE_IN_ALL
0050 GRand* g_rand_new_with_seed (guint32 seed);
0051 GLIB_AVAILABLE_IN_ALL
0052 GRand* g_rand_new_with_seed_array (const guint32 *seed,
0053 guint seed_length);
0054 GLIB_AVAILABLE_IN_ALL
0055 GRand* g_rand_new (void);
0056 GLIB_AVAILABLE_IN_ALL
0057 void g_rand_free (GRand *rand_);
0058 GLIB_AVAILABLE_IN_ALL
0059 GRand* g_rand_copy (GRand *rand_);
0060 GLIB_AVAILABLE_IN_ALL
0061 void g_rand_set_seed (GRand *rand_,
0062 guint32 seed);
0063 GLIB_AVAILABLE_IN_ALL
0064 void g_rand_set_seed_array (GRand *rand_,
0065 const guint32 *seed,
0066 guint seed_length);
0067
0068 #define g_rand_boolean(rand_) ((g_rand_int (rand_) & (1 << 15)) != 0)
0069
0070 GLIB_AVAILABLE_IN_ALL
0071 guint32 g_rand_int (GRand *rand_);
0072 GLIB_AVAILABLE_IN_ALL
0073 gint32 g_rand_int_range (GRand *rand_,
0074 gint32 begin,
0075 gint32 end);
0076 GLIB_AVAILABLE_IN_ALL
0077 gdouble g_rand_double (GRand *rand_);
0078 GLIB_AVAILABLE_IN_ALL
0079 gdouble g_rand_double_range (GRand *rand_,
0080 gdouble begin,
0081 gdouble end);
0082 GLIB_AVAILABLE_IN_ALL
0083 void g_random_set_seed (guint32 seed);
0084
0085 #define g_random_boolean() ((g_random_int () & (1 << 15)) != 0)
0086
0087 GLIB_AVAILABLE_IN_ALL
0088 guint32 g_random_int (void);
0089 GLIB_AVAILABLE_IN_ALL
0090 gint32 g_random_int_range (gint32 begin,
0091 gint32 end);
0092 GLIB_AVAILABLE_IN_ALL
0093 gdouble g_random_double (void);
0094 GLIB_AVAILABLE_IN_ALL
0095 gdouble g_random_double_range (gdouble begin,
0096 gdouble end);
0097
0098
0099 G_END_DECLS
0100
0101 #endif