summaryrefslogtreecommitdiff
path: root/include/meta_writer.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-20 11:56:28 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-20 12:02:53 +0200
commit13cc42ce135155f0437298540b0bc5a821d7a644 (patch)
tree18acd391d928db760a73d8b7c5231899ec7e7812 /include/meta_writer.h
parentc2e01ed987e942005fa66f11d96b8edb1d930c99 (diff)
cleanup: remove overly excessive comments
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/meta_writer.h')
-rw-r--r--include/meta_writer.h59
1 files changed, 7 insertions, 52 deletions
diff --git a/include/meta_writer.h b/include/meta_writer.h
index 6bcb29b..7036b6a 100644
--- a/include/meta_writer.h
+++ b/include/meta_writer.h
@@ -7,69 +7,24 @@
typedef struct meta_writer_t meta_writer_t;
-/**
- * @brief Create a meta data writer
- *
- * @memberof meta_writer_t
- *
- * @note This function internally prints error message to stderr on failure
- *
- * @param fd The underlying file descriptor to write from
- * @param cmp A pointer to a compressor to use for compressing the data
- *
- * @return A pointer to a meta data writer, NULL on failure
- */
+/* Create a meta data reader using a given compressor to compress data.
+ Internally prints error message to stderr on failure. */
meta_writer_t *meta_writer_create(int fd, compressor_t *cmp);
-/**
- * @brief Destroy a meta data writer and free all memory used by it
- *
- * @memberof meta_writer_t
- *
- * @param m A pointer to a meta data reader
- */
void meta_writer_destroy(meta_writer_t *m);
-/**
- * @brief Flush the currently unfinished meta data block to disk
- *
- * @memberof meta_writer_t
- *
- * @note This function internally prints error message to stderr on failure
- *
- * If data has been collected in the block buffer but it is not complete yet,
- * this function tries to compress it and write it out anyway and reset the
- * internal counters.
- *
- * @param m A pointer to a meta data reader
- *
- * @return Zero on success, -1 on failure
- */
+/* Compress and flush the currently unfinished block to disk. Returns 0 on
+ success, internally prints error message to stderr on failure */
int meta_writer_flush(meta_writer_t *m);
-/**
- * @brief Append data to the current meta data block
- *
- * @memberof meta_writer_t
- *
- * @note This function internally prints error message to stderr on failure
- *
- * This function appends the input data to an internal meta data buffer. If
- * the internal buffer is full, it is compressed and written to disk using
- * @ref meta_writer flush, i.e. the function allows for transparent writing
- * across meta data blocks.
- *
- * @param m A pointer to a meta data reader
- * @param data A pointer to the data block to append
- * @param size The number of bytes to read from the data blob
- *
- * @return Zero on success, -1 on failure
- */
+/* Returns 0 on success. Prints error message to stderr on failure. */
int meta_writer_append(meta_writer_t *m, const void *data, size_t size);
+/* Query the current block start position and offset within the block */
void meta_writer_get_position(const meta_writer_t *m, uint64_t *block_start,
uint32_t *offset);
+/* Reset all internal state, including the current block start position. */
void meta_writer_reset(meta_writer_t *m);
#endif /* META_WRITER_H */