@@ -20,11 +20,11 @@ static struct reftable_table_offsets *
2020table_offsets_for (struct reftable_table * t , uint8_t typ )
2121{
2222 switch (typ ) {
23- case BLOCK_TYPE_REF :
23+ case REFTABLE_BLOCK_TYPE_REF :
2424 return & t -> ref_offsets ;
25- case BLOCK_TYPE_LOG :
25+ case REFTABLE_BLOCK_TYPE_LOG :
2626 return & t -> log_offsets ;
27- case BLOCK_TYPE_OBJ :
27+ case REFTABLE_BLOCK_TYPE_OBJ :
2828 return & t -> obj_offsets ;
2929 }
3030 abort ();
@@ -112,9 +112,9 @@ static int parse_footer(struct reftable_table *t, uint8_t *footer,
112112 }
113113
114114 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 );
116116 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 ||
118118 t -> log_offsets .offset > 0 );
119119 t -> obj_offsets .is_present = t -> obj_offsets .offset > 0 ;
120120 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,
150150 struct reftable_record * rec )
151151{
152152 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 ) {
154154 rec -> u .ref .update_index += ti -> table -> min_update_index ;
155155 }
156156
@@ -177,7 +177,7 @@ int table_init_block(struct reftable_table *t, struct reftable_block *block,
177177 if (err < 0 )
178178 goto done ;
179179
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 ) {
181181 err = 1 ;
182182 goto done ;
183183 }
@@ -270,7 +270,7 @@ static int table_iter_seek_start(struct table_iter *ti, uint8_t typ, int index)
270270 if (off == 0 ) {
271271 return 1 ;
272272 }
273- typ = BLOCK_TYPE_INDEX ;
273+ typ = REFTABLE_BLOCK_TYPE_INDEX ;
274274 }
275275
276276 return table_iter_seek_to (ti , off , typ );
@@ -366,10 +366,10 @@ static int table_iter_seek_indexed(struct table_iter *ti,
366366 struct reftable_record * rec )
367367{
368368 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 }
370370 };
371371 struct reftable_record index_result = {
372- .type = BLOCK_TYPE_INDEX ,
372+ .type = REFTABLE_BLOCK_TYPE_INDEX ,
373373 .u .idx = { .last_key = REFTABLE_BUF_INIT },
374374 };
375375 int err ;
@@ -429,7 +429,7 @@ static int table_iter_seek_indexed(struct table_iter *ti,
429429 break ;
430430 }
431431
432- if (ti -> typ != BLOCK_TYPE_INDEX ) {
432+ if (ti -> typ != REFTABLE_BLOCK_TYPE_INDEX ) {
433433 err = REFTABLE_FORMAT_ERROR ;
434434 goto done ;
435435 }
@@ -517,13 +517,13 @@ int table_init_iter(struct reftable_table *t,
517517int reftable_table_init_ref_iterator (struct reftable_table * t ,
518518 struct reftable_iterator * it )
519519{
520- return table_init_iter (t , it , BLOCK_TYPE_REF );
520+ return table_init_iter (t , it , REFTABLE_BLOCK_TYPE_REF );
521521}
522522
523523int reftable_table_init_log_iterator (struct reftable_table * t ,
524524 struct reftable_iterator * it )
525525{
526- return table_init_iter (t , it , BLOCK_TYPE_LOG );
526+ return table_init_iter (t , it , REFTABLE_BLOCK_TYPE_LOG );
527527}
528528
529529int reftable_table_new (struct reftable_table * * out ,
@@ -625,22 +625,22 @@ static int reftable_table_refs_for_indexed(struct reftable_table *t,
625625 uint8_t * oid )
626626{
627627 struct reftable_record want = {
628- .type = BLOCK_TYPE_OBJ ,
628+ .type = REFTABLE_BLOCK_TYPE_OBJ ,
629629 .u .obj = {
630630 .hash_prefix = oid ,
631631 .hash_prefix_len = t -> object_id_len ,
632632 },
633633 };
634634 struct reftable_iterator oit = { NULL };
635635 struct reftable_record got = {
636- .type = BLOCK_TYPE_OBJ ,
636+ .type = REFTABLE_BLOCK_TYPE_OBJ ,
637637 .u .obj = { 0 },
638638 };
639639 int err = 0 ;
640640 struct indexed_table_ref_iter * itr = NULL ;
641641
642642 /* 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 );
644644 if (err < 0 )
645645 goto done ;
646646
@@ -692,7 +692,7 @@ static int reftable_table_refs_for_unindexed(struct reftable_table *t,
692692 }
693693
694694 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 );
696696 if (err < 0 )
697697 goto out ;
698698
@@ -748,15 +748,15 @@ int reftable_table_print_blocks(const char *tablename)
748748 } sections [] = {
749749 {
750750 .name = "ref" ,
751- .type = BLOCK_TYPE_REF ,
751+ .type = REFTABLE_BLOCK_TYPE_REF ,
752752 },
753753 {
754754 .name = "obj" ,
755- .type = BLOCK_TYPE_OBJ ,
755+ .type = REFTABLE_BLOCK_TYPE_OBJ ,
756756 },
757757 {
758758 .name = "log" ,
759- .type = BLOCK_TYPE_LOG ,
759+ .type = REFTABLE_BLOCK_TYPE_LOG ,
760760 },
761761 };
762762 struct reftable_block_source src = { 0 };
0 commit comments