File: generic.h

package info (click to toggle)
git 1%3A2.39.5-0%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 56,868 kB
  • sloc: ansic: 276,518; sh: 234,536; perl: 30,909; tcl: 22,191; makefile: 4,185; python: 3,412; javascript: 772; csh: 45; ruby: 43; lisp: 12
file content (32 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
Copyright 2020 Google LLC

Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file or at
https://developers.google.com/open-source/licenses/bsd
*/

#ifndef GENERIC_H
#define GENERIC_H

#include "record.h"
#include "reftable-generic.h"

/* generic interface to reftables */
struct reftable_table_vtable {
	int (*seek_record)(void *tab, struct reftable_iterator *it,
			   struct reftable_record *);
	uint32_t (*hash_id)(void *tab);
	uint64_t (*min_update_index)(void *tab);
	uint64_t (*max_update_index)(void *tab);
};

struct reftable_iterator_vtable {
	int (*next)(void *iter_arg, struct reftable_record *rec);
	void (*close)(void *iter_arg);
};

void iterator_set_empty(struct reftable_iterator *it);
int iterator_next(struct reftable_iterator *it, struct reftable_record *rec);

#endif