#!/bin/sh # # This is a shell archive. To extract its contents, # execute this file with /bin/sh to create the file(s): # # fgiusr.c incerto.c readme # # This shell archive created: Mon May 19 09:58:31 EDT 1997 # echo "Extracting file fgiusr.c" sed -e 's/^X//' <<\SHAR_EOF > fgiusr.c X/* X X fgiusr.c - sample fgiusr.c for incerto.c X X Marco Greco (marcog@ctonline.it), Catania, Italy X X Initial release: Nov 92 X X*/ X#include "fgicfunc.h" X Xint get_rand(); Xint start_rand(); Xint say_seed(); Xint get_seed(); X Xcfunc_t usrcfuncs[] = X { X "get_rand", get_rand, 1, X "start_rand", start_rand, 1, X "say_seed", say_seed, 0, X "get_seed", get_seed, 0, X 0, 0, 0 X }; SHAR_EOF if [ `wc -c < fgiusr.c` -ne 385 ] then echo "Lengths do not match -- Bad Copy of fgiusr.c" fi echo "Extracting file incerto.c" sed -e 's/^X//' <<\SHAR_EOF > incerto.c X/* X X incerto.c - A random number generator for 4gl X X Marco Greco (marcog@ctonline.it), Catania, Italy X X Initial release: Nov 92 X X NOTICE X Permission to use, copy, modify, and distribute this software X and its documentation for any purpose is hereby granted without X fee, provided that X X - all copies of the software and related documentation contain this X notice and authorship information, UNMODIFIED X X - no fee is charged for the physical act of redistributing this X software or modified copies thereof X X THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, X EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY X WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. X X IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INCIDENTAL, X INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER X RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED X OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING X OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. X X ALL RISKS CONNECTED TO THE USE OF THIS SOFTWARE OR IMPOSSIBILITY X THEREOF LIE SOLELY ON YOU. X USE OF THIS SOFTWARE CONSTITUES AGREEMENT WITH THE ABOVE TERMS X AND CONDITIONS. X*/ X X#include X Xunsigned int seed=1; X X/* X** gets next random number X*/ Xget_rand(nargs) Xint nargs; X{ X long i,j; X popint(&i); X seed=(0x8088405*seed+1) & 0xFFFF; X j=seed % i; X retint(j); X return(1); X} X X/* X** sets the random generator seed X*/ Xstart_rand(nargs) Xint nargs; X{ X int i; X popint(&i); X seed=i; X return(0); X} X X/* X** returns the current seed X*/ Xsay_seed(nargs) Xint nargs; X{ X retint(seed); X return(1); X} X X/* X** asks the system clock for a seed X*/ Xget_seed(nargs) Xint nargs; X{ X int i; X i=(time(NULL)) & 0xFFFF; X retint(i); X return(1); X} SHAR_EOF if [ `wc -c < incerto.c` -ne 1849 ] then echo "Lengths do not match -- Bad Copy of incerto.c" fi echo "Extracting file readme" sed -e 's/^X//' <<\SHAR_EOF > readme XIncerto 30 secs documentation: X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ XContents: fgiusr.c - sample fgiusr.c for incerto X incerto.c - the tool X readme - this readme file X XAuthor: Marco Greco (marcog@ctonline.it), Catania, Italy X XInitial release: Nov 92 X XUsage: X X# X# gets next random number X# Xlet r=get_rand(range) X X# X# sets the random generator seed X# Xcall start_rand(seed) X X# X# returns the current seed X# Xlet s=say_seed() X X# X# asks the system clock for a seed X# Xlet s=get_seed() SHAR_EOF if [ `wc -c < readme` -ne 478 ] then echo "Lengths do not match -- Bad Copy of readme" fi echo "Done." exit 0