MPW C Functions: To declare or not to declare, that is the question.

Technote PT 05November 1987

Revised by: March 1988
Written by: Fred A. Huxham November 1987

Here's the low-down on when C functions need not be declared in include files.

"The include files are all screwed up!"

This is a common misconception people have when they look through the MPW C include files. People report that the declaration of a ROM or system call foo() has been mistakenly left out of this or that include file. Here's the low-down on when functions do not have to be declared in an include file.

The Law

A C function does not need to be declared in an include file if it requires glue code and returns a short or long integer as a result.

Routines that require glue code include:

* All routines that are marked [Not in ROM] in Inside Macintosh

* All register based routines (Operating System routines)

* All routines which have strings or points as arguments (and have mixed case spellings)

Further Reference:

Previous Technote | Contents | Next Technote