add single instance mode
[uwplayer.git] / ucx / cx / iterator.h
index f2e2d71..26232aa 100644 (file)
@@ -51,6 +51,8 @@ struct cx_iterator_base_s {
 
     /**
      * Returns a pointer to the current element.
+     *
+     * When valid returns false, the behavior of this function is undefined.
      */
     __attribute__ ((__nonnull__))
     void *(*current)(void const *);
@@ -63,18 +65,22 @@ struct cx_iterator_base_s {
 
     /**
      * Advances the iterator.
+     *
+     * When valid returns false, the behavior of this function is undefined.
      */
     __attribute__ ((__nonnull__))
     void (*next)(void *);
 
     /**
      * Flag current element for removal, if possible.
+     *
+     * When valid returns false, the behavior of this function is undefined.
      */
     __attribute__ ((__nonnull__))
     bool (*flag_removal)(void *);
 
     /**
-     * Indicates whether this iterator is muting.
+     * Indicates whether this iterator may remove elements.
      */
     bool mutating;
 
@@ -198,13 +204,13 @@ struct cx_iterator_s {
 
 /**
  * Iterator value type.
- * An iterator points to a certain element in an (possibly unbounded) chain of elements.
+ * An iterator points to a certain element in a (possibly unbounded) chain of elements.
  * Iterators that are based on collections (which have a defined "first" element), are supposed
  * to be "position-aware", which means that they keep track of the current index within the collection.
  *
  * @note Objects that are pointed to by an iterator are always mutable through that iterator. However,
  * this iterator cannot mutate the collection itself (add or remove elements) and any mutation of the
- * collection by other means make this iterator invalid (regardless of what cxIteratorValid() returns).
+ * collection by other means makes this iterator invalid (regardless of what cxIteratorValid() returns).
  *
  * @see CxMutIterator
  */