X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=vector%2Fhashvector.h;h=b57aede5a0a5e9241993adb6aab4b324c87e4596;hb=1598c2a362fec3de547616cb8020a315631a4c15;hp=ec7eb8f594a4c9b74cb1c9cfe136df6e51a4c159;hpb=47f0e2bd1cc8942f5c92ffa2f37db416d98d9e9e;p=rrq%2Frrqmisc.git diff --git a/vector/hashvector.h b/vector/hashvector.h index ec7eb8f..b57aede 100644 --- a/vector/hashvector.h +++ b/vector/hashvector.h @@ -134,16 +134,23 @@ extern int hashvector_delete(hashvector *hv,void *item); * * \param hv is the \ref hashvector concerned. * - * \param pv is the \ref vector to copy the content into. + * \param variant is the desired vector variant. * - * \returns \b -1 if the required resizing of the \ref vector to the - * \ref hashvector \b fill fails, otherwise \b 0 after having copied - * the hashvector items in their internal order of appearance into the - * \ref vector. + * \param pv is the optional \ref vector to copy the content into. + * + * \returns the \ref vector with the \ref hashvector content + * + * If \pv is null, then a new vector is allocated and handed out for + * the caller to reclaim unless the hashvector is empty in which case + * this function returns 0. + * + * If \b pv is not null, it is first cleared, and then populated with + * the content from the hashvector. The populated vector is returned. * * \related hashvector */ -extern int hashvector_contents(hashvector *hv,vector *pv); +extern vector *hashvector_contents( + hashvector *hv,enum vector_variant variant,vector *pv); /** * \brief This is a utility function to compute and return a hashcode @@ -172,6 +179,8 @@ extern unsigned long hashvector_hashcode(unsigned char *key,unsigned long n); * \note The \ref hashvector record is allocated with malloc and the * caller is responsible for free-ing the memory block when it's no * longer needed. + * + * \related hashvector */ extern hashvector *hashvector_create( enum vector_variant variant,itemkeyfun *type);