#include <limits.h>
#include <stddef.h>
#include <stdlib.h>
#include "ut_types.h"
#include "ut_rand.h"
#include <errno.h>
Classes | |
struct | UT_random_data |
struct | random_poly_info |
Defines | |
#define | TYPE_0 0 |
#define | BREAK_0 8 |
#define | DEG_0 0 |
#define | SEP_0 0 |
#define | TYPE_1 1 |
#define | BREAK_1 32 |
#define | DEG_1 7 |
#define | SEP_1 3 |
#define | TYPE_2 2 |
#define | BREAK_2 64 |
#define | DEG_2 15 |
#define | SEP_2 1 |
#define | TYPE_3 3 |
#define | BREAK_3 128 |
#define | DEG_3 31 |
#define | SEP_3 3 |
#define | TYPE_4 4 |
#define | BREAK_4 256 |
#define | DEG_4 63 |
#define | SEP_4 1 |
#define | MAX_TYPES 5 |
#define | TYPE_0 0 |
#define | BREAK_0 8 |
#define | DEG_0 0 |
#define | SEP_0 0 |
#define | TYPE_1 1 |
#define | BREAK_1 32 |
#define | DEG_1 7 |
#define | SEP_1 3 |
#define | TYPE_2 2 |
#define | BREAK_2 64 |
#define | DEG_2 15 |
#define | SEP_2 1 |
#define | BREAK_3 128 |
#define | TYPE_4 4 |
#define | BREAK_4 256 |
#define | DEG_4 63 |
#define | SEP_4 1 |
#define | MAX_TYPES 5 |
Functions | |
static int | srandom_r__ (unsigned int seed, struct UT_random_data *buf) |
static int | random_r__ (struct UT_random_data *buf, UT_sint32 *result) |
void | UT_srandom (UT_uint32 seed) |
static UT_sint32 | random__ () |
UT_sint32 | UT_rand () |
Variables | |
static UT_sint32 | randtbl [DEG_3+1] |
static struct UT_random_data | unsafe_state |
#define BREAK_0 8 |
#define BREAK_0 8 |
#define BREAK_1 32 |
#define BREAK_1 32 |
#define BREAK_2 64 |
#define BREAK_2 64 |
#define BREAK_3 128 |
#define BREAK_3 128 |
#define BREAK_4 256 |
#define BREAK_4 256 |
#define DEG_0 0 |
#define DEG_0 0 |
#define DEG_1 7 |
#define DEG_1 7 |
#define DEG_2 15 |
#define DEG_2 15 |
#define DEG_3 31 |
#define DEG_4 63 |
#define DEG_4 63 |
#define MAX_TYPES 5 |
#define MAX_TYPES 5 |
Referenced by srandom_r__().
#define SEP_0 0 |
#define SEP_0 0 |
#define SEP_1 3 |
#define SEP_1 3 |
#define SEP_2 1 |
#define SEP_2 1 |
#define SEP_3 3 |
#define SEP_4 1 |
#define SEP_4 1 |
#define TYPE_0 0 |
#define TYPE_0 0 |
Referenced by random_r__(), and srandom_r__().
#define TYPE_1 1 |
#define TYPE_1 1 |
#define TYPE_2 2 |
#define TYPE_2 2 |
#define TYPE_3 3 |
#define TYPE_4 4 |
#define TYPE_4 4 |
static UT_sint32 random__ | ( | ) | [static] |
References random_r__().
Referenced by UT_rand().
static int random_r__ | ( | struct UT_random_data * | buf, | |
UT_sint32 * | result | |||
) | [static] |
References UT_random_data::end_ptr, UT_random_data::fptr, UT_random_data::rand_type, UT_random_data::rptr, UT_random_data::state, and TYPE_0.
Referenced by random__(), and srandom_r__().
static int srandom_r__ | ( | unsigned int | seed, | |
struct UT_random_data * | buf | |||
) | [static] |
References UT_random_data::fptr, MAX_TYPES, UT_random_data::rand_deg, UT_random_data::rand_sep, UT_random_data::rand_type, random_r__(), UT_random_data::rptr, UT_random_data::state, type, and TYPE_0.
Referenced by UT_srandom().
UT_sint32 UT_rand | ( | ) |
References random__().
Referenced by s_RTF_ListenerWriteDoc::_openFrame(), IE_Exp_RTF::_output_MultiLevelRTF(), IE_Exp_RTF::_output_SimpleListRTF(), IE_Imp_RTF::addFrame(), abiword_document::garble_image_line(), abiword_document::get_random_char(), IE_Imp_RTF::HandleHeaderFooter(), IE_Imp_RTF::HandleListLevel(), IE_Imp_WordPerfect::openEndnote(), IE_Imp_WordPerfect::openFootnote(), IE_Imp_WordPerfect::openOrderedListLevel(), IE_Imp_WordPerfect::openUnorderedListLevel(), RTF_msword97_level::RTF_msword97_level(), UT_createTmpFile(), and UT_UUIDGenerator__test().
void UT_srandom | ( | UT_uint32 | seed | ) |
References srandom_r__().
Referenced by abiword_document::get_random_char(), and XAP_App::initialize().
{ TYPE_3, -1726662223, 379960547, 1735697613, 1040273694, 1313901226, 1627687941, -179304937, -2073333483, 1780058412, -1989503057, -615974602, 344556628, 939512070, -1249116260, 1507946756, -812545463, 154635395, 1388815473, -1926676823, 525320961, -1009028674, 968117788, -123449607, 1284210865, 435012392, -2017506339, -911064859, -370259173, 1132637927, 1398500161, -205601318, }
struct UT_random_data unsafe_state [static] |