Work on copying splits. Fixed account ordering bug.

Added Copyright notices to some scm files.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2290 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-05-10 09:32:00 +00:00
parent 836fd9b233
commit afbe9e9f0d
31 changed files with 666 additions and 49 deletions

View File

@ -26,6 +26,7 @@ INCLPATH = -I. \
-I./engine \
-I./engine/guid \
-I./register \
-I./guile \
-Ireports \
-I@prefix@/lib/glib/include \
-I@prefix@/include
@ -33,7 +34,7 @@ INCLPATH = -I. \
GNOME_CFLAGS += -I./gnome
MOTIF_CFLAGS += -I./motif
CFLAGS = @CFLAGS@ @X_CFLAGS@ ${INCLPATH} ${CPPFLAGS}
CFLAGS = @CFLAGS@ @X_CFLAGS@ ${INCLPATH} ${CPPFLAGS} ${GUILE_COMPILE_ARGS} ${G_WRAP_COMPILE_ARGS}
######################################################################
# See Makefile.common for information about these variables.

View File

@ -99,6 +99,7 @@
#include <stdio.h>
#include <time.h>
#include <guile/gh.h>
#include "top-level.h"
@ -109,6 +110,7 @@
#include "Refresh.h"
#include "splitreg.h"
#include "table-allgui.h"
#include "guile-util.h"
#include "messages.h"
#include "util.h"
@ -180,6 +182,10 @@ static char account_separator = ':';
/* The reverse balance callback, if any. */
static SRReverseBalanceCallback reverse_balance = NULL;
/* The copied split or transaction, if any */
static SCM copied_item = SCM_UNDEFINED;
static SCM copied_item_id = SCM_UNDEFINED;
/* static prototypes */
static void xaccSRLoadRegEntry (SplitRegister *reg, Split *split);
static Transaction * xaccSRGetTrans (SplitRegister *reg,
@ -276,24 +282,25 @@ xaccSRSetReverseBalanceCallback(SRReverseBalanceCallback callback)
* doesn't copy reconciled flag, or open the parent transactions
* for editing. Does *not* insert the 'to' split into an account!! */
static void
gnc_copy_split(Split *from, Split *to)
gnc_copy_split_onto_split(Split *from, Split *to)
{
SCM split_scm;
if ((from == NULL) || (to == NULL))
return;
xaccSplitSetMemo(to, xaccSplitGetMemo(from));
xaccSplitSetAction(to, xaccSplitGetAction(from));
xaccSplitSetDocref(to, xaccSplitGetDocref(from));
xaccSplitSetSharePriceAndAmount(to,
xaccSplitGetSharePrice(from),
xaccSplitGetShareAmount(from));
split_scm = gnc_copy_split(from);
if (split_scm == SCM_UNDEFINED)
return;
gnc_copy_split_scm_onto_split(split_scm, to);
}
/* copies the basic transaction values and the splits from the
* 'from' trans to the 'to' trans. Any existing splits in the
* 'to' trans are deleted. Does *not* open the 'to' trans for
* editing!!! Splits are copied using gnc_copy_split above.
* The new splits will be in exactly the same order as in
* editing!!! Splits are copied using gnc_copy_split_onto_split
* above. The new splits will be in exactly the same order as in
* the 'from' transaction. */
static void
gnc_copy_trans(Transaction *from, Transaction *to)
@ -321,7 +328,7 @@ gnc_copy_trans(Transaction *from, Transaction *to)
from_split = xaccTransGetSplit(from, i);
to_split = xaccMallocSplit();
gnc_copy_split(from_split, to_split);
gnc_copy_split_onto_split(from_split, to_split);
xaccTransAppendSplit(to, to_split);
}
@ -862,7 +869,7 @@ xaccSRDuplicateCurrent (SplitRegister *reg)
new_split = xaccMallocSplit();
gnc_copy_split(split, new_split);
gnc_copy_split_onto_split(split, new_split);
account = xaccSplitGetAccount(split);

View File

@ -104,7 +104,7 @@ id_compare(gconstpointer key_1, gconstpointer key_2)
return memcmp(key_1, key_2, sizeof(GUID)) == 0;
}
#ifdef USE_DEBUG
#if GNCID_DEBUG
static void
print_node(gpointer key, gpointer value, gpointer not_used)
{
@ -135,7 +135,7 @@ entity_table_init()
xaccStoreEntity(NULL, xaccGUIDNULL(), GNC_ID_NULL);
#ifdef USE_DEBUG
#if GNCID_DEBUG
atexit(summarize_table);
#endif
}

View File

