more decompress
[wireshark-sm.git] / epan / unit_strings.h
blob863c59d6a011fb79ac83d1b5d548503f5f6e015b
1 /* unit_strings.h
2 * Units to append to field values
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
11 #ifndef __UNIT_STRINGS_H__
12 #define __UNIT_STRINGS_H__
14 #include <stdint.h>
15 #include "ws_symbol_export.h"
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 /** @file
22 * Units to append to field values
25 /** For BASE_UNIT_STRING, the display format for adding units */
26 typedef struct unit_name_string {
27 char *singular; /**< name to use for 1 unit */
28 char *plural; /**< name to use for < 1 or > 1 units */
29 } unit_name_string;
31 /** Returns the unit string appropriate for the 32 bit value.
33 * From the given unit_name_string return the appropriate string pointer
34 * @param[in] value The value for which to get the appropriate string
35 * @param[in] units The unit_name_string containing the relevant strings
36 * @return Pointer to the appropriate string
38 WS_DLL_PUBLIC const char* unit_name_string_get_value(uint32_t value, const unit_name_string* units);
40 /** Returns the unit string appropriate for the 64 bit value.
42 * From the given unit_name_string return the appropriate string pointer
43 * @param[in] value The value for which to get the appropriate string
44 * @param[in] units The unit_name_string containing the relevant strings
45 * @return Pointer to the appropriate string
47 WS_DLL_PUBLIC const char* unit_name_string_get_value64(uint64_t value, const unit_name_string* units);
49 /** Returns the unit string appropriate for the double value.
51 * From the given unit_name_string return the appropriate string pointer
52 * @param[in] value The value for which to get the appropriate string
53 * @param[in] units The unit_name_string containing the relevant strings
54 * @return Pointer to the appropriate string
56 WS_DLL_PUBLIC const char* unit_name_string_get_double(double value, const unit_name_string* units);
59 * A default set of unit strings that dissectors can use for
60 * header fields.
62 WS_DLL_PUBLIC const unit_name_string units_foot_feet;
63 WS_DLL_PUBLIC const unit_name_string units_bit_bits;
64 WS_DLL_PUBLIC const unit_name_string units_byte_bytes;
65 WS_DLL_PUBLIC const unit_name_string units_byte_bytespsecond;
66 WS_DLL_PUBLIC const unit_name_string units_octet_octets;
67 WS_DLL_PUBLIC const unit_name_string units_word_words;
68 WS_DLL_PUBLIC const unit_name_string units_tick_ticks;
69 WS_DLL_PUBLIC const unit_name_string units_meters;
70 WS_DLL_PUBLIC const unit_name_string units_meter_meters;
71 WS_DLL_PUBLIC const unit_name_string units_centimeters;
72 WS_DLL_PUBLIC const unit_name_string units_centimeter_centimeters;
73 WS_DLL_PUBLIC const unit_name_string units_millimeters;
74 WS_DLL_PUBLIC const unit_name_string units_millimeter_millimeters;
75 WS_DLL_PUBLIC const unit_name_string units_week_weeks;
76 WS_DLL_PUBLIC const unit_name_string units_day_days;
77 WS_DLL_PUBLIC const unit_name_string units_hour_hours;
78 WS_DLL_PUBLIC const unit_name_string units_hours;
79 WS_DLL_PUBLIC const unit_name_string units_minute_minutes;
80 WS_DLL_PUBLIC const unit_name_string units_minutes;
81 WS_DLL_PUBLIC const unit_name_string units_second_seconds; // full unit name "second[s?]"
82 WS_DLL_PUBLIC const unit_name_string units_seconds; //only seconds abbreviation "s"
83 WS_DLL_PUBLIC const unit_name_string units_millisecond_milliseconds; // full unit name "millisecond[s?]"
84 WS_DLL_PUBLIC const unit_name_string units_milliseconds; //only seconds abbreviation "ms"
85 WS_DLL_PUBLIC const unit_name_string units_microsecond_microseconds; // full unit name "microsecond[s?]"
86 WS_DLL_PUBLIC const unit_name_string units_microseconds; //only seconds abbreviation "us"
87 WS_DLL_PUBLIC const unit_name_string units_nanosecond_nanoseconds; // full unit name "nanosecond[s?]"
88 WS_DLL_PUBLIC const unit_name_string units_nanoseconds; //only seconds abbreviation "ns"
89 WS_DLL_PUBLIC const unit_name_string units_nanometers;
90 WS_DLL_PUBLIC const unit_name_string units_degree_degrees;
91 WS_DLL_PUBLIC const unit_name_string units_degree_celsius;
92 WS_DLL_PUBLIC const unit_name_string units_degree_bearing;
93 WS_DLL_PUBLIC const unit_name_string units_centibels;
94 WS_DLL_PUBLIC const unit_name_string units_decibels;
95 WS_DLL_PUBLIC const unit_name_string units_dbm;
96 WS_DLL_PUBLIC const unit_name_string units_dbi;
97 WS_DLL_PUBLIC const unit_name_string units_dbhz;
98 WS_DLL_PUBLIC const unit_name_string units_mbm;
99 WS_DLL_PUBLIC const unit_name_string units_percent;
100 WS_DLL_PUBLIC const unit_name_string units_khz;
101 WS_DLL_PUBLIC const unit_name_string units_ghz;
102 WS_DLL_PUBLIC const unit_name_string units_mhz;
103 WS_DLL_PUBLIC const unit_name_string units_hz;
104 WS_DLL_PUBLIC const unit_name_string units_hz_s;
105 WS_DLL_PUBLIC const unit_name_string units_kbit;
106 WS_DLL_PUBLIC const unit_name_string units_kbps;
107 WS_DLL_PUBLIC const unit_name_string units_kibps;
108 WS_DLL_PUBLIC const unit_name_string units_pkts;
109 WS_DLL_PUBLIC const unit_name_string units_pkts_per_sec;
110 WS_DLL_PUBLIC const unit_name_string units_km;
111 WS_DLL_PUBLIC const unit_name_string units_kmh;
112 WS_DLL_PUBLIC const unit_name_string units_m_s;
113 WS_DLL_PUBLIC const unit_name_string units_cm_s;
114 WS_DLL_PUBLIC const unit_name_string units_mm_s;
115 WS_DLL_PUBLIC const unit_name_string units_milliamps;
116 WS_DLL_PUBLIC const unit_name_string units_microwatts;
117 WS_DLL_PUBLIC const unit_name_string units_volt;
118 WS_DLL_PUBLIC const unit_name_string units_grams_per_second;
119 WS_DLL_PUBLIC const unit_name_string units_meter_sec;
120 WS_DLL_PUBLIC const unit_name_string units_meter_sec_squared;
121 WS_DLL_PUBLIC const unit_name_string units_bit_sec;
122 WS_DLL_PUBLIC const unit_name_string units_segment_remaining;
123 WS_DLL_PUBLIC const unit_name_string units_frame_frames;
124 WS_DLL_PUBLIC const unit_name_string units_revolutions_per_minute;
125 WS_DLL_PUBLIC const unit_name_string units_kilopascal;
126 WS_DLL_PUBLIC const unit_name_string units_newton_metre;
127 WS_DLL_PUBLIC const unit_name_string units_liter_per_hour;
128 WS_DLL_PUBLIC const unit_name_string units_amp;
129 WS_DLL_PUBLIC const unit_name_string units_watthour;
130 WS_DLL_PUBLIC const unit_name_string units_watt;
131 WS_DLL_PUBLIC const unit_name_string units_bpm;
132 WS_DLL_PUBLIC const unit_name_string units_calorie;
133 WS_DLL_PUBLIC const unit_name_string units_cycle_cycles;
135 #ifdef __cplusplus
137 #endif /* __cplusplus */
139 #endif /* __UNIT_STRINGS_H__ */
142 * Editor modelines
144 * Local Variables:
145 * c-basic-offset: 4
146 * tab-width: 8
147 * indent-tabs-mode: nil
148 * End:
150 * ex: set shiftwidth=4 tabstop=8 expandtab:
151 * :indentSize=4:tabSize=8:noTabs=true: