home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Education
/
collectionofeducationcarat1997.iso
/
COMPUSCI
/
CENVID.ZIP
/
CENVILIB.DOC
< prev
next >
Wrap
Text File
|
1993-12-21
|
36KB
|
707 lines
CEnvi Shareware Manual, Chapter 4:
Function Library
CEnvi unregistered version 1.008
21 December 1993
CEnvi Shareware User's Manual
Copyright 1993, Nombas, All Rights Reserved.
Published by Nombas, P.O. Box 875, Medford, MA 02155 USA
(617)391-6595
Thank you for trying this shareware version of CEnvi from Nombas,
a member of the Association of Shareware Professionals (ASP).
4. CEnvi Internal Function Library
CEnvi includes a large library of internal functions that are
available for use in your CEnvi code. (External function
libraries, and a developer toolkit for creating external
libraries, will be available in an upcoming incremental release.)
4.1. Standard Library
The C language has long had a standard set of libraries that
contain routines included with nearly all C implementations.
Most of this standard library, as defined by ANSI and ISO, is
included internally to CEnvi, and so all of these routines are
available to any Cmm program executed by CEnvi.
Minimal modifications have been added to the standard library to
support the differences between the Cmm and the C languages. In
most cases, these modifications involve the redefinition of
variable pointers to become variables-passed-by-reference.
Usually, though, the Cmm call to one of these functions looks
identical to the C call. The experienced C programmer should
feel right at home.
A few functions have been dropped in this version, mostly those
dealing with locales. A few functions have also been added
beyond those in the ANSI and ISO standards when those functions
seem to be common across most existing implementations of C
libraries.
CLOCKS_PER_SEC: defined for system clock rate
FALSE: #define'd 0
TRUE: #define'd 1
NULL: #define'd 0
EXIT_FAILURE: failure program exit value
EXIT_SUCCESS: good program exit value
RAND_MAX: maximum number returned by rand()
abort: Terminate program; probably due to error.
void abort()
abs: Return the absolute value of an integer.
int abs(int x)
acos: Calculate the arc cosine.
float acos(float x)
asctime: Convert data and time to an ASCII string.
string asctime(struct tm)
asin: Calculate the arc sine.
float asin(float x)
assert: Test a condition and abort if it is FALSE.
void assert(bool test)
atan: Calculate the arc tangent.
float atan(float x)
atan2: Calculate the arc tangent of a fraction.
float atan2(float y,float x)
atexit: Register function to be called at program exit.
void atexit(string functionName)
atof: Convert ascii string to a floating-point number
float atof(string str)
atoi: Convert ascii string to an integer.
int atoi(string str)
atol: Convert ascii string to an integer.
int atol(string str)
bsearch: Binary search for member of a sorted array.
int bsearch(var key,var[] SortedArray,[int
ElementCount,]string CompareFunction)
ceil: Ceiling; round up.
float ceil(float x)
clearerr: Clear end-of-file and error status for a file.
void clearerr(FILE stream)
clock: Get processor time.
int clock()
cos: Calculate the cosine.
float cos(float x)
cosh: Calculate the hyperbolic cosine.
float cosh(float x)
ctime: Convert date-time to an ascii string.
string ctime(int time)
difftime: Compute difference between two times.
float difftime(int time1,int time0)
div: Integer division, returning quotient and remainder.
struct div(int numerator,int denominator)
errno: Value of error condition
int errno
exit: Normal program termination.
void exit(int status)
exp: Compute the exponential function.
float exp(float x)
fabs: Absolute value.
float fabs(float x)
fclose: Close an open file.
int fclose(FILE stream)
feof: Test if at end of file stream.
bool feof(FILE stream)
ferror: Test for error on a file stream.
int ferror(FILE stream)
fflush: Flush stream for open file(s).
int fflush(FILE stream)
fgetc: Get a character from file stream.
int fgetc(FILE stream)
fgetpos: Get current position of a file stream.
int fgetpos(FILE stream,Var pos)
fgets: Get a string from an input stream.
string fgets([string buf[,int buflen],]FILE stream)
floor: Round down.
float floor(float x)
fmod: Modulus; calculate remainder.
float fmod(float x,float y)
fopen: Open a file.
FILE fopen(string filename,string mode)
fprintf: Formatted output to a file stream.
int fprintf(FILE stream,string format,...)
fputc: Write a character to a file stream.
int fputc(int c,FILE stream)
fputs: Write a string to a file stream.
int fputs(string s,FILE stream)
fread: Read data from a file.
int fread(byte[] DestBuffer,bufferLen,stream)
int fread(Var DestVar,int DataTypeInFile,stream)
freopen: Assign a new file specification to a file handle.
FILE freopen(string filename,string mode,FILE OldFP)
frexp: Break into a mantissa and an exponential power of 2.
float frexp(float x,int exponent)
fscanf: Formatted input from a file stream.
int fscanf(FILE stream,string format,...)
fseek: Set the file position for an opened file stream.
int fseek(stream,offset[,mode])
fsetpos: Set position of a file stream.
int fsetpos(stream,Var pos)
ftell: Get the current value of the file position.
int ftell(FILE stream)
fwrite: Write data to a file.
int fwrite(byte[] SourceBuffer,bufferLen,stream)
int fwrite(Var SourceVar,int DataTypeInFile,stream)
getc: Get a character from file stream.
int getc(FILE stream)
getch: Get a character from the keyboard; without echo.
int getch()
getchar: Get a character from standard input (keyboard).
int getchar()
getche: Get a character from the keyboard; with echo.
int getch()
getenv: Get an environment string.
string getenv(string VariableName)
gets: Read a string from standard input (keyboard).
string gets([string buf])
gmtime: Convert data and time to Greeenwich mean time (GMT).
struct gmtime(int t)
isalnum: Test for alphanumeric character.
bool isalnum(int c)
isalpha: Test for alphabetic character.
bool isalpha(int c)
isascii: Test for ASCII coded character.
bool isascii(int c)
iscntrl: Test for any control character.
bool iscntrl(int c)
isdigit: Test for any decimal-digit character.
bool isdigit(int c)
isgraph: Test