The material below is a context diff of a set of functions I've added
to g-wrap so as to allow the ability to create transactions.  I'm certain
that this is all I'll need, but figured I ought to submit the change
anyways, as it'll be needed more widely soon enough.

By the way, g-wrap looks Really A Lot Like a Schemed variation on CORBA IDL.
I have this nagging suspicion that g-wrap ought to become part of the encoding
to provide a Scheme language mapping for ORBit.  It is disappointing that we
have SWIG, g-wrap, and ILU as near "competitors," with ORBit as a "if it did
Scheme it would also join the list" option.

Anyhow...

--- gnc.gwp     1999/07/04 05:54:45     1.1
+++ gnc.gwp     1999/07/05 01:26:45
@@ -611,4 +611,88 @@
               'Session* "gnc_main_window_get_session" '((gncUIWidget w))
               "Get the session associated with a given main window.")
 
+
+(new-function
+ 'gnc:transaction-destroy
+ 'void "gnc_TransDestroy" '((Transaction* t))
+ "Destroys the transaction in question.")
+
+(new-function
+ 'gnc:split-destroy
+ 'void "gnc_SplitDestroy" '((Split* s))
+ "Destroys the split in question.  Probably only useful inside the context
+of having a parent transaction with which one is working...")
+
+(new-function
+ 'gnc:transaction-append-split
+ 'void "gnc_TransactionAppendSplit" '((Transaction* t) (Split* s))
+ "Adds a split to a transaction.")
+
+(new-function
+ 'gnc:transaction-remove-split
+ 'void "gnc_TransactionRemoveSplit" '((Transaction* t) (Split* s))
+ "Removes a split from a transaction.")
+
+(new-function
+ 'gnc:transaction-set-date
+ 'void "gnc_TransactionSetDate" '((Transaction* t) (int day) 
+                                 (int month) (int year))
+ "Set date on transaction based on day, month, year values")
+
+(new-function
+ 'gnc:transaction-set-xnum
+ 'void "gnc_TransSetNum" '((Transaction* t) (const-string xnum))
+ "Set the XNUM - e.g. - cheque number or other identifier")
+
+(new-function
+ 'gnc:transaction-set-description
+ 'void "gnc_TransSetDescription" '((Transaction* t) (const-string desc))
+ "Set the transaction description.")
+
+(new-function
+ 'gnc:transaction-set-docref
+ 'void "gnc_TransSetDocref" '((Transaction* t) (const-string docs))
+ "Set docref field on transaction")
+
+(new-function
+ 'gnc:transaction-set-memo
+ 'void "gnc_TransSetMemo" '((Transaction* t) (const-string mimeo))
+ "Set Memo field on transaction")
+
+(new-function
+ 'gnc:transaction-set-action
+ 'void "gnc_TransSetAction" '((Transaction* t) (const-string action))
+ "Set action on transaction")
+
+(new-function
+ 'gnc:transaction-create
+ 'Transaction* "xaccMallocTransaction" '()
+ "Create a Transaction structure")
+
+(new-function
+ 'gnc:split-create
+ 'Split* "xaccMallocSplit" '()
+ "Create a Split structure")
+
+(new-function
+ 'gnc:split-set-value
+ 'void "gnc_SplitSetValue" '((Split* s) (double amount))
+ "Set value for split")
+
+(new-function
+ 'gnc:split-set-memo
+ 'void "gnc_SplitSetMemo" '((Split* s) (const-string memo))
+ "Set memo for a split")
+
+(new-function
+ 'gnc:split-set-action
+ 'void "gnc_SplitSetAction" '((Split* s) (const-string action))
+ "Set Action for a split.")
+
+(new-function
+ 'gnc:split-set-docref
+ 'void "gnc_SplitSetDocref" '((Split* s) (const-string docs))
+ "Set document reference for split entry")
+ 
 (gwrap-close-module)
+
--- gnc-helpers.c       1999/07/04 05:54:45     1.1
+++ gnc-helpers.c       1999/07/05 01:26:44
@@ -86,3 +86,65 @@
                                                _gnc_scm_traversal_adapter_,
                                                &thunk));
 }
+
+void gnc_TransDestroy (Transaction *t) {
+  xaccTransDestroy (t);
+}
+
+void gnc_SplitDestroy (Split *s) {
+  xaccSplitDestroy (s);
+}
+
+void gnc_TransactionAppendSplit (Transaction *t, Split *s) {
+  xaccTransAppendSplit (t, s);
+}
+
+void gnc_TransactionRemoveSplit (Transaction *t, Split *s) {
+  xaccTransRemoveSplit (t, s);
+}
+
+void gnc_TransactionSetDate (Transaction *t, int day, int month, int year) {
+  xaccTransSetDate(t, day, month, year);
+}
+
+void gnc_TransSetNum (Transaction *t, char *xnum) {
+  xaccTransSetNum (t, xnum);
+}
+
+void gnc_TransSetDescription (Transaction *t, char *desc) {
+  xaccTransSetDescription (t, desc);
+}
+
+gnc_TransSetDocref (Transaction *trans, char *docs) {
+  xaccTransSetDocref (trans, docs);
+}
+
+void gnc_TransSetMemo (Transaction *trans, char *mimeo) {
+  xaccTransSetMemo (trans, mimeo);
+}
+
+void gnc_TransSetAction (Transaction *t,  char *action) {
+  xaccTransSetAction (t, action);
+}
+
+Split *gnc_SplitCreate (void) {
+  Split *s = (Split *) xaccMallocSplit ();
+  return s;
+}
+
+void gnc_SplitSetValue (Split *s, double amount) {
+  xaccSplitSetValue (s, amount);
+}
+
+void gnc_SplitSetMemo (Split *s, const char *memo) {
+  xaccSplitSetMemo (s, memo);
+}
+
+void gnc_SplitSetAction (Split *s, const char *action) {
+  xaccSplitSetAction (s, action);
+}
+
+void gnc_SplitSetDocref (Split *s, const char *docs) {
+  xaccSplitSetDocref (s, docs);
+}
+


--
Christopher B. Browne, [EMAIL PROTECTED], [EMAIL PROTECTED]
Web: http://www.ntlug.org/~cbbrowne  SAP Basis Consultant, UNIX Guy
Windows NT - How to make a 100 MIPS Linux workstation perform like an 8 MHz 286
----- %< -------------------------------------------- >% ------
The GnuCash / X-Accountant Mailing List
To unsubscribe, send mail to [EMAIL PROTECTED] and
put "unsubscribe gnucash-devel [EMAIL PROTECTED]" in the body

Reply via email to