aboutsummaryrefslogtreecommitdiffstats
path: root/lib/commit.c
diff options
context:
space:
mode:
authorYunchih Chen <yunchih.cat@gmail.com>2018-03-05 10:57:00 +0800
committerYunchih Chen <yunchih.cat@gmail.com>2018-03-05 10:57:00 +0800
commita3fd587346f4f1b8868b0a147c561c55b1b1da38 (patch)
tree7c78ae724e03904fabd5d16c56090baf1c615de3 /lib/commit.c
parentdd91a91704b76c3f46b841d86f5cedee684e7fa9 (diff)
downloadnfcollect-a3fd587346f4f1b8868b0a147c561c55b1b1da38.tar
nfcollect-a3fd587346f4f1b8868b0a147c561c55b1b1da38.tar.gz
nfcollect-a3fd587346f4f1b8868b0a147c561c55b1b1da38.tar.bz2
nfcollect-a3fd587346f4f1b8868b0a147c561c55b1b1da38.tar.lz
nfcollect-a3fd587346f4f1b8868b0a147c561c55b1b1da38.tar.xz
nfcollect-a3fd587346f4f1b8868b0a147c561c55b1b1da38.tar.zst
nfcollect-a3fd587346f4f1b8868b0a147c561c55b1b1da38.zip
Apply clang-format changes
Diffstat (limited to 'lib/commit.c')
-rw-r--r--lib/commit.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/commit.c b/lib/commit.c
index 12cc027..202a138 100644
--- a/lib/commit.c
+++ b/lib/commit.c
@@ -1,36 +1,35 @@
+#include "commit.h"
#include <errno.h>
#include <string.h>
#include <zstd.h>
-#include "commit.h"
-static void nfl_commit_default(FILE* f, nflog_entry_t* store, uint32_t store_size);
-static void nfl_commit_lz4(FILE* f, nflog_entry_t* store, uint32_t store_size);
-static void nfl_commit_zstd(FILE* f, nflog_entry_t* store, uint32_t store_size);
+static void nfl_commit_default(FILE *f, nflog_entry_t *store,
+ uint32_t store_size);
+static void nfl_commit_lz4(FILE *f, nflog_entry_t *store, uint32_t store_size);
+static void nfl_commit_zstd(FILE *f, nflog_entry_t *store, uint32_t store_size);
-typedef void (*nflog_commit_run_table_t)(FILE* f, nflog_entry_t* store, uint32_t size);
+typedef void (*nflog_commit_run_table_t)(FILE *f, nflog_entry_t *store,
+ uint32_t size);
static const nflog_commit_run_table_t commit_run_table[] = {
- nfl_commit_default,
- nfl_commit_lz4,
- nfl_commit_zstd
-};
+ nfl_commit_default, nfl_commit_lz4, nfl_commit_zstd};
-void nfl_commit_init() {
- /* TODO */
-}
+void nfl_commit_init() { /* TODO */ }
-static void nfl_commit_default(FILE* f, nflog_entry_t* store, uint32_t store_size) {
+static void nfl_commit_default(FILE *f, nflog_entry_t *store,
+ uint32_t store_size) {
uint32_t written;
written = fwrite(store, 1, store_size, f);
ERR(written != store_size, strerror(errno));
}
-static void nfl_commit_lz4(FILE* f, nflog_entry_t* store, uint32_t store_size) {
+static void nfl_commit_lz4(FILE *f, nflog_entry_t *store, uint32_t store_size) {
/* TODO */
}
-static void nfl_commit_zstd(FILE* f, nflog_entry_t* store, uint32_t store_size) {
+static void nfl_commit_zstd(FILE *f, nflog_entry_t *store,
+ uint32_t store_size) {
size_t const bufsize = ZSTD_compressBound(store_size);
- void* buf;
+ void *buf;
ERR((buf = malloc(bufsize)), NULL);
@@ -44,8 +43,9 @@ static void nfl_commit_zstd(FILE* f, nflog_entry_t* store, uint32_t store_size)
free(buf);
}
-void nfl_commit_worker(nflog_header_t* header, nflog_entry_t* store, const char* filename) {
- FILE* f;
+void nfl_commit_worker(nflog_header_t *header, nflog_entry_t *store,
+ const char *filename) {
+ FILE *f;
uint32_t written;
debug("Comm worker #%u: commit to file %s\n", header->id, filename);