Skip to content

Commit c8cbe85

Browse files
pks-tgitster
authored andcommitted
reftable/table: add reftable_table to the public interface
The `reftable_table` interface is an internal implementation detail that callers have no access to. Having direct access to this structure is important though for a subsequent patch series that will implement consistency checks for the reftable backend. Move the structure into "reftable-table.h" so that it part of the public interface. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 50d8459 commit c8cbe85

File tree

2 files changed

+31
-34
lines changed

2 files changed

+31
-34
lines changed

reftable/reftable-table.h

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,38 @@
2020
* reftable_merged_table and struct reftable_stack.
2121
*/
2222

23+
/* Metadata for a block type. */
24+
struct reftable_table_offsets {
25+
int is_present;
26+
uint64_t offset;
27+
uint64_t index_offset;
28+
};
29+
2330
/* The table struct is a handle to an open reftable file. */
24-
struct reftable_table;
31+
struct reftable_table {
32+
/* for convenience, associate a name with the instance. */
33+
char *name;
34+
struct reftable_block_source source;
35+
36+
/* Size of the file, excluding the footer. */
37+
uint64_t size;
38+
39+
/* The hash function used for ref records. */
40+
enum reftable_hash hash_id;
41+
42+
uint32_t block_size;
43+
uint64_t min_update_index;
44+
uint64_t max_update_index;
45+
/* Length of the OID keys in the 'o' section */
46+
int object_id_len;
47+
int version;
48+
49+
struct reftable_table_offsets ref_offsets;
50+
struct reftable_table_offsets obj_offsets;
51+
struct reftable_table_offsets log_offsets;
52+
53+
uint64_t refcount;
54+
};
2555

2656
/* reftable_table_new opens a reftable for reading. If successful,
2757
* returns 0 code and sets pp. The name is used for creating a

reftable/table.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,6 @@
1414
#include "reftable-iterator.h"
1515
#include "reftable-table.h"
1616

17-
/* metadata for a block type */
18-
struct reftable_table_offsets {
19-
int is_present;
20-
uint64_t offset;
21-
uint64_t index_offset;
22-
};
23-
24-
/* The state for reading a reftable file. */
25-
struct reftable_table {
26-
/* for convenience, associate a name with the instance. */
27-
char *name;
28-
struct reftable_block_source source;
29-
30-
/* Size of the file, excluding the footer. */
31-
uint64_t size;
32-
33-
/* The hash function used for ref records. */
34-
enum reftable_hash hash_id;
35-
36-
uint32_t block_size;
37-
uint64_t min_update_index;
38-
uint64_t max_update_index;
39-
/* Length of the OID keys in the 'o' section */
40-
int object_id_len;
41-
int version;
42-
43-
struct reftable_table_offsets ref_offsets;
44-
struct reftable_table_offsets obj_offsets;
45-
struct reftable_table_offsets log_offsets;
46-
47-
uint64_t refcount;
48-
};
49-
5017
const char *reftable_table_name(struct reftable_table *t);
5118

5219
int table_init_iter(struct reftable_table *t,

0 commit comments

Comments
 (0)