1.1 --- a/epoc32/include/stdapis/glib-2.0/glib/grand.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/glib-2.0/glib/grand.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,89 @@
1.4 -grand.h
1.5 +/* GLIB - Library of useful routines for C programming
1.6 + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
1.7 + * Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
1.8 + *
1.9 + * This library is free software; you can redistribute it and/or
1.10 + * modify it under the terms of the GNU Lesser General Public
1.11 + * License as published by the Free Software Foundation; either
1.12 + * version 2 of the License, or (at your option) any later version.
1.13 + *
1.14 + * This library is distributed in the hope that it will be useful,
1.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.17 + * Lesser General Public License for more details.
1.18 + *
1.19 + * You should have received a copy of the GNU Lesser General Public
1.20 + * License along with this library; if not, write to the
1.21 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1.22 + * Boston, MA 02111-1307, USA.
1.23 + */
1.24 +
1.25 +/*
1.26 + * Modified by the GLib Team and others 1997-2000. See the AUTHORS
1.27 + * file for a list of people on the GLib Team. See the ChangeLog
1.28 + * files for a list of changes. These files are distributed with
1.29 + * GLib at ftp://ftp.gtk.org/pub/gtk/.
1.30 + */
1.31 +
1.32 +#ifndef __G_RAND_H__
1.33 +#define __G_RAND_H__
1.34 +
1.35 +#include <_ansi.h>
1.36 +#include <glib/gtypes.h>
1.37 +
1.38 +G_BEGIN_DECLS
1.39 +
1.40 +typedef struct _GRand GRand;
1.41 +
1.42 +/* GRand - a good and fast random number generator: Mersenne Twister
1.43 + * see http://www.math.keio.ac.jp/~matumoto/emt.html for more info.
1.44 + * The range functions return a value in the intervall [begin, end).
1.45 + * int -> [0..2^32-1]
1.46 + * int_range -> [begin..end-1]
1.47 + * double -> [0..1)
1.48 + * double_range -> [begin..end)
1.49 + */
1.50 +
1.51 +IMPORT_C GRand* g_rand_new_with_seed (guint32 seed);
1.52 +IMPORT_C GRand* g_rand_new_with_seed_array (const guint32 *seed,
1.53 + guint seed_length);
1.54 +IMPORT_C GRand* g_rand_new (void);
1.55 +IMPORT_C void g_rand_free (GRand *rand_);
1.56 +IMPORT_C GRand* g_rand_copy (GRand *rand_);
1.57 +IMPORT_C void g_rand_set_seed (GRand *rand_,
1.58 + guint32 seed);
1.59 +IMPORT_C void g_rand_set_seed_array (GRand *rand_,
1.60 + const guint32 *seed,
1.61 + guint seed_length);
1.62 +
1.63 +#define g_rand_boolean(rand_) ((g_rand_int (rand_) & (1 << 15)) != 0)
1.64 +
1.65 +IMPORT_C guint32 g_rand_int (GRand *rand_);
1.66 +IMPORT_C gint32 g_rand_int_range (GRand *rand_,
1.67 + gint32 begin,
1.68 + gint32 end);
1.69 +IMPORT_C gdouble g_rand_double (GRand *rand_);
1.70 +IMPORT_C gdouble g_rand_double_range (GRand *rand_,
1.71 + gdouble begin,
1.72 + gdouble end);
1.73 +IMPORT_C void g_random_set_seed (guint32 seed);
1.74 +
1.75 +#define g_random_boolean() ((g_random_int () & (1 << 15)) != 0)
1.76 +
1.77 +IMPORT_C guint32 g_random_int (void);
1.78 +IMPORT_C gint32 g_random_int_range (gint32 begin,
1.79 + gint32 end);
1.80 +IMPORT_C gdouble g_random_double (void);
1.81 +IMPORT_C gdouble g_random_double_range (gdouble begin,
1.82 + gdouble end);
1.83 +
1.84 +
1.85 +G_END_DECLS
1.86 +
1.87 +#endif /* __G_RAND_H__ */
1.88 +
1.89 +
1.90 +
1.91 +
1.92 +
1.93 +