Interface GET_STRUCT

Preprocessor macro expanding to an expression

SpaceUser/kernel
ContextSync/async/rt-irq
May blockNo
SPLAny
Dynamic memoryNo

#include <SPAD/AC.H>

p = GET_STRUCT(ptr, type, member);

Description

This macro converts a pointer to the member of a structure to a pointer to the structure.

This macro is often used in ASTs — in AST handler we receive a pointer to the AST being posted and we need a pointer to the structure containing the AST. GET_STRUCT is usually one of the first commands in the AST handler.

Arguments

Returns

Pointer to the whole structure.

See also

LIST_STRUCT