dcerpc: remove use-after-free (found by clang).
[metze/wireshark/wip.git] / epan / unit_strings.h
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  * 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.
12  *
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.
17  *
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.
21  */
22
23 #ifndef __UNIT_STRINGS_H__
24 #define __UNIT_STRINGS_H__
25
26 #include "ws_symbol_export.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32 /** @file
33  * Units to append to field values
34  */
35
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 */
40 } unit_name_string;
41
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);
45
46 /*
47  * A default set of unit strings that dissectors can use for
48  * header fields.
49  */
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_byte_bytespsecond;
54 WS_DLL_PUBLIC const unit_name_string units_octet_octets;
55 WS_DLL_PUBLIC const unit_name_string units_word_words;
56 WS_DLL_PUBLIC const unit_name_string units_tick_ticks;
57 WS_DLL_PUBLIC const unit_name_string units_meters;
58 WS_DLL_PUBLIC const unit_name_string units_meter_meters;
59 WS_DLL_PUBLIC const unit_name_string units_week_weeks;
60 WS_DLL_PUBLIC const unit_name_string units_day_days;
61 WS_DLL_PUBLIC const unit_name_string units_hour_hours;
62 WS_DLL_PUBLIC const unit_name_string units_hours;
63 WS_DLL_PUBLIC const unit_name_string units_minute_minutes;
64 WS_DLL_PUBLIC const unit_name_string units_minutes;
65 WS_DLL_PUBLIC const unit_name_string units_second_seconds; // full unit name "second[s?]"
66 WS_DLL_PUBLIC const unit_name_string units_seconds;        //only seconds abbreviation "s"
67 WS_DLL_PUBLIC const unit_name_string units_millisecond_milliseconds; // full unit name "millisecond[s?]"
68 WS_DLL_PUBLIC const unit_name_string units_milliseconds;        //only seconds abbreviation "ms"
69 WS_DLL_PUBLIC const unit_name_string units_microsecond_microseconds; // full unit name "microsecond[s?]"
70 WS_DLL_PUBLIC const unit_name_string units_microseconds;        //only seconds abbreviation "us"
71 WS_DLL_PUBLIC const unit_name_string units_nanosecond_nanoseconds; // full unit name "nanosecond[s?]"
72 WS_DLL_PUBLIC const unit_name_string units_nanoseconds; //only seconds abbreviation "ns"
73 WS_DLL_PUBLIC const unit_name_string units_nanometers;
74 WS_DLL_PUBLIC const unit_name_string units_degree_degrees;
75 WS_DLL_PUBLIC const unit_name_string units_degree_celsius;
76 WS_DLL_PUBLIC const unit_name_string units_degree_bearing;
77 WS_DLL_PUBLIC const unit_name_string units_decibels;
78 WS_DLL_PUBLIC const unit_name_string units_dbm;
79 WS_DLL_PUBLIC const unit_name_string units_dbi;
80 WS_DLL_PUBLIC const unit_name_string units_mbm;
81 WS_DLL_PUBLIC const unit_name_string units_percent;
82 WS_DLL_PUBLIC const unit_name_string units_khz;
83 WS_DLL_PUBLIC const unit_name_string units_ghz;
84 WS_DLL_PUBLIC const unit_name_string units_mhz;
85 WS_DLL_PUBLIC const unit_name_string units_hz;
86 WS_DLL_PUBLIC const unit_name_string units_hz_s;
87 WS_DLL_PUBLIC const unit_name_string units_kbit;
88 WS_DLL_PUBLIC const unit_name_string units_kbps;
89 WS_DLL_PUBLIC const unit_name_string units_kibps;
90 WS_DLL_PUBLIC const unit_name_string units_km;
91 WS_DLL_PUBLIC const unit_name_string units_kmh;
92 WS_DLL_PUBLIC const unit_name_string units_milliamps;
93 WS_DLL_PUBLIC const unit_name_string units_microwatts;
94 WS_DLL_PUBLIC const unit_name_string units_volt;
95 WS_DLL_PUBLIC const unit_name_string units_grams_per_second;
96 WS_DLL_PUBLIC const unit_name_string units_meter_sec;
97 WS_DLL_PUBLIC const unit_name_string units_meter_sec_squared;
98 WS_DLL_PUBLIC const unit_name_string units_bit_sec;
99 WS_DLL_PUBLIC const unit_name_string units_segment_remaining;
100 WS_DLL_PUBLIC const unit_name_string units_frame_frames;
101 WS_DLL_PUBLIC const unit_name_string units_revolutions_per_minute;
102 WS_DLL_PUBLIC const unit_name_string units_kilopascal;
103 WS_DLL_PUBLIC const unit_name_string units_newton_metre;
104 WS_DLL_PUBLIC const unit_name_string units_liter_per_hour;
105 WS_DLL_PUBLIC const unit_name_string units_amp;
106 WS_DLL_PUBLIC const unit_name_string units_watthour;
107 WS_DLL_PUBLIC const unit_name_string units_watt;
108
109 #ifdef __cplusplus
110 }
111 #endif /* __cplusplus */
112
113 #endif /* __UNIT_STRINGS_H__ */
114
115 /*
116  * Editor modelines
117  *
118  * Local Variables:
119  * c-basic-offset: 4
120  * tab-width: 8
121  * indent-tabs-mode: nil
122  * End:
123  *
124  * ex: set shiftwidth=4 tabstop=8 expandtab:
125  * :indentSize=4:tabSize=8:noTabs=true:
126  */