14

SUN/7.6

Starlink Project
Starlink User Note 7.6

S M Beard
P M Allan
Malcolm J. Currie
Peter W. Draper
David Berry

2020 Feb 12


GENERIC — A Utility for Preprocessing Generic
Fortran and C Subroutines

1.4

User’s Guide



Abstract

GENERIC is tool for Fortran 77 and C developers to create type-specific code from a generic source that includes tokens for type-dependent elements. This saves effort supporting multiple versions of the source code.

Contents

1 Introduction
2 GENERIC Fortran Subroutines—an Example
 2.1 Using the GENERIC utilty to process generic C files
3 Generic C programming
4 Features of the GENERIC Utility
 4.1 The KERNEL Tokens
 4.2 The ASTERIX Tokens
 4.3 The Local CHARACTER Size
 4.4 The Fortran Maximum Record Length
5 Using the GENERIC Utility
6 Data Type Conversions—the DCV Routines
 6.1 Introduction
 6.2 An Example of Data Type Conversion
 6.3 Range Checking
A A Full Table of F77 Token Translations
B A Full List of Conversion Functions
A C Token Translations