Subversion
Macros | Typedefs | Functions
svn_iter.h File Reference

The Subversion Iteration drivers helper routines. More...

#include <apr.h>
#include <apr_pools.h>
#include <apr_hash.h>
#include <apr_tables.h>
#include "svn_types.h"

Go to the source code of this file.

Macros

#define svn_iter_break(pool)   return svn_iter__break()
 Helper macro to break looping in svn_iter_apr_array() and svn_iter_apr_hash() driven loops. More...
 

Typedefs

typedef svn_error_t *(* svn_iter_apr_hash_cb_t) (void *baton, const void *key, apr_ssize_t klen, void *val, apr_pool_t *pool)
 Callback function for use with svn_iter_apr_hash(). More...
 
typedef svn_error_t *(* svn_iter_apr_array_cb_t) (void *baton, void *item, apr_pool_t *pool)
 Iteration callback used in conjunction with svn_iter_apr_array(). More...
 

Functions

svn_error_tsvn_iter_apr_hash (svn_boolean_t *completed, apr_hash_t *hash, svn_iter_apr_hash_cb_t func, void *baton, apr_pool_t *pool)
 Iterate over the elements in hash, calling func for each one until there are no more elements or func returns an error. More...
 
svn_error_tsvn_iter_apr_array (svn_boolean_t *completed, const apr_array_header_t *array, svn_iter_apr_array_cb_t func, void *baton, apr_pool_t *pool)
 Iterate over the elements in array calling func for each one until there are no more elements or func returns an error. More...
 
svn_error_tsvn_iter__break (void)
 Internal routine used by svn_iter_break() macro.
 

Detailed Description

The Subversion Iteration drivers helper routines.

@if copyrights

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations

under the License.

Definition in file svn_iter.h.

Macro Definition Documentation

◆ svn_iter_break

#define svn_iter_break (   pool)    return svn_iter__break()

Helper macro to break looping in svn_iter_apr_array() and svn_iter_apr_hash() driven loops.

Note
The error is just a means of communicating between driver and callback. There is no need for it to exist past the lifetime of the iterpool.
Since
New in 1.5.

Definition at line 132 of file svn_iter.h.

Typedef Documentation

◆ svn_iter_apr_array_cb_t

typedef svn_error_t*(* svn_iter_apr_array_cb_t) (void *baton, void *item, apr_pool_t *pool)

Iteration callback used in conjunction with svn_iter_apr_array().

Use pool for temporary allocation, it's cleared between invocations.

baton is the baton passed to svn_iter_apr_array(). item is a pointer to the item written to the array with the APR_ARRAY_PUSH() macro.

Since
New in 1.5.

Definition at line 90 of file svn_iter.h.

◆ svn_iter_apr_hash_cb_t

typedef svn_error_t*(* svn_iter_apr_hash_cb_t) (void *baton, const void *key, apr_ssize_t klen, void *val, apr_pool_t *pool)

Callback function for use with svn_iter_apr_hash().

Use pool for temporary allocation, it's cleared between invocations.

key, klen and val are the values normally retrieved with apr_hash_this().

baton is the baton passed into svn_iter_apr_hash().

Since
New in 1.5.

Definition at line 53 of file svn_iter.h.

Function Documentation

◆ svn_iter_apr_array()

svn_error_t* svn_iter_apr_array ( svn_boolean_t completed,
const apr_array_header_t *  array,
svn_iter_apr_array_cb_t  func,
void *  baton,
apr_pool_t *  pool 
)

Iterate over the elements in array calling func for each one until there are no more elements or func returns an error.

Uses pool for temporary allocations.

If completed is not NULL, then on return - if func returns no errors - *completed will be set to TRUE.

If func returns an error other than SVN_ERR_ITER_BREAK, that error is returned. When func returns SVN_ERR_ITER_BREAK, iteration is interrupted, but no error is returned and *completed is set to FALSE (even if this iteration was the last one).

Since
New in 1.5.

◆ svn_iter_apr_hash()

svn_error_t* svn_iter_apr_hash ( svn_boolean_t completed,
apr_hash_t *  hash,
svn_iter_apr_hash_cb_t  func,
void *  baton,
apr_pool_t *  pool 
)

Iterate over the elements in hash, calling func for each one until there are no more elements or func returns an error.

Uses pool for temporary allocations.

If completed is not NULL, then on return - if func returns no errors - *completed will be set to TRUE.

If func returns an error other than SVN_ERR_ITER_BREAK, that error is returned. When func returns SVN_ERR_ITER_BREAK, iteration is interrupted, but no error is returned and *completed is set to FALSE (even if this iteration was the last one).

Since
New in 1.5.