0

There is the following code declaration:

int (*oled_format)(unsigned short F_gfx, unsigned char* oled_data, size_t oled_len, ...);

used in situations such as below:

format_rc = display_port->dev->oled_format(cmd, oled_data, cmd_len, color);

What does this do? Clearly it returns an int, but there does not seem to be any function description outside of the header file.

Googling brought me to some C++ docs about explicit instantiation which are not very clear and sometimes vary syntactically: 1 , and 2

Cheetaiean
  • 629
  • 1
  • 5
  • 20

1 Answers1

0

It's the declaration of a function pointer.

For those who are interested, the following StackOverflow answer explains how C's function pointers work:

How do function pointers in C work?

jstedfast
  • 31,990
  • 5
  • 85
  • 101