Skip to content

Commit

Permalink
chunks: expose chunks_directory_exists()
Browse files Browse the repository at this point in the history
  • Loading branch information
gperciva committed Apr 7, 2024
1 parent defd0ee commit 0bb00d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 9 additions & 1 deletion tar/chunks/chunks.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ int chunks_stats_addchunk(CHUNKS_S *, const uint8_t *, size_t, size_t);
void chunks_stats_extrastats(CHUNKS_S *, size_t);

/*
* Function used by --initialize-cachedir.
* Function used by --initialize-cachedir and checking that the cachedir
* exists.
*/

/**
Expand All @@ -272,4 +273,11 @@ void chunks_stats_extrastats(CHUNKS_S *, size_t);
*/
int chunks_initialize(const char *);

/**
* chunks_directory_exists(cachepath):
* Return 1 if the /directory file exists within ${cachepath}, 0 if it does
* not, or -1 if there is an error.
*/
int chunks_directory_exists(const char *);

#endif /* !CHUNKS_H_ */
1 change: 1 addition & 0 deletions tar/chunks/chunks_directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "sysendian.h"
#include "warnp.h"

#include "chunks.h"
#include "chunks_internal.h"

/* On-disk extra data statistics structure; integers are little-endian. */
Expand Down
7 changes: 0 additions & 7 deletions tar/chunks/chunks_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ RWHASHTAB * chunks_directory_read(const char *, void **,
int chunks_directory_write(const char *, RWHASHTAB *, struct chunkstats *,
const char *);

/**
* chunks_directory_exists(cachepath):
* Return 1 if the /directory file exists within ${cachepath}, 0 if it does
* not, or -1 if there is an error.
*/
int chunks_directory_exists(const char *);

/**
* chunks_directory_free(HT, dir):
* Free the hash table ${HT} of struct chunkdata records, all of its
Expand Down

0 comments on commit 0bb00d0

Please sign in to comment.