diff options
Diffstat (limited to 'src/binlog.c')
-rw-r--r-- | src/binlog.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/binlog.c b/src/binlog.c index ea1aa65..57e2aa0 100644 --- a/src/binlog.c +++ b/src/binlog.c @@ -64,8 +64,8 @@ struct binlog_config { int debug; /* debug level */ int flags; /* flags (see BLF_* defines above) */ - char *dataspec; /* data format specification */ - struct packinst *inst_head; /* compiled dataspec */ + char *format; /* data format specification */ + struct packinst *inst_head; /* compiled format */ struct packinst *inst_cur; /* current instruction */ struct packenv *env; /* pack environment */ enum binlog_state state; /* binlog machine state */ @@ -209,7 +209,7 @@ getindexpat(const char *name) void vmod_init(struct sess *sp, struct vmod_priv *priv, - const char *dir, const char *dataspec, const char *param) + const char *dir, const char *format, const char *param) { struct binlog_config *conf = priv->priv; struct stat st; @@ -244,7 +244,7 @@ vmod_init(struct sess *sp, struct vmod_priv *priv, conf->dir = strdup(dir); AN(conf->dir); - conf->inst_head = packcomp(dataspec, &p); + conf->inst_head = packcomp(format, &p); if (!conf->inst_head) { if (errno == EINVAL) binlog_error("cannot compile data format near %s", p); @@ -256,8 +256,8 @@ vmod_init(struct sess *sp, struct vmod_priv *priv, conf->env = packenv_create(conf->recsize); AN(conf->env); conf->recsize += offsetof(struct binlog_record,data); - conf->dataspec = strdup(dataspec); - AN(conf->dataspec); + conf->format = strdup(format); + AN(conf->format); p = findparam(param, "pattern"); if (!p) { @@ -518,17 +518,17 @@ checkheader(struct binlog_config *conf, size_t hdrsize) return 1; } - p = conf->dataspec; + p = conf->format; while (*p) { if (read(conf->fd, &c, 1) != 1 || c != *p) { - debug(conf,1,("%s/%s: dataspec mismatch near %s: %c", + debug(conf,1,("%s/%s: format mismatch near %s: %c", conf->dir, conf->fname, p, c)); return 1; } ++p; } if (read(conf->fd, &c, 1) != 1 || c != 0) { - debug(conf,1,("%s/%s: dataspec mismatch at the end: %c", + debug(conf,1,("%s/%s: format mismatch at the end: %c", conf->dir, conf->fname, c)); return 1; } @@ -550,7 +550,7 @@ newfile(struct sess *sp, struct binlog_config *conf) return -1; hdrsize = ((sizeof(struct binlog_file_header) + - strlen(conf->dataspec) + + strlen(conf->format) + conf->recsize - 1) / conf->recsize) * conf->recsize; if (fstat(conf->fd, &st) == 0) { @@ -607,7 +607,7 @@ newfile(struct sess *sp, struct binlog_config *conf) conf->base->version = BINLOG_VERSION; conf->base->recsize = conf->recsize; conf->base->recnum = 0; - strcpy((char*)(conf->base + 1), conf->dataspec); + strcpy((char*)(conf->base + 1), conf->format); conf->base->hdrsize = hdrsize; } |