mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
add a utility routine
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1096 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
7eea03c6f1
commit
1e10ba84e2
@ -1142,5 +1142,19 @@ xaccGetOtherSplit (Split *split)
|
||||
return NULL; /* never reached, in theory */
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
int
|
||||
xaccIsPeerSplit (Split *sa, Split *sb)
|
||||
{
|
||||
Transaction *ta, *tb;
|
||||
if (!sa || !sb) return 0;
|
||||
ta = sa->parent;
|
||||
tb = sb->parent;
|
||||
if (ta == tb) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/************************ END OF ************************************\
|
||||
\************************* FILE *************************************/
|
||||
|
@ -210,7 +210,7 @@ double xaccSplitGetClearedBalance (Split *);
|
||||
double xaccSplitGetReconciledBalance (Split *);
|
||||
double xaccSplitGetShareBalance (Split *);
|
||||
|
||||
/* return teh parent transaction of the split */
|
||||
/* return the parent transaction of the split */
|
||||
Transaction * xaccSplitGetParent (Split *);
|
||||
|
||||
/* return the memo, action strings */
|
||||
@ -262,4 +262,10 @@ Account * xaccGetAccountByName (Transaction *, const char *);
|
||||
*/
|
||||
Split * xaccGetOtherSplit (Split *);
|
||||
|
||||
/* The IsPeerSplit() is a convenience routine that returns
|
||||
* a non-zero value if the two splits share a common
|
||||
* parent transaction, else it returns zero.
|
||||
*/
|
||||
int xaccIsPeerSplit (Split *, Split *);
|
||||
|
||||
#endif /* __XACC_TRANSACTION_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user