2004-03-18 21:14:37 +00:00
|
|
|
/* timestamp.c
|
|
|
|
* Routines for timestamp type setting.
|
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-03-18 21:14:37 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-08 16:59:17 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2004-03-18 21:14:37 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 01:48:30 +00:00
|
|
|
#include "config.h"
|
2004-03-18 21:14:37 +00:00
|
|
|
|
|
|
|
#include "timestamp.h"
|
|
|
|
|
2012-01-15 21:59:11 +00:00
|
|
|
/* Init with an invalid value, so that "recent" in ui/gtk/menu.c can detect this
|
2004-03-18 21:14:37 +00:00
|
|
|
* and distinguish it from a command line value */
|
2004-03-20 08:32:03 +00:00
|
|
|
static ts_type timestamp_type = TS_NOT_SET;
|
2004-03-18 21:14:37 +00:00
|
|
|
|
2014-09-28 18:37:06 +00:00
|
|
|
static int timestamp_precision = TS_PREC_AUTO;
|
2005-08-25 21:29:54 +00:00
|
|
|
|
2010-05-06 10:32:59 +00:00
|
|
|
static ts_seconds_type timestamp_seconds_type = TS_SECONDS_NOT_SET;
|
|
|
|
|
2005-08-25 21:29:54 +00:00
|
|
|
ts_type timestamp_get_type(void)
|
2004-03-18 21:14:37 +00:00
|
|
|
{
|
|
|
|
return timestamp_type;
|
|
|
|
}
|
|
|
|
|
2005-08-25 21:29:54 +00:00
|
|
|
void timestamp_set_type(ts_type ts_t)
|
2004-03-18 21:14:37 +00:00
|
|
|
{
|
|
|
|
timestamp_type = ts_t;
|
|
|
|
}
|
2005-08-25 21:29:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
int timestamp_get_precision(void)
|
|
|
|
{
|
|
|
|
return timestamp_precision;
|
|
|
|
}
|
|
|
|
|
|
|
|
void timestamp_set_precision(int tsp)
|
|
|
|
{
|
|
|
|
timestamp_precision = tsp;
|
|
|
|
}
|
|
|
|
|
2010-05-06 10:32:59 +00:00
|
|
|
|
|
|
|
ts_seconds_type timestamp_get_seconds_type(void)
|
|
|
|
{
|
|
|
|
return timestamp_seconds_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
void timestamp_set_seconds_type(ts_seconds_type ts_t)
|
|
|
|
{
|
|
|
|
timestamp_seconds_type = ts_t;
|
|
|
|
}
|
2014-10-10 14:41:10 +00:00
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2014-10-10 14:41:10 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 8
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
|
|
* :indentSize=8:tabSize=8:noTabs=false:
|
|
|
|
*/
|