add routine to convert account type string to enum

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3478 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2001-01-16 06:11:20 +00:00
parent 6cf34972a0
commit 6dc0871f26
2 changed files with 12 additions and 0 deletions

View File

@ -1453,6 +1453,17 @@ xaccAccountStringToType(const char* str, int *type) {
#undef GNC_RETURN_ON_MATCH
/* impedance mismatch is a source of loss */
GNCAccountType
xaccAccountStringToEnum(const char* str)
{
int type;
gboolean rc;
rc = xaccAccountStringToType(str, &type);
if (FALSE == rc) return BAD_TYPE;
return ((GNCAccountType) type);
}
/********************************************************************\
\********************************************************************/

View File

@ -112,6 +112,7 @@ char * xaccAccountGetTypeStr (int type); /* GUI names */
"INCOME". */
char * xaccAccountTypeEnumAsString (int type);
gboolean xaccAccountStringToType (const char* str, int *type);
GNCAccountType xaccAccountStringToEnum (const char* str);
gboolean xaccAccountTypesCompatible (int parent_type, int child_type);