UxFax2 Unix Fax Server

Version 3.2

"PI" (Programme Interpreter) Language

Programmer's Reference Manual


Table of Contents

INTRODUCTION
PI as a General Purpose Language
PI as a Report Generator
GLOSSARY FILE CONCEPT
Multiple Glossary Headers
Directives
Embedded Glossaries
Glossary Variable Substitution
Environment Variable Substitution
Inline Command Substitution
INTRODUCTORY TUTORIAL
Hello World
Using Standard I/O
The Run Command
Command Line Arguments
Command Line Options
DEVICE INDEPENDENT OUTPUT DRIVER
Header and Footers
Page Breaks
Line Drawing and Effects
REPORT WRITER TUTORIAL
The Address Report
Report Listing
Description
The Usage Report
Program Startup Section
Main Process Loop
Record Processing
Footer Processing
LANGUAGE OVERVIEW
Comments
Include Directive
Define Directive
Declarations
Local Variables
Global Variables
Functions
Data Types
Basic Data Types
Arrays
Complex Types
Constants
Operators
Assignments
Arithmetic
Conditional
String
Bitwise
Unary
Compound
Ternary
Operator Precedence
Statements
If Statement
While Statement
Do Statement
Switch/Case/Default Statement
For Statement
Return Satement
Break Statement
Continue Statement
Function Arguments
PROGRAM DEBUGGING
The Trace Statement
Using the Write Function
LANGUAGE SYNTAX
Keywords
Syntax Description
Source file structure
subroutine
compound_statement
declaration
variable_list
statement
expression
argument_list
unary_expression
binary_expression
assignment_op
arithmetic_op
conditional_op
bitwise_op
string_op
compound_arithmetic_op
compound_bitwise_op
ternary_expression
constant
integer_constant
character
decimal
octal
hexadecimal
float_constant
string_constant
error_constant
array_constant
function
variable
symbol
FUNCTION SYNTAX
Standard Library Functions
 
atoi Convert a string into it decimal representation 
bsearch Search a sorted array
chdir Change working directory
date Generate a string representation of a date value. 
define Assign a value to a glossary variable. 
eval Evaluate a string as an expression 
fclose Close an opened file stream. 
feof Test for an end-of-file condition. 
fflush Write all buffered data from a file stream. 
fgetc Read a character from a file stream. 
fgets Read a string from a file stream. 
fopen Open a file stream for reading or writing. 
format Create a formatted string. 
fputc Write a character to a file stream. 
fputs Write a string to a file stream. 
free Free allocated dynamic memory.
fseek Reposition a file stream.
ftell Get the position of a file stream.
getcwd Get current working directory
getenv Return the value of an environment variable. 
gets Read a string from a file stream. 
glos_close Close a glossary file. 
glos_find Find a section in all opened glossary files.
glos_open Open a glossary file. 
glos_read Read a glossary file.
include Evalute the contents of a file.
index Find a substring within a string.
io Copy an entire file stream.
loadfileimage Read an entire file into dynamic memory.
malloc Allocates dynamic memory.
msg_close Close a message catalogue. 
msg_get Read message from a message catalogue. 
msg_open Open a message catalogue. 
parse Parse a string. 
putenv Change or add an environment variable.
qsort Sort an array
rand Random number generator.
read Read a variable from a file stream. 
rewind Reposition to the start of a file stream. 
sizeof Obtain the size of an element. 
srand Random number generator.
strcmp_wild Find a wild card within a string. 
strlen Calculate the length of a string.
strlower Convert a string to upper and lower case.
strstr_case Search for a substring within a string.
substr Extract part of a string. 
system Execute a shell command. 
time Return system time in seconds. 
tmpfile Create a temporary file
tolower Convert a string to lower case.
toupper Convert a string to upper case.
trim Strip leading and trailing space.
unlink Unlink (remove) a file. 
write Write a list of variables into a file. 
Unix Library Functions
 
alarm Set an interval timer 
dclose Close a character special device file. 
dopen Open a character special device file. 
exit Force termination and exit from the program. 
fork Create a new process. 
getpid Get ID of the calling process. 
glos_exec Execute a shell script held in a glossary file.
kill Send a signal to a process or process group. 
link Make a new name for a file
nice Change priority of the calling process. 
pclose Close an interprocess pipe stream. 
popen Open an interprocess pipe stream.
sleep Suspend execution for an interval. 
termio Set terminal interface settings. 
ISAM Library Functions
 
glosdump Dump a glossary entry to a file. 
isclose Close an ISAM file. 
isdelcurr Delete the current record. 
isdelete Delete a specific record. 
isfield Identify a field by name.
isopen Open an ISAM data file. 
ispop Restore prior file postion
ispush Save the current file postion
isread Read a record from an ISAM data file. 
isrewcurr Rewrite the current record. 
isrewrite Rewrite a specific record. 
issetunique Set a unique identifier. 
isstart Select and index and locate a record. 
isuniqueid Return a unique identifier 
iswrite Write a new record. 
DATA BASE SCHEMAS
Name and Address Data Table
Address Broadcast Groups
User Details and Preferences
User groups
Prepared G3 Files
Outgoing Fax Routing Table
Tariff Table
Outgoing Fax Retry Schedule
Modem Device Definition
Printer Device Definition
Inbound Fax Routing Table
Fax Activity/History