User`s guide
Including M-File Information in Compiler Output
5-41
Comments Annotation
To include only comments from the source M-file in the generated output, use
mcc -A annotation:comments
This code snippet shows the generated code containing only the comments
(“
This is the hello ...”) in the middle of the routine:
static void Mhello(void) {
mclMlineEnterFunction("D:\\work\\hello.m", "hello")
mexLocalFunctionTable save_local_function_table_
= mclSetCurrentLocalFunctionTable(&_local_function_table_hello);
mxArray * ans = NULL;
/*
* This is the hello, world function written in M code
*/
mclMline(3);
mclAssignAns(
&ans,
mlfNFprintf(0, mlfScalar(1), mxCreateString("Hello, World\\n"), NULL));
mxDestroyArray(ans);
mclSetCurrentLocalFunctionTable(save_local_function_table_);
mclMlineExitFunction();
}
All Annotation
To include both comments and source code from the source M-file in the
generated output, use
mcc -A annotation:all
or do not stipulate the annotation option, thus using the default of all.
This code snippet contains both comments and source code:
static void Mhello(void) {
mclMlineEnterFunction("D:\\work\\hello.m", "hello")
mexLocalFunctionTable save_local_function_table_
= mclSetCurrentLocalFunctionTable(&_local_function_table_hello);
mxArray * ans = NULL;
/*
* % This is the hello, world function written in M code
* fprintf(1,'Hello, World\n' );
*/
mclMline(3);
mclAssignAns(
&ans,
mlfNFprintf(0, mlfScalar(1), mxCreateString("Hello, World\\n"), NULL));