@ -38,6 +38,7 @@
#include "Group.h"
#include "Query.h"
#if 0
static void
print_query(Query * q) {
GList * aterms;
@ -60,7 +61,7 @@ print_query(Query * q) {
}
printf("\n");
}
#endif
/********************************************************************
* xaccMallocQuery
@ -82,7 +83,7 @@ void
xaccInitQuery(Query * q, QueryTerm * initial_term) {
GList * or = NULL;
GList * and = NULL;
if(initial_term) {
or = g_list_alloc();
and = g_list_alloc();
@ -93,7 +94,7 @@ xaccInitQuery(Query * q, QueryTerm * initial_term) {
q->terms = or;
q->split_list = NULL;
q->changed = 1;
q->max_splits = -1;
q->primary_sort = BY_STANDARD;
@ -129,7 +130,7 @@ void
xaccQuerySingleTerm(Query * q, QueryTerm * qt) {
GList * or = NULL;
GList * and = NULL;
or = g_list_alloc();
and = g_list_alloc();
and->data = qt;
@ -158,7 +159,12 @@ xaccQueryHasTerms(Query * q) {
void
xaccFreeQuery(Query * q) {
GList * gl = q->terms;
GList * gl;
if (q == NULL)
return;
gl = q->terms;
for(gl=q->terms; gl; gl=gl->next) {
g_list_free(gl->data);
}

View File

@ -29,7 +29,6 @@ INCLPATH := -I.. \
-I../engine/guid \
-I../register \
-I../reports \
-I@top_srcdir@/lib/g-wrap-install/include \
-I@top_srcdir@/src/g-wrap \
-I${includedir} \
-I@top_srcdir@/src/register/gnome

View File

@ -1,3 +1,20 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
;;; Account creation utilities
(define gnc:account-types (initialize-hashtable 29)) ;; Need not be large...
(define (account-type->number symbol)

View File

@ -1,12 +1,27 @@
;;;; bootstrap.scm -*-scheme-*-
;; bootstrap.scm -*-scheme-*-
;;
;; Minimal startup code. This file should just contain enough code to
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
;;
;; Minimal startup code. This file should just contain enough code to
;; get gnc:load defined, and the "default" environment setup. After
;; that *everything* should be loaded via gnc:load, starting with
;; startup.scm
;; (use-modules (gnc))
(define (display-slib-error)
(display "Obtain slib at: http://swissnet.ai.mit.edu/~jaffer/SLIB.html\n")
(newline)
@ -124,6 +139,18 @@
(newline))))
;; Set up timing functions
(define gnc:*last-time* (gettimeofday))
(define (gnc:timestamp . stuff)
(let* ((now (gettimeofday))
(delta (+ (- (car now) (car gnc:*last-time*))
(/ (- (cdr now) (cdr gnc:*last-time*)) 1000000))))
(gnc:msg stuff "-- Elapsed time: " delta "seconds.")
(set! gnc:*last-time* now)))
;;; Set up gnc:load.
(define (gnc:find-in-directories file directories)

View File

@ -1,4 +1,21 @@
;;;; startup-interpreter.scm -*-scheme-*-
;; startup-interpreter.scm -*-scheme-*-
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
;; Load the necessary files for use in interpreter mode.

View File

@ -1,3 +1,20 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(require 'hash-table)
(define gnc:register-c-side-scheme-ptr #f)

View File

@ -1,3 +1,19 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
;; also "-c"

View File

@ -1,3 +1,19 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
;;; config-var: You can create them, set values, find out of the value
;;; is different from the default, and you can get a description. You

View File

@ -1,9 +1,23 @@
;; -*-scheme-*-
;; $Id$
;; dateutils.scm
;; date utility functions. mainly used by budget
;; date-utilities.scm -- date utility functions.
;; Bryan Larsen (blarsen@ada-works.com)
;; Revised by Christopher Browne
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(gnc:support "dateutils.scm")
(gnc:depend "srfi/srfi-19.scm")

View File

@ -1,3 +1,19 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(define gnc:*_supported-files_* (make-hash-table 101))
;; Record of files that have already been loaded. We don't do

View File

@ -1,3 +1,19 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(gnc:support "doc.scm")

View File

@ -0,0 +1,183 @@
;; engine-interface.scm -- support for working with the GnuCash
;; engine data structures
;; Copyright (C) 2000 Dave Peticolas <peticola@cs.ucdavis.edu>
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
;; This defines a scheme representation of splits.
(define gnc:split-structure
(make-record-type
"gnc:split-structure"
'(split-guid account-guid transaction-guid memo action docref
reconcile-state reconciled-date share-amount share-price)))
(define gnc:make-split-scm
(record-constructor gnc:split-structure))
(define gnc:split-scm?
(record-predicate gnc:split-structure))
(define gnc:split-scm-get-split-guid
(record-accessor gnc:split-structure 'split-guid))
(define gnc:split-scm-get-account-guid
(record-accessor gnc:split-structure 'account-guid))
(define gnc:split-scm-get-transaction-guid
(record-accessor gnc:split-structure 'transaction-guid))
(define gnc:split-scm-get-memo
(record-accessor gnc:split-structure 'memo))
(define gnc:split-scm-get-action
(record-accessor gnc:split-structure 'action))
(define gnc:split-scm-get-docref
(record-accessor gnc:split-structure 'docref))
(define gnc:split-scm-get-reconcile-state
(record-accessor gnc:split-structure 'reconcile-state))
(define gnc:split-scm-get-reconciled-date
(record-accessor gnc:split-structure 'reconciled-date))
(define gnc:split-scm-get-share-amount
(record-accessor gnc:split-structure 'share-amount))
(define gnc:split-scm-get-share-price
(record-accessor gnc:split-structure 'share-price))
;; This function take a C split and returns a representation
;; of it as a split-structure.
(define (gnc:split->split-scm split)
(gnc:make-split-scm
(gnc:split-get-guid split)
(gnc:account-get-guid (gnc:split-get-account split))
(gnc:transaction-get-guid (gnc:split-get-parent split))
(gnc:split-get-memo split)
(gnc:split-get-action split)
(gnc:split-get-docref split)
(gnc:split-get-reconcile-state split)
(gnc:split-get-reconciled-date split)
(gnc:split-get-share-amount split)
(gnc:split-get-share-price split)))
;; gnc:split-copy is a form of gnc:split->split-scm used by C routines.
;; It stores the split in an internal variable so C can safely register
;; it before it gets garbage collected.
(define gnc:copy-split #f)
(let ((last-split #f))
(set! gnc:copy-split
(lambda (split)
(set! last-split (gnc:split->split-scm split))
last-split)))
;; Copy a scheme representation of a split onto a C split.
;; If possible, insert the C split into the account of the
;; scheme split. Not all values are copied. The reconcile
;; status and date are not copied. The C split's guid is,
;; of course, unchanged.
(define (gnc:split-scm-onto-split split-scm split)
(if (pointer-token-null? split)
#f
(begin
(let ((account (gnc:account-lookup
(gnc:split-scm-get-account-guid split-scm))))
(if (and account (gnc:account-can-insert-split? account split))
(gnc:account-insert-split account split)))
(gnc:split-set-memo split (gnc:split-scm-get-memo split-scm))
(gnc:split-set-action split (gnc:split-scm-get-action split-scm))
(gnc:split-set-docref split (gnc:split-scm-get-docref split-scm))
(gnc:split-set-share-price-and-amount
split
(gnc:split-scm-get-share-price split-scm)
(gnc:split-scm-get-share-amount split-scm)))))
;; Returns true if we can insert the C split into the given account.
(define (gnc:account-can-insert-split? account split)
(let ((currency (gnc:account-get-currency account))
(security (gnc:account-get-security account))
(trans (gnc:split-get-parent split)))
(or (< (gnc:transaction-get-split-count trans) 2)
(gnc:transaction-is-common-currency trans currency)
(gnc:transaction-is-common-currency trans security))))
;; Defines a scheme representation of a transaction.
(define gnc:transaction-structure
(make-record-type
"gnc:transaction-structure"
'(transaction-guid date-entered date-posted num description docref splits)))
(define gnc:make-transaction-scm
(record-constructor gnc:transaction-structure))
(define gnc:transaction-scm?
(record-predicate gnc:transaction-structure))
(define gnc:transaction-scm-get-transaction-guid
(record-accessor gnc:transaction-structure 'transaction-guid))
(define gnc:transaction-scm-get-date-entered
(record-accessor gnc:transaction-structure 'date-entered))
(define gnc:transaction-scm-get-date-posted
(record-accessor gnc:transaction-structure 'date-posted))
(define gnc:transaction-scm-get-num
(record-accessor gnc:transaction-structure 'num))
(define gnc:transaction-scm-get-description
(record-accessor gnc:transaction-structure 'description))
(define gnc:transaction-scm-get-docref
(record-accessor gnc:transaction-structure 'docref))
(define gnc:transaction-scm-get-splits
(record-accessor gnc:transaction-structure 'splits))
;; This function takes a C transaction and returns
;; a representation of it as a transaction-structure.
(define (gnc:transaction->transaction-scm trans)
(define (trans-splits i)
(let (split ((gnc:transaction-get-split trans i)))
(if (pointer-token-null? split)
'()
(cons split (trans-splits (+ i 1))))))
(gnc:make-transaction-scm
(gnc:transaction-get-guid trans)
(gnc:transaction-get-date-entered trans)
(gnc:transaction-get-date-posted trans)
(gnc:transaction-get-num trans)
(gnc:transaction-get-description trans)
(gnc:transaction-get-docref trans)
(trans-splits 0)))
;; Return a scheme symbol identifying the type of guid passed in.
(define gnc:guid-type #f)
(let ()
(define entity-types (vector 'gnc-id-none
'gnc-id-null
'gnc-id-group
'gnc-id-account
'gnc-id-trans
'gnc-id-split))
(set! gnc:guid-type
(lambda (guid)
(vector-ref entity-types (gnc:guid-type-helper guid)))))

View File

@ -1,7 +1,22 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(gnc:support "extensions.scm")
(define (gnc:make-extension
;; The type of extension item, either 'menu, 'menu-item, or 'separator
type

View File

@ -1,3 +1,19 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(define gnc:*pi* 3.14159265359)

View File

@ -1,3 +1,19 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
;;;
;;; Code to support emacs-inspired hooks.

View File

@ -1,8 +1,23 @@
;;;; $Id$
;;;; HTML Support functions
;; primarily Bryan Larsen (blarsen@ada-works.com) with help from
;; html-generator.scm -- HTML Support functions
;; Bryan Larsen (blarsen@ada-works.com) with help from
;; pretty much everybody involved with reports.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(gnc:support "html-generator.scm")

View File

@ -1,3 +1,20 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(define (gnc:startup)
(gnc:debug "starting up.")
(if (not (gnc:handle-command-line-args))
@ -69,7 +86,6 @@
(define (gnc:main)
;; Now the fun begins.
(gnc:startup)
(if (not (= (gnc:lowlev-app-init) 0))

View File

@ -1,4 +1,21 @@
;; Scheme code for supporting options
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(define (gnc:make-option
;; The category of this option

View File

@ -1,3 +1,20 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(define (gnc:locale-prefixes)
(let* ((locale (setlocale LC_MESSAGES))
(strings (cond ((not (string? locale)) ())

View File

@ -1,4 +1,21 @@
;;;; Preferences...
;; Preferences...
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(require 'sort)
(require 'hash-table)

View File

@ -1,5 +1,22 @@
;;; $Id$
;;; Reporting utilities
;; report-utilities.scm -- Reporting utilities
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(gnc:support "report-utilities.scm")
(define (gnc:amount->string amount print_currency_symbol?

View File

@ -1,3 +1,20 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(require 'hash-table)
(require 'record)

View File

@ -1,4 +1,21 @@
;;;; startup.scm -*-scheme-*-
;; startup.scm
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
;; Load all the files we need from wherever the user has specified.
;; None of these loads will be affected by any command line arguments
@ -12,6 +29,7 @@
(gnc:load "utilities.scm")
(gnc:load "path.scm")
(gnc:load "c-interface.scm")
(gnc:load "engine-interface.scm")
(gnc:load "options.scm")
(gnc:load "prefs.scm")
(gnc:load "command-line.scm")

View File

@ -1,5 +1,21 @@
;;; $Id$
;;; Some functions to help build structures
;; structure.scm -- Some functions to help build structures
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
;;; define-mystruct is used to build an association list that defines
;;; the layout of a structure...

View File

@ -1,4 +1,21 @@
;;; $Id$
;; text-export.scm
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(require 'pretty-print)
(gnc:support "text-export.scm")

View File

@ -1,3 +1,20 @@
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(define (gnc:create-transaction Account txnlist)
(define (associt type)
(let

View File

@ -1,5 +1,23 @@
;;;; $Id$
;;;; These utilities are loaded straight off
;; utilities.scm
;; These utilities are loaded straight off
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(define (directory? path)
;; This follows symlinks normally.
(let* ((status (false-if-exception (stat path)))
@ -35,12 +53,12 @@
string and 'directories' must be a list of strings."
(gnc:debug "gnc:find-in-directories looking for " file " in " directories)
(do ((rest directories (cdr rest))
(finished? #f)
(result #f))
((or (null? rest) finished?) result)
(let ((file-name (build-path (car rest) file)))
(gnc:debug " checking for " file-name)
(if (access? file-name F_OK)
@ -76,8 +94,7 @@ string and 'directories' must be a list of strings."
(if
(< stringsize 1)
""
(let*
((lastchar (string-ref line (- stringsize 1))))
(let ((lastchar (string-ref line (- stringsize 1))))
(if
(char-whitespace? lastchar)
(striptrailingwhitespace (substring line 0 (- stringsize 1)))
@ -100,4 +117,4 @@ string and 'directories' must be a list of strings."
(if (null? size)
313
(car size))
'()))
'()))

View File

@ -2,6 +2,23 @@
;;;; $Id$
;;;;;;;;;;;;; Generating XML out of Scheme Lists
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2 of
;; the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, contact:
;;
;; Free Software Foundation Voice: +1-617-542-5942
;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652
;; Boston, MA 02111-1307, USA gnu@gnu.org
(gnc:support "xml-generator.scm")
;;;;;;;;;;;;;