@@ -637,7 +637,7 @@ void reader_close(struct reftable_reader *r)
FREE_AND_NULL(r->name);
}
-int reftable_new_reader(struct reftable_reader **p,
+int reftable_reader_new(struct reftable_reader **p,
struct reftable_block_source *src, char const *name)
{
struct reftable_reader *rd = reftable_calloc(1, sizeof(*rd));
@@ -786,7 +786,7 @@ int reftable_reader_print_blocks(const char *tablename)
if (err < 0)
goto done;
- err = reftable_new_reader(&r, &src, tablename);
+ err = reftable_reader_new(&r, &src, tablename);
if (err < 0)
goto done;
@@ -646,7 +646,7 @@ static void test_write_empty_table(void)
block_source_from_strbuf(&source, &buf);
- err = reftable_new_reader(&rd, &source, "filename");
+ err = reftable_reader_new(&rd, &source, "filename");
EXPECT_ERR(err);
reftable_reader_init_ref_iterator(rd, &it);
@@ -850,7 +850,7 @@ static void test_write_multiple_indices(void)
EXPECT(stats->log_stats.index_offset > 0);
block_source_from_strbuf(&source, &writer_buf);
- err = reftable_new_reader(&reader, &source, "filename");
+ err = reftable_reader_new(&reader, &source, "filename");
EXPECT_ERR(err);
/*
@@ -907,7 +907,7 @@ static void test_write_multi_level_index(void)
EXPECT(stats->ref_stats.max_index_level == 2);
block_source_from_strbuf(&source, &writer_buf);
- err = reftable_new_reader(&reader, &source, "filename");
+ err = reftable_reader_new(&reader, &source, "filename");
EXPECT_ERR(err);
/*
@@ -23,14 +23,14 @@
/* The reader struct is a handle to an open reftable file. */
struct reftable_reader;
-/* reftable_new_reader opens a reftable for reading. If successful,
+/* reftable_reader_new opens a reftable for reading. If successful,
* returns 0 code and sets pp. The name is used for creating a
* stack. Typically, it is the basename of the file. The block source
* `src` is owned by the reader, and is closed on calling
* reftable_reader_destroy(). On error, the block source `src` is
* closed as well.
*/
-int reftable_new_reader(struct reftable_reader **pp,
+int reftable_reader_new(struct reftable_reader **pp,
struct reftable_block_source *src, const char *name);
/* Initialize a reftable iterator for reading refs. */
@@ -258,7 +258,7 @@ static int reftable_stack_reload_once(struct reftable_stack *st,
if (err < 0)
goto done;
- err = reftable_new_reader(&rd, &src, name);
+ err = reftable_reader_new(&rd, &src, name);
if (err < 0)
goto done;
}
@@ -1532,7 +1532,7 @@ static void remove_maybe_stale_table(struct reftable_stack *st, uint64_t max,
if (err < 0)
goto done;
- err = reftable_new_reader(&rd, &src, name);
+ err = reftable_reader_new(&rd, &src, name);
if (err < 0)
goto done;
@@ -139,7 +139,7 @@ static int dump_reftable(const char *tablename)
if (err < 0)
goto done;
- err = reftable_new_reader(&r, &src, tablename);
+ err = reftable_reader_new(&r, &src, tablename);
if (err < 0)
goto done;
@@ -102,7 +102,7 @@ merged_table_from_records(struct reftable_ref_record **refs,
write_test_table(&buf[i], refs[i], sizes[i]);
block_source_from_strbuf(&(*source)[i], &buf[i]);
- err = reftable_new_reader(&(*readers)[i], &(*source)[i],
+ err = reftable_reader_new(&(*readers)[i], &(*source)[i],
"name");
check(!err);
}
@@ -277,7 +277,7 @@ merged_table_from_log_records(struct reftable_log_record **logs,
write_test_log_table(&buf[i], logs[i], sizes[i], i + 1);
block_source_from_strbuf(&(*source)[i], &buf[i]);
- err = reftable_new_reader(&(*readers)[i], &(*source)[i],
+ err = reftable_reader_new(&(*readers)[i], &(*source)[i],
"name");
check(!err);
}
@@ -426,7 +426,7 @@ static void t_default_write_opts(void)
block_source_from_strbuf(&source, &buf);
- err = reftable_new_reader(&rd, &source, "filename");
+ err = reftable_reader_new(&rd, &source, "filename");
check(!err);
hash_id = reftable_reader_hash_id(rd);
Rename the `reftable_new_reader()` function to `reftable_reader_new()` to match our coding guidelines. Signed-off-by: Patrick Steinhardt <ps@pks.im> --- reftable/reader.c | 4 ++-- reftable/readwrite_test.c | 6 +++--- reftable/reftable-reader.h | 4 ++-- reftable/stack.c | 4 ++-- t/helper/test-reftable.c | 2 +- t/unit-tests/t-reftable-merged.c | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-)