touched up qse_xli_setpairwithstr() a bit

This commit is contained in:
hyung-hwan 2018-01-22 09:38:44 +00:00
parent fc1748ccd0
commit c0a072a054
2 changed files with 34 additions and 37 deletions

View File

@ -735,6 +735,10 @@ QSE_EXPORT qse_xli_pair_t* qse_xli_findpair (
const qse_char_t* fqpn const qse_char_t* fqpn
); );
/**
* The qse_xli_setpairwithstr() finds an existing pair with the fully qualified
* pair name and updates its value with a new string value.
*/
QSE_EXPORT qse_xli_pair_t* qse_xli_setpairwithstr ( QSE_EXPORT qse_xli_pair_t* qse_xli_setpairwithstr (
qse_xli_t* xli, qse_xli_t* xli,
const qse_xli_list_t* list, const qse_xli_list_t* list,
@ -749,7 +753,6 @@ QSE_EXPORT qse_size_t qse_xli_countpairs (
const qse_char_t* fqpn const qse_char_t* fqpn
); );
/** /**
* The qse_xli_addsegtostr() function creates a new string segment made of * The qse_xli_addsegtostr() function creates a new string segment made of
* the character string pointed to by \a value and chains it to the XLI string * the character string pointed to by \a value and chains it to the XLI string

View File

@ -891,8 +891,8 @@ qse_xli_pair_t* qse_xli_setpairwithstr (qse_xli_t* xli, const qse_xli_list_t* li
qse_xli_pair_t* pair, * xpair; qse_xli_pair_t* pair, * xpair;
pair = qse_xli_findpair (xli, list, fqpn); pair = qse_xli_findpair (xli, list, fqpn);
if (pair) if (!pair) return QSE_NULL;
{
if (xli->opt.trait & QSE_XLI_VALIDATE) if (xli->opt.trait & QSE_XLI_VALIDATE)
{ {
qse_rbt_pair_t* scm_pair; qse_rbt_pair_t* scm_pair;
@ -929,12 +929,6 @@ qse_xli_pair_t* qse_xli_setpairwithstr (qse_xli_t* xli, const qse_xli_list_t* li
if (xpair) qse_xli_deletepair (xli, pair); if (xpair) qse_xli_deletepair (xli, pair);
return xpair; return xpair;
} }
else
{
/* TODO: insert a new pair */
return QSE_NULL;
}
}
qse_size_t qse_xli_countpairs (qse_xli_t* xli, const qse_xli_list_t* list, const qse_char_t* fqpn) qse_size_t qse_xli_countpairs (qse_xli_t* xli, const qse_xli_list_t* list, const qse_char_t* fqpn)
{ {