"Fossies" - the Fresh Open Source Software Archive 
Member "apg-2.2.3/rnd.h" (7 Aug 2003, 2119 Bytes) of package /linux/privat/old/apg-2.2.3.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 /*
2 ** Copyright (c) 1999, 2000, 2001, 2002, 2003
3 ** Adel I. Mirzazhanov. All rights reserved
4 **
5 ** Redistribution and use in source and binary forms, with or without
6 ** modification, are permitted provided that the following conditions
7 ** are met:
8 **
9 ** 1.Redistributions of source code must retain the above copyright notice,
10 ** this list of conditions and the following disclaimer.
11 ** 2.Redistributions in binary form must reproduce the above copyright
12 ** notice, this list of conditions and the following disclaimer in the
13 ** documentation and/or other materials provided with the distribution.
14 ** 3.The name of the author may not be used to endorse or promote products
15 ** derived from this software without specific prior written permission.
16 **
17 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
18 ** OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
21 ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 ** GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 ** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 #ifndef APG_RND_H
31 #define APG_RND_H 1
32
33 #ifndef APG_OWN_TYPES_H
34 #include "owntypes.h"
35 #endif /* OWN_TYPES_H */
36
37 extern UINT32 __rnd_seed[2];
38
39 #define RND_MX 0x7FFFFFFF
40 #ifdef __OpenBSD__
41 #define APG_DEVRANDOM "/dev/arandom"
42 #else
43 #define APG_DEVRANDOM "/dev/random"
44 #endif /* __OpenBSD__ */
45 #define APG_DEVURANDOM "/dev/urandom"
46
47 extern void x917_setseed (UINT32 seed, int quiet);
48 extern UINT randint (int n);
49 #ifndef APG_USE_SHA
50 UINT32 x917cast_rnd (void);
51 #else /* APG_USE_SHA */
52 UINT32 x917sha1_rnd (void);
53 #endif /* APG_USE_SHA*/
54
55 #endif /* APG_RND_H */