Changes between Version 43 and Version 44 of Submitting/C


Ignore:
Timestamp:
06/21/14 04:49:14 (11 years ago)
Author:
martinl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Submitting/C

    v43 v44  
    5757    The copyright protects your rights according to GNU General Public
    5858    License (http://www.gnu.org).
    59 
    60 
    61 4.  We don't want the `$ID$` in source code any more as it causes problems
    62 for the SVN branches.
    6359
    6460
     
    201197
    202198
    203 14. PLEASE take the time to add comments throughout your code explaining what the code is doing. It will save a HUGE amount of time and frustration for other programmers that may have to change your code in the future.
    204 
    205 
    20619915. To promote a consistent coding style, please use the "indent" program on all new C modules using the following switches:
    207200{{{
     
    232225
    233226
    234 18. Make sure a new line is at the end of each file and UNIX style newlines are used (`\n`).
    235 
    236 
    237 19. When writing Makefiles, use the current standard.
    238 
    239     If you have to use commands, please check for:
    240 {{{   
    241             avoid     | use instead
    242     ------------------+---------------
    243     make target       | $(MAKE) target
    244     mkdir target      | $(MKDIR) target
    245     cp  (executable)  | $(INSTALL) -m 755 file target
    246     cp  (normal file) | $(INSTALL) -m 644 file target
    247     ar                | $(AR)
    248 }}}
    249     `rm`: be VERY careful with recursive remove. Also beware of
    250     removing $(FOO)* if $(FOO) has any chance of being empty.
    251 
    252     Examples: see below examples or others[[BR]]
    253               source:grass/trunk/raster/r.info/Makefile [[BR]]
    254               source:grass/trunk/vector/v.edit/Makefile
    255 
    256     If you are unsure, please ask on the GRASS Developers list.
    257 
    258    
    259 20. Have a look at source:grass/trunk/INSTALL
    260 
    261 
    26222721. Have a function included in your module which writes to the history file of the map (e.g. command line, parameters etc.). See e.g. source:grass/trunk/raster/r.patch/main.c (the same applies to vector and raster3d modules!)
    263228
     
    272237}}}
    273238
    274 24. For consistency, use `README` rather than `README.txt` for any `README` files.
    275 
    276 
    277 25. GRASS/Environment variables:
    278    If you add a new variable, please follow the naming convention. All variables are described in source:grass/trunk/lib/init/variables.html
    279 
    280 
    281 26. Be sure to develop on top of the LATEST GRASS code (which is in our SVN repository). You can re-check before submission with `svn diff`:
    282 
    283     Be sure to create unified (`diff -u`) format. "Plain" diffs (the default format) are risky, because they will apply without warning to code which has been substantially changed; they are also harder to read than unified.
    284 
    285     Such diffs should be made from the top-level directory, e.g. `svn diff display/d.vect/main.c`; that way, the diff will include the pathname rather than just an ambiguous `main.c`.
    286 
    287 
    288 27. Try to use module names which describe shortly the intended purpose of the module.
    289 
    290     The first letters for module name should be:
    291 {{{
    292         d.      - display commands
    293         db.     - database commands
    294         g.      - general GIS management commands
    295         i.      - imagery commands
    296         m.      - miscellaneous tool commands
    297         ps.     - postscript commands
    298         r.      - raster commands
    299         r3.     - raster3D commands
    300         v.      - vector commands
    301 }}}
    302     Some additional naming conventions
    303     * export modules:     (type).out.(format) eg: `r.out.arc`, `v.out.ascii`
    304     * import module:      (type).in.(format)  eg: `r.in.arc`, `v.in.ascii`
    305     * conversion modules: (type).to.(type)    eg: `r.to.vect`, `v.to.rast`, `r3.to.rast`
    306 
    307     Avoid module names with more than two dots in the name.
    308     Example: instead of `r.to.rast3.elev` use `r.to.rast3elev`   
    309 
    310 
    311 28. Use the grass test suite to test your modules.
    312 
    313     http://www-pool.math.tu-berlin.de/~soeren/grass/GRASS_TestSuite
    314 
    315     You can easily write specific tests for your modules.
    316 
    317     If your module is part of GRASS and you created some standard test cases, please contact the developers to add your tests to the default test suite.  This will automatize complex test scenarios and assure to find bugs much faster, if changes were made to your modules or to the grass library.
    318 
    319     Consider to subscribe to the GRASS Quality Assessment System to get immediate notification about the code quality:
    320 
    321     http://lists.osgeo.org/mailman/listinfo/grass-qa
    322 
    323 
    324 29. When submitting new files to the repository set SVN properties,
    325     usually for directory
    326 {{{
    327       svn:ignore : *.tmp.html
    328                    *OBJ*
    329 }}}
    330     or e.g. for C-file
    331 {{{   
    332       svn:mime-type : text/x-csrc
    333       svn:keywords : Author Date Id
    334       svn:eol-style : native
    335 }}}
    336     See
    337     http://svnbook.red-bean.com/en/1.4/svn.advanced.props.html
    338 
    339     To set a property:
    340 {{{
    341       svn propset svn:keywords 'Author Date Id' <file>
    342       svn propset svn:mime-type text/x-sh grass_shellscript.sh
    343 }}}
    344     To edit the `svn:ignore` property using your default text editor:
    345 {{{
    346       svn propedit svn:ignore <directory>
    347 }}}
    348     To set the `svn:ignore` property non-interactively, first create a file containing the value:
    349 {{{
    350       echo "*.tmp.html" > ignore.txt
    351       echo "*OBJ*" >> ignore.txt
    352 }}}
    353     then use:
    354 {{{
    355       svn propset -F ignore.txt svn:ignore <directory>
    356 }}}
    357     List of mime-type:
    358 {{{
    359       C++ files (.cpp): text/x-c++src
    360       C files (.c): text/x-csrc
    361       DTD files (.dtd): text/xml-dtd
    362       GIF files (.gif): image/gif
    363       Header files (.h): text/x-chdr
    364       HTML files (.html): text/html
    365       JPEG files (.jpg): image/jpeg
    366       Makefiles: text/x-makefile
    367       PNG files (.png): image/png
    368       Python files (.py): text/x-python
    369       Shell scripts (.sh): text/x-sh
    370       Text files (.txt): text/plain
    371       XML files (.xml): text/xml
    372 }}}
    373       (please update the list...)
    374 
    375     For your convenience use the source:grass-addons/tools/module_svn_propset.sh script.
    376239
    37724030. Use doxygen style for source code documentation. It is required for GRASS libraries, but also recommended for GRASS modules.
     
    412275}}}
    413276
    414 31. If you need to add support for a different library in the 'configure' script, you should first seek consent in the grass-dev mailing list (see below), then you need to expand 'configure.in' and run subsequently `autoconf-2.13` (later versions will not work) to re-generate 'configure'.
    415 
    416 32. Tell the other developers about the new code using the following e-mail:
    417     grass-dev@lists.osgeo.org
    418  
    419     To subscribe to this mailing list, see
    420     http://lists.osgeo.org/mailman/listinfo/grass-dev
    421 
    422 
    423 33. In case of questions feel free to contact the developers at the above mailing list.[[BR]]
    424     http://grass.osgeo.org/development/
    425 
    426277...
    427278