Carbon


Calling Convention Constants

Header: MixedMode.h

enum {
    kPascalStackBased = 0,
    kCStackBased = 1,
    kRegisterBased = 2,
    kD0DispatchedPascalStackBased = 8,
    kD1DispatchedPascalStackBased = 12,
    kD0DispatchedCStackBased = 9,
    kStackDispatchedPascalStackBased = 14,
    kThinkCStackBased = 5
};

Constant descriptions

kPascalStackBased

The routine follows normal Pascal calling conventions.

kCStackBased

The routine follows the C calling conventions employed by the MPW development environment.

kRegisterBased

The parameters are passed in registers.

kD0DispatchedPascalStackBased

The parameters are passed on the stack according to Pascal conventions, and the routine selector is passed in register D0.

kD1DispatchedPascalStackBased

The parameters are passed on the stack according to Pascal conventions, and the routine selector is passed in register D1.

kD0DispatchedCStackBased

The parameters are passed on the stack according to C conventions, and the routine selector is passed in register D0.

kStackDispatchedPascalStackBased

The routine selector and the parameters are passed on the stack.

kThinkCStackBased

The routine follows the C calling conventions employed by the THINK C software development environment. Arguments are passed on the stack from right to left, and a result is returned in register D0. All arguments occupy an even number of bytes on the stack. An argument having the size of a char is passed in the high-order byte. You should always provide function prototypes; failure to do so may cause THINK C to generate code that is incompatible with this parameter-passing convention.

These constants are used by the ProcInfoType type to specify a routine’s calling conventions.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)