SAF_Quantity *
saf_find_one_quantity(SAF_Db *database, /* The database in which to find the specified quantity. */
const char *desc, /* Quantity description to find. */
SAF_Quantity *buf /* [OUT] Optional quantity handle to initialize and return. */
)
{
SAF_ENTER(saf_find_one_quantity, NULL);
#ifdef HASH_QUANTITIES /*RPM DEBUGGING 2004-09-26*/
size_t limit=1;
buf = (SAF_Quantity*)_saf_htab_find(QHash, _saf_hkey_str(desc), &limit, (ss_pers_t*)buf);
assert(1==limit);
#else
int n;
/* Look for quantity by name */
n = 1;
saf_find_quantities(SAF_EACH, database, desc, NULL, NULL, SAF_ANY_INT, NULL, &n, &buf);
/* Look for quantity by abbreviation */
if (0==n) {
n = 1;
saf_find_quantities(SAF_EACH, database, NULL, desc, NULL, SAF_ANY_INT, NULL, &n, &buf);
}
#endif
SAF_LEAVE(buf);
}