reftable/record: introduce function to compare records by key
[alt-git.git] / reftable / generic.h
blob98886a06402d0fbe2414939dcec56a6dd1829f8d
1 /*
2 Copyright 2020 Google LLC
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file or at
6 https://developers.google.com/open-source/licenses/bsd
7 */
9 #ifndef GENERIC_H
10 #define GENERIC_H
12 #include "record.h"
13 #include "reftable-generic.h"
15 /* generic interface to reftables */
16 struct reftable_table_vtable {
17 int (*seek_record)(void *tab, struct reftable_iterator *it,
18 struct reftable_record *);
19 uint32_t (*hash_id)(void *tab);
20 uint64_t (*min_update_index)(void *tab);
21 uint64_t (*max_update_index)(void *tab);
24 struct reftable_iterator_vtable {
25 int (*next)(void *iter_arg, struct reftable_record *rec);
26 void (*close)(void *iter_arg);
29 void iterator_set_empty(struct reftable_iterator *it);
30 int iterator_next(struct reftable_iterator *it, struct reftable_record *rec);
32 #endif