[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59566] branches/soc-2013-paint/source/ blender/blenlib: move doxy docs out of the ghash header into the C file.
Antony Riakiotakis
kalast at gmail.com
Tue Aug 27 21:26:03 CEST 2013
Revision: 59566
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59566
Author: psy-fi
Date: 2013-08-27 19:26:03 +0000 (Tue, 27 Aug 2013)
Log Message:
-----------
move doxy docs out of the ghash header into the C file.
Modified Paths:
--------------
branches/soc-2013-paint/source/blender/blenlib/BLI_ghash.h
branches/soc-2013-paint/source/blender/blenlib/intern/BLI_ghash.c
Modified: branches/soc-2013-paint/source/blender/blenlib/BLI_ghash.h
===================================================================
--- branches/soc-2013-paint/source/blender/blenlib/BLI_ghash.h 2013-08-27 19:25:58 UTC (rev 59565)
+++ branches/soc-2013-paint/source/blender/blenlib/BLI_ghash.h 2013-08-27 19:26:03 UTC (rev 59566)
@@ -78,62 +78,17 @@
/* *** */
-/**
- * Create a new GHashIterator. The hash table must not be mutated
- * while the iterator is in use, and the iterator will step exactly
- * BLI_ghash_size(gh) times before becoming done.
- *
- * \param gh The GHash to iterate over.
- * \return Pointer to a new DynStr.
- */
GHashIterator *BLI_ghashIterator_new(GHash *gh);
-/**
- * Init an already allocated GHashIterator. The hash table must not
- * be mutated while the iterator is in use, and the iterator will
- * step exactly BLI_ghash_size(gh) times before becoming done.
- *
- * \param ghi The GHashIterator to initialize.
- * \param gh The GHash to iterate over.
- */
-void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh);
-/**
- * Free a GHashIterator.
- *
- * \param ghi The iterator to free.
- */
-void BLI_ghashIterator_free(GHashIterator *ghi);
-/**
- * Retrieve the key from an iterator.
- *
- * \param ghi The iterator.
- * \return The key at the current index, or NULL if the
- * iterator is done.
- */
-void *BLI_ghashIterator_getKey(GHashIterator *ghi);
-/**
- * Retrieve the value from an iterator.
- *
- * \param ghi The iterator.
- * \return The value at the current index, or NULL if the
- * iterator is done.
- */
-void *BLI_ghashIterator_getValue(GHashIterator *ghi);
-/**
- * Steps the iterator to the next index.
- *
- * \param ghi The iterator.
- */
-void BLI_ghashIterator_step(GHashIterator *ghi);
-/**
- * Determine if an iterator is done (has reached the end of
- * the hash table).
- *
- * \param ghi The iterator.
- * \return True if done, False otherwise.
- */
-bool BLI_ghashIterator_done(GHashIterator *ghi);
+void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh);
+void BLI_ghashIterator_free(GHashIterator *ghi);
+void *BLI_ghashIterator_getKey(GHashIterator *ghi);
+void *BLI_ghashIterator_getValue(GHashIterator *ghi);
+
+void BLI_ghashIterator_step(GHashIterator *ghi);
+bool BLI_ghashIterator_done(GHashIterator *ghi);
+
#define GHASH_ITER(gh_iter_, ghash_) \
for (BLI_ghashIterator_init(&gh_iter_, ghash_); \
BLI_ghashIterator_done(&gh_iter_) == false; \
Modified: branches/soc-2013-paint/source/blender/blenlib/intern/BLI_ghash.c
===================================================================
--- branches/soc-2013-paint/source/blender/blenlib/intern/BLI_ghash.c 2013-08-27 19:25:58 UTC (rev 59565)
+++ branches/soc-2013-paint/source/blender/blenlib/intern/BLI_ghash.c 2013-08-27 19:26:03 UTC (rev 59566)
@@ -486,12 +486,29 @@
/** \name Iterator API
* \{ */
+/**
+ * Create a new GHashIterator. The hash table must not be mutated
+ * while the iterator is in use, and the iterator will step exactly
+ * BLI_ghash_size(gh) times before becoming done.
+ *
+ * \param gh The GHash to iterate over.
+ * \return Pointer to a new DynStr.
+ */
GHashIterator *BLI_ghashIterator_new(GHash *gh)
{
GHashIterator *ghi = MEM_mallocN(sizeof(*ghi), "ghash iterator");
BLI_ghashIterator_init(ghi, gh);
return ghi;
}
+
+/**
+ * Init an already allocated GHashIterator. The hash table must not
+ * be mutated while the iterator is in use, and the iterator will
+ * step exactly BLI_ghash_size(gh) times before becoming done.
+ *
+ * \param ghi The GHashIterator to initialize.
+ * \param gh The GHash to iterate over.
+ */
void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh)
{
ghi->gh = gh;
@@ -504,20 +521,46 @@
ghi->curEntry = ghi->gh->buckets[ghi->curBucket];
}
}
+
+/**
+ * Free a GHashIterator.
+ *
+ * \param ghi The iterator to free.
+ */
void BLI_ghashIterator_free(GHashIterator *ghi)
{
MEM_freeN(ghi);
}
+/**
+ * Retrieve the key from an iterator.
+ *
+ * \param ghi The iterator.
+ * \return The key at the current index, or NULL if the
+ * iterator is done.
+ */
void *BLI_ghashIterator_getKey(GHashIterator *ghi)
{
return ghi->curEntry ? ghi->curEntry->key : NULL;
}
+
+/**
+ * Retrieve the value from an iterator.
+ *
+ * \param ghi The iterator.
+ * \return The value at the current index, or NULL if the
+ * iterator is done.
+ */
void *BLI_ghashIterator_getValue(GHashIterator *ghi)
{
return ghi->curEntry ? ghi->curEntry->val : NULL;
}
+/**
+ * Steps the iterator to the next index.
+ *
+ * \param ghi The iterator.
+ */
void BLI_ghashIterator_step(GHashIterator *ghi)
{
if (ghi->curEntry) {
@@ -530,6 +573,14 @@
}
}
}
+
+/**
+ * Determine if an iterator is done (has reached the end of
+ * the hash table).
+ *
+ * \param ghi The iterator.
+ * \return True if done, False otherwise.
+ */
bool BLI_ghashIterator_done(GHashIterator *ghi)
{
return ghi->curEntry == NULL;
More information about the Bf-blender-cvs
mailing list