[Doxygen-users] Preprocessor templates
Brought to you by:
dimitri
From: byron.hawkins <by...@ha...> - 2014-03-12 00:14:14
|
I'm trying to generate docs for a simple vector in C, which uses preprocessor statements to simulate a C++ template. It's not possible to use C++ because the vector is used in an in-process virtualization layer that is written in C, and also it is required to use the heap in very restricted ways. The vector's init() function looks like: bool VECTOR_NAME(,NAME_KEY,_init)(VECTOR_TYPE *vec, uint initial_capacity, bool synch _IF_ELEMENT_POINTER(, void (*free_data_func)(ELEMENT_TYPE)) _IF_SORTED(, int (*comparator)(ELEMENT_TYPE, COMPARISON_TYPE))); All the tokens in capitals are defined by the client module above the `#include`, so for example a client source file might have: #define NAME_KEY account_vector #define ELEMENT_TYPE account_t* #define COMPARISON_TYPE unsigned int #define SORTED 1 #include "tvectorx.h" This would generate a function: bool account_vector_init(account_vector_t *vec, unsigned int initial_capacity, bool synch, void (*free_data_func)(account_t*), int (*comparator)(account_t*, unsigned int)); Not surprisingly, doxygen is not able to parse all the preprocessor stuff. It comes out like this in the html: bool tvector_init (VECTOR_NAME(, NAME_KEY, _t)*vec, uint initial_capacity, bool synch, void(*free_data_func)(void *), int(*comparator)(void *, VECTOR_COMPARISON_TYPE)) (Some default substitutions have been made.) Is there a way to just override the doxygen function declaration with a plain string, so that doxygen displays the string instead of what it would normally parse out of the code? Thanks for your help. -- View this message in context: http://doxygen.10944.n7.nabble.com/Preprocessor-templates-tp6540.html Sent from the Doxygen - Users mailing list archive at Nabble.com. |