如何使用 Doxygen 记录 mexFunction 参数?
How can I document mexFunction parameters with Doxygen?
每个 mexFunction 都有相同的原型:
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
我们可以像普通函数一样记录它:
void mexFunction(
int nlhs, /**< number of left hand arguments **/
mxArray *plhs[], /**< left hand arguments **/
int nrhs, /**< number of right hand arguments **/
const mxArray *prhs[] /**< right hand arguments **/
)
但这并没有告诉我们任何关于实际参数的信息。
有没有比记录为更好的选择:
/**
* \details
* inputs:
* prhs[0] - blah blah
* prhs[1] - blah
*
* outputs:
* plhs[0] - yadda yadda
**/
网络上发现的错误示例:
- http://fossies.org/dox/FreeMat-4.2-Source/levmar_8c_source.html
- http://fossies.org/dox/getfem-4.3/gfm__mex_8c_source.html
- http://doxygen.scilab.org/master_wg/d9/d6c/temptst_8cpp_source.html
没有找到很好的例子。
一个可能的解决方案,但是bullets的语法很挑剔,输出有很多多余的白色space(我可能还是会接受别人的解决方案):
void mexFunction(
int nlhs, /**< number of left hand arguments (3 expected) */
mxArray *plhs[], /**< left hand arguments, expected elements:
* - [0] - blah
* - [1] - blah blah blah blah, blah blah blah
blah blah
* - [2] - yadda yadda */
int nrhs, /**< number of right hand arguments (0 expected) */
const mxArray *prhs[] /**< right hand arguments (no elements expected) */
)
每个 mexFunction 都有相同的原型:
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
我们可以像普通函数一样记录它:
void mexFunction(
int nlhs, /**< number of left hand arguments **/
mxArray *plhs[], /**< left hand arguments **/
int nrhs, /**< number of right hand arguments **/
const mxArray *prhs[] /**< right hand arguments **/
)
但这并没有告诉我们任何关于实际参数的信息。
有没有比记录为更好的选择:
/**
* \details
* inputs:
* prhs[0] - blah blah
* prhs[1] - blah
*
* outputs:
* plhs[0] - yadda yadda
**/
网络上发现的错误示例:
- http://fossies.org/dox/FreeMat-4.2-Source/levmar_8c_source.html
- http://fossies.org/dox/getfem-4.3/gfm__mex_8c_source.html
- http://doxygen.scilab.org/master_wg/d9/d6c/temptst_8cpp_source.html
没有找到很好的例子。
一个可能的解决方案,但是bullets的语法很挑剔,输出有很多多余的白色space(我可能还是会接受别人的解决方案):
void mexFunction(
int nlhs, /**< number of left hand arguments (3 expected) */
mxArray *plhs[], /**< left hand arguments, expected elements:
* - [0] - blah
* - [1] - blah blah blah blah, blah blah blah
blah blah
* - [2] - yadda yadda */
int nrhs, /**< number of right hand arguments (0 expected) */
const mxArray *prhs[] /**< right hand arguments (no elements expected) */
)