From 0aa250cb61de135973da553ebdb917772eb133e5 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Wed, 9 Jan 2002 22:12:03 +0000 Subject: [PATCH] * src/scm/main.scm (gnc:safe-strcmp): new public function -- we were using a g-wrapped version, but that seemed more expensive than necessary. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6606 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/scm/main.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/scm/main.scm b/src/scm/main.scm index ba84d605ac..7cd0c51e9e 100644 --- a/src/scm/main.scm +++ b/src/scm/main.scm @@ -18,8 +18,10 @@ (define-module (gnucash main)) (use-modules (ice-9 slib)) + +(use-modules (g-wrap gw-wct)) + (use-modules (g-wrapped gw-gnc)) -(use-modules (g-wrapped gw-runtime)) ;; Load the srfis (eventually, we should see where these are needed ;; and only have the use-modules statements in those files). @@ -54,6 +56,7 @@ (export gnc:find-file) (export gnc:find-localized-file) (export gnc:main) +(export gnc:safe-strcmp) ;; only used by aging.scm atm... ;; from path.scm (export gnc:make-home-dir) @@ -143,6 +146,18 @@ (lambda (module) (process-use-modules (list (list module))))))) +(define (gnc:safe-strcmp a b) + (cond + (if (and a b) + (cond + ((string? a b) 1) + (else 0)) + (cond + (a 1) + (b -1) + (else 0))))) + (if (not (defined? 'hash-fold)) (define (hash-fold proc init table) (for-each