Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

unit_strings.h
Go to the documentation of this file.
1 /* unit_strings.h
2 * Units to append to field values
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 #ifndef __UNIT_STRINGS_H__
12 #define __UNIT_STRINGS_H__
13
14 #include "ws_symbol_export.h"
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
19
24 /* For BASE_UNIT_STRING, the display format for adding units */
25 typedef struct unit_name_string {
26 char *singular; /* name to use for 1 unit */
27 char *plural; /* name to use for < 1 or > 1 units */
28 } unit_name_string;
29
30 WS_DLL_PUBLIC const char* unit_name_string_get_value(guint32 value, const unit_name_string* units);
31 WS_DLL_PUBLIC const char* unit_name_string_get_value64(guint64 value, const unit_name_string* units);
32 WS_DLL_PUBLIC const char* unit_name_string_get_double(double value, const unit_name_string* units);
33
34 /*
35 * A default set of unit strings that dissectors can use for
36 * header fields.
37 */
38 WS_DLL_PUBLIC const unit_name_string units_foot_feet;
39 WS_DLL_PUBLIC const unit_name_string units_bit_bits;
40 WS_DLL_PUBLIC const unit_name_string units_byte_bytes;
41 WS_DLL_PUBLIC const unit_name_string units_byte_bytespsecond;
42 WS_DLL_PUBLIC const unit_name_string units_octet_octets;
43 WS_DLL_PUBLIC const unit_name_string units_word_words;
44 WS_DLL_PUBLIC const unit_name_string units_tick_ticks;
45 WS_DLL_PUBLIC const unit_name_string units_meters;
46 WS_DLL_PUBLIC const unit_name_string units_meter_meters;
47 WS_DLL_PUBLIC const unit_name_string units_week_weeks;
48 WS_DLL_PUBLIC const unit_name_string units_day_days;
49 WS_DLL_PUBLIC const unit_name_string units_hour_hours;
50 WS_DLL_PUBLIC const unit_name_string units_hours;
51 WS_DLL_PUBLIC const unit_name_string units_minute_minutes;
52 WS_DLL_PUBLIC const unit_name_string units_minutes;
53 WS_DLL_PUBLIC const unit_name_string units_second_seconds; // full unit name "second[s?]"
54 WS_DLL_PUBLIC const unit_name_string units_seconds; //only seconds abbreviation "s"
55 WS_DLL_PUBLIC const unit_name_string units_millisecond_milliseconds; // full unit name "millisecond[s?]"
56 WS_DLL_PUBLIC const unit_name_string units_milliseconds; //only seconds abbreviation "ms"
57 WS_DLL_PUBLIC const unit_name_string units_microsecond_microseconds; // full unit name "microsecond[s?]"
58 WS_DLL_PUBLIC const unit_name_string units_microseconds; //only seconds abbreviation "us"
59 WS_DLL_PUBLIC const unit_name_string units_nanosecond_nanoseconds; // full unit name "nanosecond[s?]"
60 WS_DLL_PUBLIC const unit_name_string units_nanoseconds; //only seconds abbreviation "ns"
61 WS_DLL_PUBLIC const unit_name_string units_nanometers;
62 WS_DLL_PUBLIC const unit_name_string units_degree_degrees;
63 WS_DLL_PUBLIC const unit_name_string units_degree_celsius;
64 WS_DLL_PUBLIC const unit_name_string units_degree_bearing;
65 WS_DLL_PUBLIC const unit_name_string units_decibels;
66 WS_DLL_PUBLIC const unit_name_string units_dbm;
67 WS_DLL_PUBLIC const unit_name_string units_dbi;
68 WS_DLL_PUBLIC const unit_name_string units_mbm;
69 WS_DLL_PUBLIC const unit_name_string units_percent;
70 WS_DLL_PUBLIC const unit_name_string units_khz;
71 WS_DLL_PUBLIC const unit_name_string units_ghz;
72 WS_DLL_PUBLIC const unit_name_string units_mhz;
73 WS_DLL_PUBLIC const unit_name_string units_hz;
74 WS_DLL_PUBLIC const unit_name_string units_hz_s;
75 WS_DLL_PUBLIC const unit_name_string units_kbit;
76 WS_DLL_PUBLIC const unit_name_string units_kbps;
77 WS_DLL_PUBLIC const unit_name_string units_kibps;
78 WS_DLL_PUBLIC const unit_name_string units_km;
79 WS_DLL_PUBLIC const unit_name_string units_kmh;
80 WS_DLL_PUBLIC const unit_name_string units_milliamps;
81 WS_DLL_PUBLIC const unit_name_string units_microwatts;
82 WS_DLL_PUBLIC const unit_name_string units_volt;
83 WS_DLL_PUBLIC const unit_name_string units_grams_per_second;
84 WS_DLL_PUBLIC const unit_name_string units_meter_sec;
85 WS_DLL_PUBLIC const unit_name_string units_meter_sec_squared;
86 WS_DLL_PUBLIC const unit_name_string units_bit_sec;
87 WS_DLL_PUBLIC const unit_name_string units_segment_remaining;
88 WS_DLL_PUBLIC const unit_name_string units_frame_frames;
89 WS_DLL_PUBLIC const unit_name_string units_revolutions_per_minute;
90 WS_DLL_PUBLIC const unit_name_string units_kilopascal;
91 WS_DLL_PUBLIC const unit_name_string units_newton_metre;
92 WS_DLL_PUBLIC const unit_name_string units_liter_per_hour;
93 WS_DLL_PUBLIC const unit_name_string units_amp;
94 WS_DLL_PUBLIC const unit_name_string units_watthour;
95 WS_DLL_PUBLIC const unit_name_string units_watt;
96
97 #ifdef __cplusplus
98 }
99 #endif /* __cplusplus */
100
101 #endif /* __UNIT_STRINGS_H__ */
102
103 /*
104 * Editor modelines
105 *
106 * Local Variables:
107 * c-basic-offset: 4
108 * tab-width: 8
109 * indent-tabs-mode: nil
110 * End:
111 *
112 * ex: set shiftwidth=4 tabstop=8 expandtab:
113 * :indentSize=4:tabSize=8:noTabs=true:
114 */
unit_name_string
Definition: unit_strings.h:25