Mercurial > hg > nnchat
comparison main.c @ 687:e6d60eacf24d
Update to new th_io_fopen() API.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 09 Jul 2018 08:08:50 +0300 |
parents | 256002aa06cc |
children | 1b15cf9442ff |
comparison
equal
deleted
inserted
replaced
686:256002aa06cc | 687:e6d60eacf24d |
---|---|
2057 if (setConfigDir != NULL) | 2057 if (setConfigDir != NULL) |
2058 { | 2058 { |
2059 th_ioctx *ctx; | 2059 th_ioctx *ctx; |
2060 | 2060 |
2061 setConfigFile = th_strdup_printf("%s%c%s", setConfigDir, SET_DIR_SEPARATOR, SET_CONFIG_FILE); | 2061 setConfigFile = th_strdup_printf("%s%c%s", setConfigDir, SET_DIR_SEPARATOR, SET_CONFIG_FILE); |
2062 if ((ctx = th_io_fopen(&th_stdio_io_ops, setConfigFile, "r")) != NULL) | 2062 if (th_io_fopen(&ctx, &th_stdio_io_ops, setConfigFile, "r") == THERR_OK) |
2063 { | 2063 { |
2064 th_io_set_handlers(ctx, nn_ioctx_errfunc, nn_ioctx_msgfunc); | 2064 th_io_set_handlers(ctx, nn_ioctx_errfunc, nn_ioctx_msgfunc); |
2065 | 2065 |
2066 THMSG(0, "Reading configuration from '%s'.\n", setConfigFile); | 2066 THMSG(0, "Reading configuration from '%s'.\n", |
2067 setConfigFile); | |
2067 | 2068 |
2068 th_cfg_read(ctx, cfg); | 2069 th_cfg_read(ctx, cfg); |
2069 th_io_close(ctx); | 2070 th_io_close(ctx); |
2070 } | 2071 } |
2071 } | 2072 } |