From: handa Date: Thu, 22 Sep 2005 07:28:49 +0000 (+0000) Subject: (mplist_conc): New function. X-Git-Tag: REL-1-3-0~147 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=e13725902ed371c1cf24206d1f37692b5d2d3329;p=m17n%2Fm17n-lib.git (mplist_conc): New function. --- diff --git a/src/plist.c b/src/plist.c index 7439751..22f546e 100644 --- a/src/plist.c +++ b/src/plist.c @@ -1153,6 +1153,34 @@ mplist_pop (MPlist *plist) /*=*/ /***en + @brief Concatenate two plists. + + The mplist_conc () function concatenate plist $TAIL at the end of + plist $PLIST. + + @return If the operation was successful, this function return + $PLIST. Otherwise it returns @c NULL. */ + +MPlist * +mplist_conc (MPlist *plist, MPlist *tail) +{ + MPlist *pl; + + MPLIST_DO (pl, plist); + MPLIST_KEY (pl) = MPLIST_KEY (tail); + MPLIST_VAL (pl) = MPLIST_VAL (tail); + MPLIST_NEXT (pl) = MPLIST_NEXT (tail); + if (! MPLIST_TAIL_P (tail)) + { + tail = MPLIST_NEXT (tail); + M17N_OBJECT_REF (tail); + } + return plist; +} + + +/*=*/ +/***en @brief Find a property of a specific key in a property list. The mplist_find_by_key () function searches property list