@@ -20,11 +20,11 @@ static struct reftable_table_offsets *
20
20
table_offsets_for (struct reftable_table * t , uint8_t typ )
21
21
{
22
22
switch (typ ) {
23
- case BLOCK_TYPE_REF :
23
+ case REFTABLE_BLOCK_TYPE_REF :
24
24
return & t -> ref_offsets ;
25
- case BLOCK_TYPE_LOG :
25
+ case REFTABLE_BLOCK_TYPE_LOG :
26
26
return & t -> log_offsets ;
27
- case BLOCK_TYPE_OBJ :
27
+ case REFTABLE_BLOCK_TYPE_OBJ :
28
28
return & t -> obj_offsets ;
29
29
}
30
30
abort ();
@@ -112,9 +112,9 @@ static int parse_footer(struct reftable_table *t, uint8_t *footer,
112
112
}
113
113
114
114
first_block_typ = header [header_size (t -> version )];
115
- t -> ref_offsets .is_present = (first_block_typ == BLOCK_TYPE_REF );
115
+ t -> ref_offsets .is_present = (first_block_typ == REFTABLE_BLOCK_TYPE_REF );
116
116
t -> ref_offsets .offset = 0 ;
117
- t -> log_offsets .is_present = (first_block_typ == BLOCK_TYPE_LOG ||
117
+ t -> log_offsets .is_present = (first_block_typ == REFTABLE_BLOCK_TYPE_LOG ||
118
118
t -> log_offsets .offset > 0 );
119
119
t -> obj_offsets .is_present = t -> obj_offsets .offset > 0 ;
120
120
if (t -> obj_offsets .is_present && !t -> object_id_len ) {
@@ -150,7 +150,7 @@ static int table_iter_next_in_block(struct table_iter *ti,
150
150
struct reftable_record * rec )
151
151
{
152
152
int res = block_iter_next (& ti -> bi , rec );
153
- if (res == 0 && reftable_record_type (rec ) == BLOCK_TYPE_REF ) {
153
+ if (res == 0 && reftable_record_type (rec ) == REFTABLE_BLOCK_TYPE_REF ) {
154
154
rec -> u .ref .update_index += ti -> table -> min_update_index ;
155
155
}
156
156
@@ -177,7 +177,7 @@ int table_init_block(struct reftable_table *t, struct reftable_block *block,
177
177
if (err < 0 )
178
178
goto done ;
179
179
180
- if (want_typ != BLOCK_TYPE_ANY && block -> block_type != want_typ ) {
180
+ if (want_typ != REFTABLE_BLOCK_TYPE_ANY && block -> block_type != want_typ ) {
181
181
err = 1 ;
182
182
goto done ;
183
183
}
@@ -270,7 +270,7 @@ static int table_iter_seek_start(struct table_iter *ti, uint8_t typ, int index)
270
270
if (off == 0 ) {
271
271
return 1 ;
272
272
}
273
- typ = BLOCK_TYPE_INDEX ;
273
+ typ = REFTABLE_BLOCK_TYPE_INDEX ;
274
274
}
275
275
276
276
return table_iter_seek_to (ti , off , typ );
@@ -366,10 +366,10 @@ static int table_iter_seek_indexed(struct table_iter *ti,
366
366
struct reftable_record * rec )
367
367
{
368
368
struct reftable_record want_index = {
369
- .type = BLOCK_TYPE_INDEX , .u .idx = { .last_key = REFTABLE_BUF_INIT }
369
+ .type = REFTABLE_BLOCK_TYPE_INDEX , .u .idx = { .last_key = REFTABLE_BUF_INIT }
370
370
};
371
371
struct reftable_record index_result = {
372
- .type = BLOCK_TYPE_INDEX ,
372
+ .type = REFTABLE_BLOCK_TYPE_INDEX ,
373
373
.u .idx = { .last_key = REFTABLE_BUF_INIT },
374
374
};
375
375
int err ;
@@ -429,7 +429,7 @@ static int table_iter_seek_indexed(struct table_iter *ti,
429
429
break ;
430
430
}
431
431
432
- if (ti -> typ != BLOCK_TYPE_INDEX ) {
432
+ if (ti -> typ != REFTABLE_BLOCK_TYPE_INDEX ) {
433
433
err = REFTABLE_FORMAT_ERROR ;
434
434
goto done ;
435
435
}
@@ -517,13 +517,13 @@ int table_init_iter(struct reftable_table *t,
517
517
int reftable_table_init_ref_iterator (struct reftable_table * t ,
518
518
struct reftable_iterator * it )
519
519
{
520
- return table_init_iter (t , it , BLOCK_TYPE_REF );
520
+ return table_init_iter (t , it , REFTABLE_BLOCK_TYPE_REF );
521
521
}
522
522
523
523
int reftable_table_init_log_iterator (struct reftable_table * t ,
524
524
struct reftable_iterator * it )
525
525
{
526
- return table_init_iter (t , it , BLOCK_TYPE_LOG );
526
+ return table_init_iter (t , it , REFTABLE_BLOCK_TYPE_LOG );
527
527
}
528
528
529
529
int reftable_table_new (struct reftable_table * * out ,
@@ -625,22 +625,22 @@ static int reftable_table_refs_for_indexed(struct reftable_table *t,
625
625
uint8_t * oid )
626
626
{
627
627
struct reftable_record want = {
628
- .type = BLOCK_TYPE_OBJ ,
628
+ .type = REFTABLE_BLOCK_TYPE_OBJ ,
629
629
.u .obj = {
630
630
.hash_prefix = oid ,
631
631
.hash_prefix_len = t -> object_id_len ,
632
632
},
633
633
};
634
634
struct reftable_iterator oit = { NULL };
635
635
struct reftable_record got = {
636
- .type = BLOCK_TYPE_OBJ ,
636
+ .type = REFTABLE_BLOCK_TYPE_OBJ ,
637
637
.u .obj = { 0 },
638
638
};
639
639
int err = 0 ;
640
640
struct indexed_table_ref_iter * itr = NULL ;
641
641
642
642
/* Look through the reverse index. */
643
- err = table_init_iter (t , & oit , BLOCK_TYPE_OBJ );
643
+ err = table_init_iter (t , & oit , REFTABLE_BLOCK_TYPE_OBJ );
644
644
if (err < 0 )
645
645
goto done ;
646
646
@@ -692,7 +692,7 @@ static int reftable_table_refs_for_unindexed(struct reftable_table *t,
692
692
}
693
693
694
694
table_iter_init (ti , t );
695
- err = table_iter_seek_start (ti , BLOCK_TYPE_REF , 0 );
695
+ err = table_iter_seek_start (ti , REFTABLE_BLOCK_TYPE_REF , 0 );
696
696
if (err < 0 )
697
697
goto out ;
698
698
@@ -748,15 +748,15 @@ int reftable_table_print_blocks(const char *tablename)
748
748
} sections [] = {
749
749
{
750
750
.name = "ref" ,
751
- .type = BLOCK_TYPE_REF ,
751
+ .type = REFTABLE_BLOCK_TYPE_REF ,
752
752
},
753
753
{
754
754
.name = "obj" ,
755
- .type = BLOCK_TYPE_OBJ ,
755
+ .type = REFTABLE_BLOCK_TYPE_OBJ ,
756
756
},
757
757
{
758
758
.name = "log" ,
759
- .type = BLOCK_TYPE_LOG ,
759
+ .type = REFTABLE_BLOCK_TYPE_LOG ,
760
760
},
761
761
};
762
762
struct reftable_block_source src = { 0 };
0 commit comments