From 40499bcb7d1db20f511faf6b9129f4ed437ca2aa Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Wed, 9 Jan 2002 21:32:13 +0000 Subject: [PATCH] * src/business/business-core/gw-business-core-spec.scm: fix for new g-wrap. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6553 57a11ea4-9604-0410-9ed3-97b8803252fd --- .../business-core/gw-business-core-spec.scm | 83 +++++++------------ 1 file changed, 30 insertions(+), 53 deletions(-) diff --git a/src/business/business-core/gw-business-core-spec.scm b/src/business/business-core/gw-business-core-spec.scm index 699ea03682..2b600d883a 100644 --- a/src/business/business-core/gw-business-core-spec.scm +++ b/src/business/business-core/gw-business-core-spec.scm @@ -1,5 +1,4 @@ ;;; -*-scheme-*- -(use-modules (g-wrap)) (debug-set! maxdepth 100000) (debug-set! stack 2000000) @@ -7,38 +6,25 @@ (define-module (g-wrapped gw-business-core-spec) :use-module (g-wrap)) +(use-modules (g-wrap)) + +(use-modules (g-wrap gw-standard-spec)) +(use-modules (g-wrap gw-wct-spec)) + (use-modules (g-wrapped gw-engine-spec)) -(let ((mod (gw:new-module "gw-business-core"))) - (define (standard-c-call-gen result func-call-code) - (list (gw:result-get-c-name result) " = " func-call-code ";\n")) - - (define (add-standard-result-handlers! type c->scm-converter) - (define (standard-pre-handler result) - (let* ((ret-type-name (gw:result-get-proper-c-type-name result)) - (ret-var-name (gw:result-get-c-name result))) - (list "{\n" - " " ret-type-name " " ret-var-name ";\n"))) - - (gw:type-set-pre-call-result-ccodegen! type standard-pre-handler) - - (gw:type-set-post-call-result-ccodegen! - type - (lambda (result) - (let* ((scm-name (gw:result-get-scm-name result)) - (c-name (gw:result-get-c-name result))) - (list - (c->scm-converter scm-name c-name) - " }\n"))))) +(let ((ws (gw:new-wrapset "gw-business-core"))) - (gw:module-depends-on mod "gw-runtime") - (gw:module-depends-on mod "gw-engine") + (gw:wrapset-depends-on ws "gw-standard") + (gw:wrapset-depends-on ws "gw-wct") - (gw:module-set-guile-module! mod '(g-wrapped gw-business-core)) - - (gw:module-set-declarations-ccodegen! - mod - (lambda (client-only?) + (gw:wrapset-depends-on ws "gw-engine") + + (gw:wrapset-set-guile-module! ws '(g-wrapped gw-business-core)) + + (gw:wrapset-add-cs-declarations! + ws + (lambda (wrapset client-wrapset) (list "#include \n" "#include \n" @@ -48,42 +34,33 @@ "#include \n" "#include \n" "#include \n" - "#include \n" - ))) + "#include \n"))) - (gw:module-set-init-ccodegen! - mod - (lambda (client-only?) - (if client-only? + (gw:wrapset-add-cs-initializers! + ws + (lambda (wrapset client-wrapset status-var) + (if client-wrapset '() (gw:inline-scheme '(use-modules (gnucash business-core)))))) - + ;; The core Business Object Types ;; XXX: Need to add lists of all of these! - (gw:wrap-non-native-type mod ' "GncAddress*" - "const GncAddress*") - (gw:wrap-non-native-type mod ' "GncCustomer*" - "const GncCustomer*") - (gw:wrap-non-native-type mod ' "GncEmployee*" - "const GncEmployee*") - (gw:wrap-non-native-type mod ' "GncEntry*" - "const GncEntry*") - (gw:wrap-non-native-type mod ' "GncInvoice*" - "const GncInvoice*") - (gw:wrap-non-native-type mod ' "GncJob*" - "const GncJob*") - (gw:wrap-non-native-type mod ' "GncOrder*" - "const GncOrder*") - (gw:wrap-non-native-type mod ' "GncVendor*" - "const GncVendor*") + (gw:wrap-as-wct ws ' "GncAddress*" "const GncAddress*") + (gw:wrap-as-wct ws ' "GncCustomer*" "const GncCustomer*") + (gw:wrap-as-wct ws ' "GncEmployee*" "const GncEmployee*") + (gw:wrap-as-wct ws ' "GncEntry*" "const GncEntry*") + (gw:wrap-as-wct ws ' "GncInvoice*" "const GncInvoice*") + (gw:wrap-as-wct ws ' "GncJob*" "const GncJob*") + (gw:wrap-as-wct ws ' "GncOrder*" "const GncOrder*") + (gw:wrap-as-wct ws ' "GncVendor*" "const GncVendor*") ;; ;; gncBusiness.h ;; (gw:wrap-function - mod + ws 'gnc:business-create-book ' "gncBusinessCreateBook"