jessevdk / cldoc

clang based documentation generator for C and C++
GNU General Public License v2.0
553 stars 59 forks source link

Support C variable arguments #123

Open ghost opened 7 years ago

ghost commented 7 years ago

Currently, the documentation doesn't include C varargs parameters (even in the type display of the function!). So things that work similar to printf can't be documented well. It'd be nice if it at least displayed the ... in the function type.

aremmell commented 6 years ago

I also need this to move forward. I am about 0 knowledgeable in Python, but I tried changing line 475 in comment.py to:

identifier = Word(alphas + '_' + '.', alphanums + '_' + '.')

and I tried adding another match:

va_identifier = Word('.', '.' exact=3)

but I don't know where to go from there. I've also tried --loglevel=debug but I don't seem to get any additional output on the terminal. Is there another log location?

I would really really like to use this tool, but I can't without this issue being resolved, as a good portion of my public functions are C vararg functions.

aremmell commented 6 years ago

I have also tried adding the following at line 154 of ctype.py:

self._is_variadic = canon.type.is_function_variadic()

but, I don't even know if this is correct, or where to go from there. I found the place in the JS for the dynamic site where function objects are examined, but I'm utterly lost in the XML->HTML generation phase.

@jessevdk please help!