Move src/doc/coding-style.txt to HACKING and update the contents.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2693 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-08-22 23:43:56 +00:00
parent 34746c6ebf
commit 7387840c76
7 changed files with 71 additions and 62 deletions

64
HACKING Normal file
View File

@ -0,0 +1,64 @@
Hacking Guidelines
==================
This document is an introduction to hacking on GnuCash.
Related Documents
-----------------
In addition to this file, you should read the README file, which
explains the details of getting the CVS source, building GnuCash,
and creating patches for submission.
The src/doc/design directory contains a preliminary design document
which you should read as well. You should also feel free to hack on
the design document.
Coding Style Conventions
------------------------
General:
* When modifying a file, the style convention in that file should be
followed.
* When creating a new file, the style of existing files should be
followed.
* When creating lots of new files in a new directory, use the GNU
* Do not submit patches that consist of (gratuitous) stylistic changes.
C:
* Use ISO C.
* Use glib memory routines where possible. This means you should be
using g_malloc(), g_new(), g_free(), etc., instead of malloc(),
free(), etc. Do not mix glib memory calls with libc calls!
* All gnucash functions and global variables are prefixed with gnc_
* All private functions are enclosed in __ (i.e. _gnc_do_not_call_)
* Use static functions whenever possible
* Use const whenever possible
Scheme:
* All gnucash functions and global variables are prefixed with gnc:
* All global variables are enclosed in ** (i.e. gnc:*load-path*)
* All private functions are enclosed in __ (i.e. gnc:_do-not-call_)
* All C functions wrapped with g-wrap have dashes in place of underscores.
(xaccSplitGetBalance --> gnc:split-get-balance).
Dave Peticolas <dave@krondo.com>
August 22, 2000

View File

@ -9,6 +9,7 @@ doc_DATA = \
AUTHORS \ AUTHORS \
COPYING \ COPYING \
ChangeLog \ ChangeLog \
HACKING \
INSTALL \ INSTALL \
NEWS \ NEWS \
README README

View File

@ -121,7 +121,7 @@ docdir = ${GNC_DOC_INSTALL_DIR}
noinst_DATA = make-gnucash-patch noinst_DATA = make-gnucash-patch
doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README doc_DATA = AUTHORS COPYING ChangeLog HACKING INSTALL NEWS README
# All the other files that go in the distribution tarfile that aren't # All the other files that go in the distribution tarfile that aren't

View File

@ -53,5 +53,5 @@ rm -rf $RPM_BUILD_ROOT
/usr/man/man1/gnucash.1 /usr/man/man1/gnucash.1
/usr/man/man1/gnc-prices.1 /usr/man/man1/gnc-prices.1
%config /etc/gnucash %config /etc/gnucash
%doc AUTHORS COPYING ChangeLog NEWS README %doc AUTHORS COPYING ChangeLog HACKING NEWS README
%doc doc/README.german doc/README.francais doc/guile-hackers.txt %doc doc/README.german doc/README.francais doc/guile-hackers.txt

View File

@ -5,6 +5,8 @@ SUBDIRS = \
EXTRA_DIST = \ EXTRA_DIST = \
backup.txt \ backup.txt \
budget.txt \ budget.txt \
coding-style.txt \ constderv.html \
finderv.html \
finutil.html \
plugin.txt \ plugin.txt \
tax.txt tax.txt

View File

@ -118,7 +118,7 @@ l = @l@
SUBDIRS = design SUBDIRS = design
EXTRA_DIST = backup.txt budget.txt coding-style.txt plugin.txt tax.txt EXTRA_DIST = backup.txt budget.txt constderv.html finderv.html finutil.html plugin.txt tax.txt
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h CONFIG_HEADER = ../../config.h

View File

@ -1,58 +0,0 @@
Coding Style Conventions
------------------------
I have a headache at the moment, which is probably the ideal state of mind to
be in when approaching such discussions. My personal experience is that no
single style will satisfy everyone, and the discussions will resume no matter
how often they are put to bed.
So here is the law:
1) when modifying a file, the style convention in that file must be
followed.
2) when creating a new file, the style of the existing files must be
followed.
3) when creating eleven or more new files, you can invent your own coding
style. (As of this writing, this means that only Robin Clark, Robb
Browning, Jeremy Collins & Linas Vepstas get to pick a style).
I.E. when creating about 10% or more new code.
4) I won't accept diffs that consist of (gratuitous) stylistic changes.
I get to decide what "gratuitous" means.
5) I don't care about emacs control strings. I don't use emacs. See
rule 3 for additional info.
-- Linas Vepstas
17 August 1998
Things we actually do care about:
* Don't use dangling if clauses. i.e. don't do this...
if(x) {
foo();
bar();
} else
baz();
Rob's Style conventions (for anyone who cares):
Scheme:
* all gnucash functions and global variables are prefixed with gnc:
* all global variables are enclosed in ** (i.e. gnc:*load-path*)
* all private functions are enclosed in __ (i.e. gnc:_do-not-call_)
* all C functions exported via swig have underscores in place of dashes
C:
* all gnucash functions and global variables are prefixed with gnc_
* all private functions are enclosed in __ (i.e. _gnc_do_not_call_)
* use static functions whenever possible
* use const whenever possible