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 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef __UNIT_STRINGS_H__
24 #define __UNIT_STRINGS_H__
26 #include "ws_symbol_export.h"
30 #endif /* __cplusplus */
33 * Units to append to field values
36 /* For BASE_UNIT_STRING, the display format for adding units */
37 typedef struct unit_name_string {
38 char *singular; /* name to use for 1 unit */
39 char *plural; /* name to use for < 1 or > 1 units */
42 WS_DLL_PUBLIC char* unit_name_string_get_value(guint32 value, unit_name_string* units);
43 WS_DLL_PUBLIC char* unit_name_string_get_value64(guint64 value, unit_name_string* units);
44 WS_DLL_PUBLIC char* unit_name_string_get_double(double value, unit_name_string* units);
47 * A default set of unit strings that dissectors can use for
50 WS_DLL_PUBLIC const unit_name_string units_foot_feet;
51 WS_DLL_PUBLIC const unit_name_string units_bit_bits;
52 WS_DLL_PUBLIC const unit_name_string units_byte_bytes;
53 WS_DLL_PUBLIC const unit_name_string units_octet_octets;
54 WS_DLL_PUBLIC const unit_name_string units_word_words;
55 WS_DLL_PUBLIC const unit_name_string units_tick_ticks;
56 WS_DLL_PUBLIC const unit_name_string units_meters;
57 WS_DLL_PUBLIC const unit_name_string units_meter_meters;
58 WS_DLL_PUBLIC const unit_name_string units_week_weeks;
59 WS_DLL_PUBLIC const unit_name_string units_day_days;
60 WS_DLL_PUBLIC const unit_name_string units_hour_hours;
61 WS_DLL_PUBLIC const unit_name_string units_hours;
62 WS_DLL_PUBLIC const unit_name_string units_minute_minutes;
63 WS_DLL_PUBLIC const unit_name_string units_minutes;
64 WS_DLL_PUBLIC const unit_name_string units_second_seconds; // full unit name "second[s?]"
65 WS_DLL_PUBLIC const unit_name_string units_seconds; //only seconds abbreviation "s"
66 WS_DLL_PUBLIC const unit_name_string units_millisecond_milliseconds; // full unit name "millisecond[s?]"
67 WS_DLL_PUBLIC const unit_name_string units_milliseconds; //only seconds abbreviation "ms"
68 WS_DLL_PUBLIC const unit_name_string units_microsecond_microseconds; // full unit name "microsecond[s?]"
69 WS_DLL_PUBLIC const unit_name_string units_microseconds; //only seconds abbreviation "us"
70 WS_DLL_PUBLIC const unit_name_string units_nanosecond_nanoseconds; // full unit name "nanosecond[s?]"
71 WS_DLL_PUBLIC const unit_name_string units_nanoseconds; //only seconds abbreviation "ns"
72 WS_DLL_PUBLIC const unit_name_string units_nanometers;
73 WS_DLL_PUBLIC const unit_name_string units_degree_degrees;
74 WS_DLL_PUBLIC const unit_name_string units_decibels;
75 WS_DLL_PUBLIC const unit_name_string units_dbm;
76 WS_DLL_PUBLIC const unit_name_string units_dbi;
77 WS_DLL_PUBLIC const unit_name_string units_mbm;
78 WS_DLL_PUBLIC const unit_name_string units_percent;
79 WS_DLL_PUBLIC const unit_name_string units_khz;
80 WS_DLL_PUBLIC const unit_name_string units_ghz;
81 WS_DLL_PUBLIC const unit_name_string units_mhz;
82 WS_DLL_PUBLIC const unit_name_string units_hz;
83 WS_DLL_PUBLIC const unit_name_string units_hz_s;
84 WS_DLL_PUBLIC const unit_name_string units_kbit;
85 WS_DLL_PUBLIC const unit_name_string units_kbps;
86 WS_DLL_PUBLIC const unit_name_string units_kibps;
87 WS_DLL_PUBLIC const unit_name_string units_kmh;
88 WS_DLL_PUBLIC const unit_name_string units_microwatts;
89 WS_DLL_PUBLIC const unit_name_string units_meter_sec;
90 WS_DLL_PUBLIC const unit_name_string units_meter_sec_squared;
91 WS_DLL_PUBLIC const unit_name_string units_bit_sec;
92 WS_DLL_PUBLIC const unit_name_string units_segment_remaining;
93 WS_DLL_PUBLIC const unit_name_string units_frame_frames;
97 #endif /* __cplusplus */
99 #endif /* __UNIT_STRINGS_H__ */
107 * indent-tabs-mode: nil
110 * ex: set shiftwidth=4 tabstop=8 expandtab:
111 * :indentSize=4:tabSize=8:noTabs=true: