ADC Home > Reference Library > Technical Notes > Legacy Documents > Tools >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

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

CONTENTS

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

[Nov 01 1987]






"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.

Back to top

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)

Back to top

References

MPW C Manual

Using Assembly Language

The C Programming Language, Kernighan & Ritchie

M.PT.CFuncArgs

Using Strings or Points as Arguments

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (56K).

Download



Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.