Berkeley Pascal standard libary which is based on the official Pascal standard, "Specification for the Computer Programming Language Pascal" (ISO dp7185).
In additional there were a number of Berkeley extensions.
-
WIN32 targeting, changes marked with either "ifdef WIN32" or "ifndef unix".
-
Globals _argc and _argv renamed to _pcargc and _pcargv; avoids any stdlib symbol clashes plus allows px (via libpx) to be embedded within pxd.
-
Function prototypes, explicit return types.
-
Public definitions relocated into "libpc.h", inc prototypes.
-
Optional sccsid definition.
-
Initialise references to stdio, stdout and stderr at runtime.
-
ANSI/C varargs.
-
printf format specifications.
-
const parameters for diagnostics and copy interfaces.
-
time_t usage
-
static or const static declarations of suitable variables.
-
Obey TEXT/BINARY mode selection on streams.
-
argv(i,a) - w here i is an integer and a is a string variable assigns the (possibly truncated or blank padded) i ’th argument of the invocation of the current UNIX process to the variable a. The range of valid i is 0 to argc-1 .
-
date(a) - assigns the current date to the alfa variable a in the format ‘dd mmm yy ’, where ‘mmm’ is the first three characters of the month, i.e. ‘Apr’.
-
flush(f) - writes the output buffered for Pascal file f into the asociated UNIX file.
-
halt - terminates the execution of the program with a control flow backtrace.
-
linelimit(f,x) - with f a textfile and x an integer expression causes the program to be abnormally terminated if more than x lines are written on file f. If x is less than 0 then no limit is imposed.
-
message(x,...) ( causes the parameters, which have the format of those to the built-in procedure write, to be written unbuffered on the diagnostic unit 2, almost always the user’s terminal.
-
null - a procedure of no arguments which does absolutely nothing. It is useful as a place holder, and is generated by pxp in place of the invisible empty statement.
-
remove(a) - where a is a string causes the UNIX file whose name is a, with trailing blanks eliminated, to be removed.
-
reset(f,a) - where a is a string causes the file whose name is a (with blanks trimmed) to be associated with f in addition to the normal function of reset.
-
rewrite(f,a) - is analogous to 'reset' above.
-
stlimit(i) - where i is an integer sets the statement limit to be i statements. Specifying the p option to pc disables statement limit counting.
-
time(a) - causes the current time in the form ‘ hh:mm:ss ’ to be assigned to the alfa variable a.
-
argc - returns the count of arguments when the Pascal program was invoked. Argc is always at least 1.
-
card(x) - returns the cardinality of the set x, i.e. the number of elements contained in the set.
-
clock - returns an integer which is the number of central processor milliseconds of user time used by this process.
-
expo(x) - yields the integer valued exponent of the floating-point representation of x ; expo(x) = entier(log2(abs(x))).
-
random(x) 0 where x is a real parameter, evaluated but otherwise ignored, invokes a linear congruential random number generator. Successive seeds are generated as (seed*a + c) mod m and the new random number is a normalization of the seed to the range 0.0 to 1.0; a is 62605, c is 113218009, and m is 536870912. The initial seed is 7774755.
-
seed(i) - where i is an integer sets the random number generator seed to i and returns the previous seed. Thus seed(seed(i)) has no effect except to yield value i. sysclock an integer function of no arguments returns the number of central processor milliseconds of system time used by this process.
-
undefined(x) - a Boolean function. Its argument is a real number and it always returns false.
-
wallclock - an integer function of no arguments