Benny Prijono | 4766ffe | 2005-11-01 17:56:59 +0000 | [diff] [blame] | 1 | /* $Id$ |
| 2 | * |
| 3 | */ |
Benny Prijono | dd859a6 | 2005-11-01 16:42:51 +0000 | [diff] [blame] | 4 | /* $Log: /pjproject-0.3/pjlib/include/pj/rand.h $ |
| 5 | * |
| 6 | * 3 10/14/05 12:26a Bennylp |
| 7 | * Finished error code framework, some fixes in ioqueue, etc. Pretty |
| 8 | * major. |
| 9 | * |
| 10 | * 2 9/17/05 10:37a Bennylp |
| 11 | * Major reorganization towards version 0.3. |
| 12 | * |
| 13 | * 1 9/15/05 8:40p Bennylp |
| 14 | * Created. |
| 15 | */ |
| 16 | #ifndef __PJ_RAND_H__ |
| 17 | #define __PJ_RAND_H__ |
| 18 | |
| 19 | /** |
| 20 | * @file rand.h |
| 21 | * @brief Random Number Generator. |
| 22 | */ |
| 23 | |
| 24 | #include <pj/config.h> |
| 25 | |
| 26 | PJ_BEGIN_DECL |
| 27 | |
| 28 | |
| 29 | /** |
| 30 | * @defgroup PJ_RAND Random Number Generator |
| 31 | * @ingroup PJ_MISC |
| 32 | * @{ |
| 33 | * This module contains functions for generating random numbers. |
| 34 | * This abstraction is needed not only because not all platforms have |
| 35 | * \a rand() and \a srand(), but also on some platforms \a rand() |
| 36 | * only has 16-bit randomness, which is not good enough. |
| 37 | */ |
| 38 | |
| 39 | /** |
| 40 | * Put in seed to random number generator. |
| 41 | * |
| 42 | * @param seed Seed value. |
| 43 | */ |
| 44 | PJ_DECL(void) pj_srand(unsigned int seed); |
| 45 | |
| 46 | |
| 47 | /** |
| 48 | * Generate random integer with 32bit randomness. |
| 49 | * |
| 50 | * @return a random integer. |
| 51 | */ |
| 52 | PJ_DECL(int) pj_rand(void); |
| 53 | |
| 54 | |
| 55 | /** @} */ |
| 56 | |
| 57 | |
| 58 | PJ_END_DECL |
| 59 | |
| 60 | |
| 61 | #endif /* __PJ_RAND_H__ */ |
| 62 | |