diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-10-12 12:19:32 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-10-12 12:28:12 +0300 |
commit | b6678bb65fce1f64e82cc049aae3d7ba6f8aa19c (patch) | |
tree | 55c1959713e8f37f5958afb4c0cdb4d751406fe6 /src/vmod.vcc | |
parent | 791cdf412f5fb66a056aa28b27507fdc9af86507 (diff) | |
download | vmod-binlog-b6678bb65fce1f64e82cc049aae3d7ba6f8aa19c.tar.gz vmod-binlog-b6678bb65fce1f64e82cc049aae3d7ba6f8aa19c.tar.bz2 |
Rewrite using opaque record data.
Records can carry arbitrary data, whose format is defined using
teplate strings similar to those of Perl's pack() function. The
teplate string is stored in the logfile header and is used by
binlogcat to render a human-readable representation.
* src/.gitignore: New file.
* pack.c: New file.
* pack.h: New file.
* src/Makefile.am: Add pack.c, pack.h
* src/binlog.c: Rewrite. Use pack routines to construct each
record.
* src/binlogcat.c: Likewise. Use packout to unpack each record.
* src/vmod-binlog.h (struct binlog_record): Remove nid,aid.
(struct binlog_file_header): Add hdrsize.
(BINLOG_HEADER_SIZE,union binlog_header): Remove
(binlog_recnum): Remove.
(binlog_size): Rewrite.
* src/vmod.vcc (append,sappend): Remove.
(init): Change signature.
(start,commit,pack): New functions.
* tests/test01.at: Rewrite.
* tests/test02.at: Rewrite.
Diffstat (limited to 'src/vmod.vcc')
-rw-r--r-- | src/vmod.vcc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vmod.vcc b/src/vmod.vcc index def0ec3..45da354 100644 --- a/src/vmod.vcc +++ b/src/vmod.vcc @@ -1,7 +1,8 @@ Module binlog Init module_init -Function VOID init(PRIV_VCL, STRING) -Function VOID append(PRIV_VCL, INT, INT) -Function VOID sappend(PRIV_VCL, STRING, STRING) +Function VOID init(PRIV_VCL, STRING, STRING, STRING) +Function VOID start(PRIV_VCL) +Function VOID commit(PRIV_VCL) +Function VOID pack(PRIV_VCL, STRING) Function VOID sync(PRIV_VCL) Function VOID close(PRIV_VCL) |