r21993 - gnucash/trunk/src/engine - Hide some now internal-only functions from the public GncEntry interface

Geert Janssens gjanssens at code.gnucash.org
Fri Feb 10 10:33:44 EST 2012


Author: gjanssens
Date: 2012-02-10 10:33:43 -0500 (Fri, 10 Feb 2012)
New Revision: 21993
Trac: http://svn.gnucash.org/trac/changeset/21993

Modified:
   gnucash/trunk/src/engine/gncEntry.c
   gnucash/trunk/src/engine/gncEntry.h
Log:
Hide some now internal-only functions from the public GncEntry interface

Modified: gnucash/trunk/src/engine/gncEntry.c
===================================================================
--- gnucash/trunk/src/engine/gncEntry.c	2012-02-10 15:33:34 UTC (rev 21992)
+++ gnucash/trunk/src/engine/gncEntry.c	2012-02-10 15:33:43 UTC (rev 21993)
@@ -1361,7 +1361,9 @@
     entry->values_dirty = FALSE;
 }
 
-gnc_numeric gncEntryGetIntValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
+/* The "Int" functions below are for internal use only.
+ * Outside this file, use the "Doc" or "Bal" variants found below instead. */
+static gnc_numeric gncEntryGetIntValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
 {
     if (!entry) return gnc_numeric_zero();
     gncEntryRecomputeValues (entry);
@@ -1371,7 +1373,7 @@
         return (is_cust_doc ? entry->i_value : entry->b_value);
 }
 
-gnc_numeric gncEntryGetIntTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
+static gnc_numeric gncEntryGetIntTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
 {
     if (!entry) return gnc_numeric_zero();
     gncEntryRecomputeValues (entry);
@@ -1382,14 +1384,14 @@
 }
 
 /* Careful: the returned list is managed by the entry, and will only be valid for a short time */
-AccountValueList * gncEntryGetIntTaxValues (GncEntry *entry, gboolean is_cust_doc)
+static AccountValueList * gncEntryGetIntTaxValues (GncEntry *entry, gboolean is_cust_doc)
 {
     if (!entry) return NULL;
     gncEntryRecomputeValues (entry);
     return (is_cust_doc ? entry->i_tax_values : entry->b_tax_values);
 }
 
-gnc_numeric gncEntryGetIntDiscountValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
+static gnc_numeric gncEntryGetIntDiscountValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
 {
     if (!entry) return gnc_numeric_zero();
     gncEntryRecomputeValues (entry);

Modified: gnucash/trunk/src/engine/gncEntry.h
===================================================================
--- gnucash/trunk/src/engine/gncEntry.h	2012-02-10 15:33:34 UTC (rev 21992)
+++ gnucash/trunk/src/engine/gncEntry.h	2012-02-10 15:33:43 UTC (rev 21993)
@@ -214,11 +214,9 @@
  * - tax value: the amount the government gets
  * - discount value: the amount the customer saved
  *
- * These values can be retrieved in several variants. depending on
+ * These values can be retrieved in several variants. Depending on
  * how they will be used some sign reversals can be applied on
  * the values:
- * - Int value: the value as stored internally. No sign reversals will
- *              ever be done on this value
  * - Doc value: the value as listed on the document. This is usually
  *              a positive value, unless the document was a
  *              negative invoice/bill or negative credit note.
@@ -237,25 +235,14 @@
  * tax values for this entry. This list holds unrounded values only, there's
  * no variant with rounded values.
  *
- * Note that this list may or may not be owned by the entry depending on the
- * variant being called. If not owned by the entry, it should be freed with
- * gncAccountValueDestroy.
+ * Note that this list is not owned by the entry. When no longer needed,
+ * it should be freed with gncAccountValueDestroy.
  *
- * - gncEntryGetIntTaxValues returns a list owned by the entry.
- * - gncEntryGetDocTaxValues returns a list NOT owned by the entry. It should be freed by the caller.
- * - gncEntryGetBalTaxValues returns a list NOT owned by the entry. It should be freed by the caller.
- *
  * Finally, there are rounded and unrounded variants of most of
  * these functions.
  @{
 */
 typedef GList AccountValueList;
-gnc_numeric gncEntryGetIntValue (GncEntry *entry, gboolean round, gboolean is_cust_doc);
-gnc_numeric gncEntryGetIntTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc);
-/** Careful: the returned list is managed by the entry, and will only be valid for a short time */
-AccountValueList * gncEntryGetIntTaxValues (GncEntry *entry, gboolean is_cust_doc);
-gnc_numeric gncEntryGetIntDiscountValue (GncEntry *entry, gboolean round, gboolean is_cust_doc);
-
 gnc_numeric gncEntryGetDocValue (GncEntry *entry, gboolean round, gboolean is_cust_doc, gboolean is_cn);
 gnc_numeric gncEntryGetDocTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc, gboolean is_cn);
 /** Careful: the returned list is NOT owned by the entry and should be freed by the caller */



More information about the gnucash-changes mailing list