cgccsyntaxueficompiler-specific

Can you explain this C definition from efilib.h?


I'm learning UEFI programming and I notice that many of the EFI header files show chunks with this syntax I can't understand:

typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_STRING) (
    IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
    IN CHAR16 *String
);

Solution

  • It is a simple typdef for a function pointer. Type EFI_TEXT_STRING is a pointer to a function that takes a pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL as its first argument and a pointer to CHAR16 as its second argument. The function returns type EFI_STATUS.