Mercurial > hg > nnchat
changeset 565:de1af9652fef
Update to conform to changes in th-libs ioctx API.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 15 Nov 2012 20:28:07 +0200 |
parents | 6e5789cbb4d4 |
children | f0354b35d906 |
files | main.c |
diffstat | 1 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/main.c Thu Nov 15 20:27:44 2012 +0200 +++ b/main.c Thu Nov 15 20:28:07 2012 +0200 @@ -397,6 +397,21 @@ } +void nn_ioctx_errfunc(th_ioctx_t *ctx, int err, const char *msg) +{ + (void) err; + errorMsg("['%s' @ #%d]: %s", + ctx->filename, ctx->line, msg); +} + + +void nn_ioctx_msgfunc(th_ioctx_t *ctx, const char *msg) +{ + (void) ctx; + printMsgConst(NULL, LOG_STAMP | LOG_WINDOW | LOG_FILE, msg); +} + + BOOL checkNameList(qlist_t *list, const char *name) { qlist_t *node; @@ -1011,7 +1026,7 @@ int cfgfd = -1; #endif - if (!th_ioctx_init(&ctx, setConfigFile)) + if (!th_ioctx_init(&ctx, setConfigFile, nn_ioctx_errfunc, nn_ioctx_msgfunc)) { printMsgQ(currWin, "Could not initialize I/O context for configuration file writing!\n"); goto error; @@ -1852,7 +1867,7 @@ THMSG(0, "Reading configuration from '%s'.\n", setConfigFile); - if (th_ioctx_open(&ctx, setConfigFile, "r")) + if (th_ioctx_open(&ctx, setConfigFile, "r", nn_ioctx_errfunc, nn_ioctx_msgfunc)) { th_cfg_read(&ctx, cfg); th_ioctx_close(&ctx);