mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Factorize timestamp parsing to be coherent with command line format in configuration file.
This commit is contained in:
parent
1ec39d1c7b
commit
a543fbd7ef
6 changed files with 99 additions and 39 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include <unistd.h>
|
||||
#include <regex.h>
|
||||
#include <ini.h>
|
||||
#include "options.h"
|
||||
#include "configfile.h"
|
||||
#include "misc.h"
|
||||
#include "options.h"
|
||||
|
|
@ -135,7 +136,7 @@ static int data_handler(void *user, const char *section, const char *name,
|
|||
}
|
||||
else if (!strcmp(name, "timestamp"))
|
||||
{
|
||||
option.timestamp = atoi(value);
|
||||
option.timestamp = timestamp_option_parse(value);
|
||||
}
|
||||
else if (!strcmp(name, "log-filename"))
|
||||
{
|
||||
|
|
@ -260,3 +261,11 @@ void config_exit(void)
|
|||
|
||||
free(c);
|
||||
}
|
||||
|
||||
void config_file_print()
|
||||
{
|
||||
tio_printf("INI:");
|
||||
tio_printf(" path: %s", c->path);
|
||||
tio_printf(" searched section: %s", c->user);
|
||||
tio_printf(" found section: %s", c->section_name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue