summaryrefslogtreecommitdiffabout
path: root/src/vmod-binlog.h
Side-by-side diff
Diffstat (limited to 'src/vmod-binlog.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/vmod-binlog.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/vmod-binlog.h b/src/vmod-binlog.h
index db6c7f0..06d517d 100644
--- a/src/vmod-binlog.h
+++ b/src/vmod-binlog.h
@@ -36,9 +36,8 @@
#endif
struct binlog_record {
- long nid; /* node ID */
- long aid; /* article ID */
time_t ts; /* timestamp */
+ char data[1]; /* payload */
};
#define BINLOG_MAGIC_STR "NXCBINLOG"
@@ -49,23 +48,11 @@ struct binlog_file_header {
char magic[BINLOG_MAGIC_LEN];
char pad[16 - BINLOG_MAGIC_LEN];
uint32_t version;
+ size_t hdrsize;
size_t recsize;
size_t recnum;
+/* char dataspec[X];*/
};
-#define BINLOG_HEADER_SIZE \
- ((sizeof(struct binlog_file_header) + sizeof(struct binlog_record) - 1) / \
- sizeof(struct binlog_record))
-
-union binlog_header {
- struct binlog_file_header hdr;
- struct binlog_record pad[BINLOG_HEADER_SIZE];
-};
-
-#define binlog_size(conf) \
- (sizeof(union binlog_header) + \
- (conf)->recidx * sizeof(struct binlog_record))
-#define binlog_recnum(conf) \
- (((conf)->size - sizeof(union binlog_header)) / \
- sizeof(struct binlog_record))
+#define binlog_size(hdr) ((hdr)->hdrsize + (hdr)->recnum * (hdr)->recsize)

Return to:

Send suggestions and report system problems to the System administrator.