source: CIVL/text/include/stdlib.h@ dfb0fef

1.23 2.0 main test-branch
Last change on this file since dfb0fef was e6b02c8, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

updates CIVL to use the new ABC FrontEnd. tests updated accordingly when necessary.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1380 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 590 bytes
Line 
1/* CIVL model of stdlib.c */
2
3#ifdef __STDLIB__
4#else
5#define __STDLIB__
6
7#include<stdlib-common.h>
8#include<civlc.cvh>
9
10#define DEFAULT_SEED 99
11
12unsigned _rand_seed = DEFAULT_SEED;
13unsigned _random_seed = DEFAULT_SEED;
14
15$abstract int rand_work(unsigned seed);
16
17int rand(){
18 return rand_work(_rand_seed);
19}
20
21void srand(unsigned int seed){
22 seed = seed;
23}
24
25void srandom(unsigned int seed){
26 _random_seed = seed;
27}
28
29$abstract long int random_work(unsigned seed);
30
31long int random(){
32 return random_work(_random_seed);
33}
34
35void exit(int status){
36 $exit();
37}
38
39void sleep(int i){
40}
41
42#endif
Note: See TracBrowser for help on using the repository browser.