2
schedule_accept(int fd, int (*handler)(int, FdEventHandlerPtr, AcceptRequestPtr), void *data) 

Apologies for seeming to avoid searching for an answer here but I don't know what the constructs are in order to search intelligently for them. Specifically I'm interested in what the second parameter means?

My best guess is it's an int (that refers to a memory location) that is composed(?) of a tuple of the three referred to types. Is this correct? If I was only interested in one of these (and I'm right in my description in the first place) how would I refer to it?

3
  • 3
    It looks like it might be a function pointer with the three types being the parameters. Commented Nov 5, 2016 at 21:56
  • 1
    A good tool to use in interpreting complex declarations is "cdecl". Commented Nov 5, 2016 at 22:34
  • Pointer to a function returning int and taking three parameters, the first being int, the second being of type FdEventHandlerPtr, and the third being AcceptRequestPtr. For more information you need the actual definitions of types for the second and third parameters. Commented Nov 7, 2016 at 7:55

1 Answer 1

5
int (*handler)(int, FdEventHandlerPtr, AcceptRequestPtr) 

Defines a parameter named handler which is a pointer (hence the *) to a function, which returns an int (hence the "outer" int) and takes three arguments, namely one int, one FdEventHandlerPtr and one AcceptRequestPtr.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.