1 /* timestamp.c
2  * Routines for timestamp type setting.
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #include "config.h"
12 
13 #include "timestamp.h"
14 
15 /* Init with an invalid value, so that "recent" in ui/gtk/menu.c can detect this
16  * and distinguish it from a command line value */
17 static ts_type timestamp_type = TS_NOT_SET;
18 
19 static int timestamp_precision = TS_PREC_AUTO;
20 
21 static ts_seconds_type timestamp_seconds_type = TS_SECONDS_NOT_SET;
22 
timestamp_get_type(void)23 ts_type timestamp_get_type(void)
24 {
25 	return timestamp_type;
26 }
27 
timestamp_set_type(ts_type ts_t)28 void timestamp_set_type(ts_type ts_t)
29 {
30 	timestamp_type = ts_t;
31 }
32 
33 
timestamp_get_precision(void)34 int timestamp_get_precision(void)
35 {
36 	return timestamp_precision;
37 }
38 
timestamp_set_precision(int tsp)39 void timestamp_set_precision(int tsp)
40 {
41 	timestamp_precision = tsp;
42 }
43 
44 
timestamp_get_seconds_type(void)45 ts_seconds_type timestamp_get_seconds_type(void)
46 {
47 	return timestamp_seconds_type;
48 }
49 
timestamp_set_seconds_type(ts_seconds_type ts_t)50 void timestamp_set_seconds_type(ts_seconds_type ts_t)
51 {
52 	timestamp_seconds_type = ts_t;
53 }
54 
55 /*
56  * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
57  *
58  * Local variables:
59  * c-basic-offset: 8
60  * tab-width: 8
61  * indent-tabs-mode: t
62  * End:
63  *
64  * vi: set shiftwidth=8 tabstop=8 noexpandtab:
65  * :indentSize=8:tabSize=8:noTabs=false:
66  */
67