]> git.sesse.net Git - ffmpeg/blobdiff - doc/developer.texi
RELEASE_NOTES: mention some notable API changes in 0.8
[ffmpeg] / doc / developer.texi
index a63bea746c823abbfabb5e99869da2f0eb8e9d2c..046743fd62d2412d6ef2f9d16de4423968ed83ad 100644 (file)
@@ -49,7 +49,7 @@ mailing list.
 The code is written in K&R C style. That means the following:
 @itemize @bullet
 @item
-The control statements are formatted by putting space betwen the statement
+The control statements are formatted by putting space between the statement
 and parenthesis in the following way:
 @example
 for (i = 0; i < filter->input_count; i++) @{
@@ -79,7 +79,7 @@ if (!pic || !picref)
     goto fail;
 @end example
 @item
-Do not put spaces immediately inside parenthesis. @samp{if (ret)} is
+Do not put spaces immediately inside parentheses. @samp{if (ret)} is
 a valid style; @samp{if ( ret )} is not.
 @end itemize
 
@@ -105,6 +105,11 @@ Use the JavaDoc/Doxygen  format (see examples below) so that code documentation
 can be generated automatically. All nontrivial functions should have a comment
 above them explaining what the function does, even if it is just one sentence.
 All structures and their member variables should be documented, too.
+
+Avoid Qt-style and similar Doxygen syntax with @code{!} in it, i.e. replace
+@code{//!} with @code{///} and similar.  Also @@ syntax should be employed
+for markup commands, i.e. use @code{@@param} and not @code{\param}.
+
 @example
 /**
  * @@file
@@ -202,6 +207,31 @@ Casts should be used only when necessary. Unneeded parentheses
 should also be avoided if they don't make the code easier to understand.
 @end itemize
 
+@subsection Editor configuration
+In order to configure Vim to follow Libav formatting conventions, paste
+the following snippet into your @file{.vimrc}:
+@example
+" indentation rules for libav: 4 spaces, no tabs
+set expandtab
+set shiftwidth=4
+set softtabstop=4
+" allow tabs in Makefiles
+autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=8
+" Trailing whitespace and tabs are forbidden, so highlight them.
+highlight ForbiddenWhitespace ctermbg=red guibg=red
+match ForbiddenWhitespace /\s\+$\|\t/
+" Do not highlight spaces at the end of line while typing on that line.
+autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
+@end example
+
+For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
+@example
+(setq c-default-style "k&r")
+(setq-default c-basic-offset 4)
+(setq-default indent-tabs-mode nil)
+(setq-default show-trailing-whitespace t)
+@end example
+
 @section Development Policy
 
 @enumerate
@@ -484,6 +514,6 @@ Improvements to codec or demuxer might change the FATE results. Make sure
 to commit the update reference with the change and to explain in the comment
 why the expected result changed.
 
-Please refer to @file{doc/fate.txt}.
+Please refer to @url{fate.html}.
 
 @bye