/* * 'devices.h' created: Tue Oct 15 23:18:24 2002 * * Copyright 2002 by Lubomir Host <8host AT pauli.fmph.uniba.sk> * * License: GNU GPL (GNU Public License) * */ /* $Platon$ */ #ifndef DEVICES_H # define DEVICES_H #include "main.h" /* operations defined on R.N.G. generators/devices */ typedef struct rng_struct { char *desc; /* description of R.N.G. device */ int fd; /* filedescriptor, if R.N.G. is valid device (e.g. /dev/urandom) */ unsigned int seed; /* startup initialization seed for kongruential R.N.G. */ int max_count; /* maximum available data in R.N.G. for each test */ Real_t range; /* range returned by R.N.G. */ int cell_count; /* number of numbers per one cell is 2^cell_count */ int (*open) (void); /* open and initialize R.N.G. */ Real_t (*read) (void); /* read one number from R.N.G. */ int (*close) (void); /* close R.N.G. */ } RNG_device_t; extern RNG_device_t *rng_devices[]; /* NULL terminated array of device structures */ int open_devices(void); /* open all avilable devices */ int close_devices(void); /* close all avilable devices */ #endif /* ifndef DEVICES_H */