From 7387840c76baa6b9b21cea3aee3d079ef688758a Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Tue, 22 Aug 2000 23:43:56 +0000 Subject: [PATCH] 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 --- HACKING | 64 ++++++++++++++++++++++++++++++++++++++++ Makefile.am | 1 + Makefile.in | 2 +- rpm/gnucash.spec.in | 2 +- src/doc/Makefile.am | 4 ++- src/doc/Makefile.in | 2 +- src/doc/coding-style.txt | 58 ------------------------------------ 7 files changed, 71 insertions(+), 62 deletions(-) create mode 100644 HACKING delete mode 100644 src/doc/coding-style.txt diff --git a/HACKING b/HACKING new file mode 100644 index 0000000000..0d5382c21c --- /dev/null +++ b/HACKING @@ -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 +August 22, 2000 diff --git a/Makefile.am b/Makefile.am index eba690c879..83fccd3030 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,6 +9,7 @@ doc_DATA = \ AUTHORS \ COPYING \ ChangeLog \ + HACKING \ INSTALL \ NEWS \ README diff --git a/Makefile.in b/Makefile.in index c354092feb..c25cf51493 100644 --- a/Makefile.in +++ b/Makefile.in @@ -121,7 +121,7 @@ docdir = ${GNC_DOC_INSTALL_DIR} 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 diff --git a/rpm/gnucash.spec.in b/rpm/gnucash.spec.in index 8d3e7f0bce..347b2db5bb 100644 --- a/rpm/gnucash.spec.in +++ b/rpm/gnucash.spec.in @@ -53,5 +53,5 @@ rm -rf $RPM_BUILD_ROOT /usr/man/man1/gnucash.1 /usr/man/man1/gnc-prices.1 %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 diff --git a/src/doc/Makefile.am b/src/doc/Makefile.am index 907e9b93e7..5d40a01f3b 100644 --- a/src/doc/Makefile.am +++ b/src/doc/Makefile.am @@ -5,6 +5,8 @@ SUBDIRS = \ EXTRA_DIST = \ backup.txt \ budget.txt \ - coding-style.txt \ + constderv.html \ + finderv.html \ + finutil.html \ plugin.txt \ tax.txt diff --git a/src/doc/Makefile.in b/src/doc/Makefile.in index 204caf0f0d..6191bd3fe2 100644 --- a/src/doc/Makefile.in +++ b/src/doc/Makefile.in @@ -118,7 +118,7 @@ l = @l@ 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 CONFIG_HEADER = ../../config.h diff --git a/src/doc/coding-style.txt b/src/doc/coding-style.txt deleted file mode 100644 index 475c61ab2d..0000000000 --- a/src/doc/coding-style.txt +++ /dev/null @@ -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