add dereferenceing operators

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1545 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/xacc-12-patch
Linas Vepstas 28 years ago
parent 0988191ab9
commit d341164229

@ -1068,4 +1068,15 @@ xaccAccountGetNumSplits (Account *acc)
return (acc->numSplits);
}
/********************************************************************\
\********************************************************************/
Account *
IthAccount (Account **list, int i)
{
if (!list || 0 > i) return NULL;
return list[i];
}
/*************************** END OF FILE **************************** */

@ -23,8 +23,8 @@
* Huntington Beach, CA 92648-4632 *
\********************************************************************/
#ifndef __ACCOUNT_H__
#define __ACCOUNT_H__
#ifndef __XACC_ACCOUNT_H__
#define __XACC_ACCOUNT_H__
#include "config.h"
#include "AccInfo.h"
@ -148,9 +148,10 @@ Split * xaccAccountGetSplit (Account *acc, int i);
Split ** xaccAccountGetSplitList (Account *acc);
int xaccAccountGetNumSplits (Account *acc);
/* The IthAccount() routine merely dereferences: the returned
* value is just list[i]. This routine is needed for the perl
* swig wrappers, which cannot dereference a list.
*/
/** GLOBALS *********************************************************/
extern int next_free_unique_account_id;
#endif
Account * IthAccount (Account **list, int i);
#endif /* __XACC_ACCOUNT_H__ */

@ -160,4 +160,8 @@ void xaccAccountRemoveSplit (Account *, Split *);
void xaccAccountRecomputeBalance (Account *);
void xaccAccountRecomputeBalances (Account **);
/** GLOBALS *********************************************************/
extern int next_free_unique_account_id;
#endif /* __XACC_ACCOUNT_P_H__ */

@ -1945,5 +1945,22 @@ xaccIsPeerSplit (Split *sa, Split *sb)
return 0;
}
/********************************************************************\
\********************************************************************/
Split *
IthSplit (Split **list, int i)
{
if (!list || 0 > i) return NULL;
return list[i];
}
Transaction *
IthTransaction (Transaction **list, int i)
{
if (!list || 0 > i) return NULL;
return list[i];
}
/************************ END OF ************************************\
\************************* FILE *************************************/

@ -445,4 +445,12 @@ Split * xaccGetOtherSplit (Split *);
*/
int xaccIsPeerSplit (Split *, Split *);
/* The IthSplit() and IthTransaction() routines merely dereference
* the lists supplied as arguments; i.e. they return list[i].
* These routines are needed by the perl swig wrappers, which
* are unable to dereference on thier own.
*/
Transaction * IthTransaction (Transaction **tarray, int i);
Split * IthSplit (Split **sarray, int i);
#endif /* __XACC_TRANSACTION_H__ */

Loading…
Cancel
Save