HP Pascal/iX Programmer's Guide (31502-90023)

10-: 1
Chapter 10 Intrinsics
An
intrinsic
is an external routine that can be called by a program
written in any language that the operating system supports. An intrinsic
can be written in any supported language, but its formal parameters must
be of types that have counterparts in the other supported languages.
An intrinsic definition resides in an intrinsic file (though its code
resides in a library). You can use existing intrinsics as they are,
modify them, or define new intrinsics. You can put new intrinsics in new
or existing intrinsic files and libraries. Your program can access any
intrinsic by declaring it and specifying the intrinsic file that defines
it.
This chapter:
* Explains how your program can use intrinsics.
* Tells you how to define an intrinsic.
* Tells you how to build or change an intrinsic file.
Using Intrinsics
To use an intrinsic, your program must specify the intrinsic file in
which its definition resides and declare the intrinsic with the
INTRINSIC directive. How your program can declare the intrinsic as a
routine--specifying all, part, or none of its formal parameters--depends
upon its definition in the intrinsic file.
This section explains:
* How to specify intrinsic files.
* How to declare an intrinsic with the INTRINSIC directive.
* Actual and intrinsic parameter compatibility.
* How to declare formal function types for an intrinsic.
* How to declare formal parameters for an intrinsic to ensure
stricter type checking for actual parameters.
* How to use an intrinsic function as a procedure.
Specifying Intrinsic Files
When compiling a program that references an intrinsic, the compiler reads
the intrinsic definition from an intrinsic file. The intrinsic file can
be the default intrinsic file for the system, or it can be one that you
or another programmer built (see "How to Build or Change an Intrinsic
File" ). The program can specify different intrinsic files for
different intrinsics.
The SYSINTR compiler option determines the intrinsic file. If the
program does not contain a SYSINTR option, or if the SYSINTR option does
not specify a file name, the compiler reads intrinsic definitions
from the default intrinsic file. (The default intrinsic file is
system-dependent. See Appendix A for the MPE/iX operating system;
Appendix B for the HP-UX operating system.) Otherwise, the compiler
reads intrinsic definitions from the file that the SYSINTR option
specifies, until another SYSINTR option specifies another file. (See the
HP Pascal/iX Reference Manual
or the
HP Pascal/HP-UX Reference Manual
,
depending on your implementation, for more information on the SYSINTR