]> git.ipfire.org Git - thirdparty/git.git/blame - reftable/reftable-iterator.h
reftable: handle null refnames in reftable_ref_record_equal
[thirdparty/git.git] / reftable / reftable-iterator.h
CommitLineData
17df8dbe
HWN
1/*
2Copyright 2020 Google LLC
3
4Use of this source code is governed by a BSD-style
5license that can be found in the LICENSE file or at
6https://developers.google.com/open-source/licenses/bsd
7*/
8
9#ifndef REFTABLE_ITERATOR_H
10#define REFTABLE_ITERATOR_H
11
12#include "reftable-record.h"
13
14struct reftable_iterator_vtable;
15
16/* iterator is the generic interface for walking over data stored in a
17 * reftable.
18 */
19struct reftable_iterator {
20 struct reftable_iterator_vtable *ops;
21 void *iter_arg;
22};
23
24/* reads the next reftable_ref_record. Returns < 0 for error, 0 for OK and > 0:
25 * end of iteration.
26 */
27int reftable_iterator_next_ref(struct reftable_iterator *it,
28 struct reftable_ref_record *ref);
29
30/* reads the next reftable_log_record. Returns < 0 for error, 0 for OK and > 0:
31 * end of iteration.
32 */
33int reftable_iterator_next_log(struct reftable_iterator *it,
34 struct reftable_log_record *log);
35
36/* releases resources associated with an iterator. */
37void reftable_iterator_destroy(struct reftable_iterator *it);
38
39#endif