1.23
2.0
main
test-branch
|
Last change
on this file since 851cc03a was e48510a, checked in by Manchun Zheng <zmanchun@…>, 12 years ago |
|
improved IO transformer; added a method for printing AST as CIVL-C code; added two examples for MPI transformer, still need to improve MPI transformer; added a simple CIVL implementation of stdlib.h.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1082 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
566 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.h>
|
|---|
| 9 |
|
|---|
| 10 | #define DEFAULT_SEED 99
|
|---|
| 11 |
|
|---|
| 12 | unsigned _rand_seed = DEFAULT_SEED;
|
|---|
| 13 | unsigned _random_seed = DEFAULT_SEED;
|
|---|
| 14 |
|
|---|
| 15 | $abstract int rand_work(unsigned seed);
|
|---|
| 16 |
|
|---|
| 17 | int rand(){
|
|---|
| 18 | return rand_work(_rand_seed);
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | void srand(unsigned int seed){
|
|---|
| 22 | seed = seed;
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | void srandom(unsigned int seed){
|
|---|
| 26 | _random_seed = seed;
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | $abstract long int random_work(unsigned seed);
|
|---|
| 30 |
|
|---|
| 31 | long int random(){
|
|---|
| 32 | return random_work(_random_seed);
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | void exit(int status){
|
|---|
| 36 | $exit();
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.