Doxygen example

Originally committed as revision 3316 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer
2004-07-15 12:54:38 +00:00
parent a708785f2e
commit f4888b830f

View File

@@ -987,11 +987,39 @@ Main priority in ffmpeg is simplicity and small code size (=less
bugs).
Comments: use the JavaDoc/Doxygen
format (see examples in @file{libavformat/utils.c}) so that a documentation
format (see examples below) so that a documentation
can be generated automatically. All non trivial functions should have a comment
above it explaining what the function does, even if its just one sentance.
All Structures and their member variables should be documented too.
@example
/**
<EFBFBD>* @file mpeg.c
<EFBFBD>* mpeg codec.
<EFBFBD>* @author ...
<EFBFBD>*/
/**
<EFBFBD>* Summary sentance.
<EFBFBD>* more text ...
<EFBFBD>* ...
<EFBFBD>*/
typedef struct Foobar{
<EFBFBD> <20> int var1; /**< var1 description */
<EFBFBD> <20> int var2; ///< var2 description
<EFBFBD> <20> /** var3 description */
<EFBFBD> <20> int var3;
} Foobar;
/**
<EFBFBD>* Summary sentance.
<EFBFBD>* more text ...
<EFBFBD>* ...
<EFBFBD>* @param my_parameter description of my_parameter
<EFBFBD>* @return return value description
<EFBFBD>*/
int myfunc(int my_parameter)
...
@end example
fprintf and printf are forbidden in libavformat and libavcodec,
please use av_log() instead.