E Portability

 E.1 Overview
 E.2 Coding and porting prerequisites
 E.3 Operating system specific routines

E.1 Overview

This section discusses the portability of CHR, including the coding standard adopted for CHR and a list of those routines which may need to be modified when porting CHR to a new target machine.

E.2 Coding and porting prerequisites

The standard of Fortran used for the coding of CHR is fundamentally Fortran 77, using the Starlink Fortran coding conventions described in SGP/16. Several common extensions to the Fortran 77 standard are used in source code for CHR, they are as follows:

The CHR library currently has no dependence upon any other package. To use CHR on any computer system porting effort is required only for those CHR routines which have operating system dependencies: these routines are listed in the following section.

E.3 Operating system specific routines

Several CHR routines make use of features specific to the operating system or language implementation. The names of these routines and their purpose are as follows:

CHR_ACHR
– Return the character for a given ASCII value.
CHR_ATOK
– Return the character for a given ASCII character token.
CHR_ATOM
– Translate a string from ASCII to machine’s character set.
CHR_BTOI
– Read an INTEGER value from a binary string.
CHR_HTOI
– Read an INTEGER value from a hexadecimal string.
CHR_IACHR
– Return the ASCII value for a given character.
CHR_ITOB
– Encode an INTEGER value as a binary string.
CHR_ITOH
– Encode an INTEGER value as a hexadecimal string.
CHR_ITOO
– Encode an INTEGER value as an octal string.
CHR_LOWER
– Return the lower case equivalent of a character.
CHR_MTOA
– Translate a string from machine’s character set to ASCII.
CHR_OTOI
– Read an integer from an octal string.
CHR_UPPER
– Return the upper-case equivalent of a character.

These routines may have to be rewritten specifically for each new operating system and Fortran implementation.