third_party/cairo/src/cairo-hash.c
void
_cairo_hash_table_foreach (cairo_hash_table_t	      *hash_table,
			   cairo_hash_callback_func_t  hash_callback,
			   void			      *closure)
{
    unsigned long i;
    cairo_hash_entry_t *entry;

    /* Mark the table for iteration */
    ++hash_table->iterating;
    for (i = 0; i < *hash_table->table_size; i++) {
	entry = hash_table->entries[i];
	if (ENTRY_IS_LIVE(entry))
	    hash_callback (entry, closure);
    }
    /* If some elements were deleted during the iteration,
     * the table may need resizing. Just do this every time
     * as the check is inexpensive.
     */
    if (--hash_table->iterating == 0) {
	/* Should we fail to shrink the hash table, it is left unaltered,
	 * and we don't need to propagate the error status. */
	_cairo_hash_table_manage (hash_table);
    }
}
/**
 * _cairo_hash_table_foreach:
 * @hash_table: a hash table
 * @hash_callback: function to be called for each live entry
 * @closure: additional argument to be passed to @hash_callback
 *
 * Call @hash_callback for each live entry in the hash table, in a
 * non-specified order.
 *
 * Entries in @hash_table may be removed by code executed from @hash_callback.
 *
 * Entries may not be inserted to @hash_table, nor may @hash_table
 * be destroyed by code executed from @hash_callback. The relevant
 * functions will halt in these cases.
 **/
@hash_table: a hash table
@hash_callback: function to be called for each live entry
@closure: additional argument to be passed to @hash_callback

Call @hash_callback for each live entry in the hash table, in a
non-specified order.

Entries in @hash_table may be removed by code executed from @hash_callback.

Entries may not be inserted to @hash_table, nor may @hash_table
be destroyed by code executed from @hash_callback. The relevant
functions will halt in these cases.
@hash_table : a hash table @hash_callback : function to be called for each live entry @closure : additional argument to be passed to @hash_callback Call @hash_callback for each live entry in the hash table in a non - specified order . Entries in @hash_table may be removed by code executed from @hash_callback . Entries may not be inserted to @hash_table nor may @hash_table be destroyed by code executed from @hash_callback . The relevant functions will halt in these cases .
void
_cairo_hash_table_foreach (cairo_hash_table_t	      *hash_table,
			   cairo_hash_callback_func_t  hash_callback,
			   void			      *closure)
{
    unsigned long i;
    cairo_hash_entry_t *entry;
    ++hash_table->iterating;
    for (i = 0; i < *hash_table->table_size; i++) {
	entry = hash_table->entries[i];
	if (ENTRY_IS_LIVE(entry))
	    hash_callback (entry, closure);
    }
    if (--hash_table->iterating == 0) {
	_cairo_hash_table_manage (hash_table);
    }
}
void _cairo_hash_table_foreach ( cairo_hash_table_t * hash_table , cairo_hash_callback_func_t hash_callback , void * closure ) { unsigned long i ; cairo_hash_entry_t * entry ; ++ hash_table -> iterating ; for ( i = 0 ; i < * hash_table -> table_size ; i ++ ) { entry = hash_table -> entries [ i ] ; if ( ENTRY_IS_LIVE ( entry ) ) hash_callback ( entry , closure ) ; } if ( -- hash_table -> iterating == 0 ) { _cairo_hash_table_manage ( hash_table ) ; } }
_cairo_hash_table_foreach:
 @hash_table: a hash table
 @hash_callback: function to be called for each live entry
 @closure: additional argument to be passed to @hash_callback
_cairo_hash_table_foreach : @hash_table : a hash table @hash_callback : function to be called for each live entry @closure : additional argument to be passed to @hash_callback
/* Mark the table for iteration */ /* If some elements were deleted during the iteration,
     * the table may need resizing. Just do this every time
     * as the check is inexpensive.
     */ /* Should we fail to shrink the hash table, it is left unaltered,
	 * and we don't need to propagate the error status. */