I have a situation where I need to document the bsearch() signature in Doxygen. That signature looks like this:
void * __cdecl bsearch (
const void *key,
const void *base,
size_t num,
size_t width,
int(__cdecl *compare)(const void *, const void *)
)
The problem I am having is how to compose the @param command for the pointer *compare since Doxygen complains "argument 'compare' of command @param is not found in the argument list of bsearch" at everything I throw at it.
This is a standalone implementation, so it is not dependent on a library signature, however I am thinking if I did:
typedef int(__cdecl *pcompare)(const void *, const void *);
changing the signature to pcompare compare that callers using the standard signature would have a type problem.
I am open to ANY solution that allows me to document this without alarm from Doxygen.
however I am thinking if I did:
typedef int(__cdecl *pcompare)(const void *, const void *);changing the signature to
pcompare comparethat callers using the standard signature would have a type problem.
You should have tried it before giving up. typedef does not define a new type, it just creates a new identifier for a complex type. The resulting signatures are identical.
Be careful though, because neither of the forms shown are the correct signature. To declare A C runtime library function like bsearch you need extern "C". (and so would the function pointer typedef -- language linkage is part of the function type)
All of that said, just setting __cdecl as a predefined macro in your doxygen config would probably be sufficient to allow it to parse all of these variations, including the ones with a complex set of tokens specifying the parameter type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With