git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
c92a178773db54a8a191da07f0c9ad6d6382afb0 blob 1984 bytes (raw)

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 
/*
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 ITER_H
#define ITER_H

#include "block.h"
#include "record.h"
#include "strbuf.h"

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);

/* Returns true for a zeroed out iterator, such as the one returned from
   iterator_destroy. */
int iterator_is_null(struct reftable_iterator *it);

/* iterator that produces only ref records that point to `oid` */
struct filtering_ref_iterator {
	int double_check;
	struct reftable_table tab;
	struct strbuf oid;
	struct reftable_iterator it;
};
#define FILTERING_REF_ITERATOR_INIT \
	{                           \
		.oid = STRBUF_INIT  \
	}

void iterator_from_filtering_ref_iterator(struct reftable_iterator *,
					  struct filtering_ref_iterator *);

/* iterator that produces only ref records that point to `oid`,
   but using the object index.
 */
struct indexed_table_ref_iter {
	struct reftable_reader *r;
	struct strbuf oid;

	/* mutable */
	uint64_t *offsets;

	/* Points to the next offset to read. */
	int offset_idx;
	int offset_len;
	struct block_reader block_reader;
	struct block_iter cur;
	int is_finished;
};

#define INDEXED_TABLE_REF_ITER_INIT                                     \
	{                                                               \
		.cur = { .last_key = STRBUF_INIT }, .oid = STRBUF_INIT, \
	}

void iterator_from_indexed_table_ref_iter(struct reftable_iterator *it,
					  struct indexed_table_ref_iter *itr);
int new_indexed_table_ref_iter(struct indexed_table_ref_iter **dest,
			       struct reftable_reader *r, uint8_t *oid,
			       int oid_len, uint64_t *offsets, int offset_len);

#endif
debug log:

solving c92a178773 ...
found c92a178773 in https://public-inbox.org/git/25259b683bc35b4f6741c1b2b07b41b99019c088.1600283416.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/c196de7f0639f42133cf520c0e04db8a23c7e8ce.1601568664.git.gitgitgadget@gmail.com/

applying [1/2] https://public-inbox.org/git/25259b683bc35b4f6741c1b2b07b41b99019c088.1600283416.git.gitgitgadget@gmail.com/
diff --git a/reftable/iter.h b/reftable/iter.h
new file mode 100644
index 0000000000..c92a178773

Checking patch reftable/iter.h...
Applied patch reftable/iter.h cleanly.

skipping https://public-inbox.org/git/c196de7f0639f42133cf520c0e04db8a23c7e8ce.1601568664.git.gitgitgadget@gmail.com/ for c92a178773
index at:
100644 c92a178773db54a8a191da07f0c9ad6d6382afb0	reftable/iter.h

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git