convtbl.h revision 1.1 1 1.1 scole /*
2 1.1 scole * Copyright (c) 2003, Trent Nelson, <trent (at) arpa.com>.
3 1.1 scole * All rights reserved.
4 1.1 scole *
5 1.1 scole * Redistribution and use in source and binary forms, with or without
6 1.1 scole * modification, are permitted provided that the following conditions
7 1.1 scole * are met:
8 1.1 scole * 1. Redistributions of source code must retain the above copyright
9 1.1 scole * notice, this list of conditions and the following disclaimer.
10 1.1 scole * 2. Redistributions in binary form must reproduce the above copyright
11 1.1 scole * notice, this list of conditions and the following disclaimer in the
12 1.1 scole * documentation and/or other materials provided with the distribution.
13 1.1 scole * 3. The name of the author may not be used to endorse or promote products
14 1.1 scole * derived from this software without specific prior written permission.
15 1.1 scole *
16 1.1 scole * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 1.1 scole * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 1.1 scole * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 1.1 scole * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 1.1 scole * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 1.1 scole * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 1.1 scole * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 1.1 scole * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 1.1 scole * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 1.1 scole * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 1.1 scole * SUCH DAMAGE.
27 1.1 scole *
28 1.1 scole * $FreeBSD: releng/10.1/usr.bin/systat/convtbl.h 164675 2006-11-27 16:33:44Z yar $
29 1.1 scole */
30 1.1 scole
31 1.1 scole #ifndef _CONVTBL_H_
32 1.1 scole #define _CONVTBL_H_
33 1.1 scole
34 1.1 scole #include <sys/types.h>
35 1.1 scole #include <stdint.h>
36 1.1 scole
37 1.1 scole /*
38 1.1 scole * Keep the order in the enum.
39 1.1 scole */
40 1.1 scole enum scale {
41 1.1 scole SC_BYTE,
42 1.1 scole SC_KILOBYTE,
43 1.1 scole SC_MEGABYTE,
44 1.1 scole SC_GIGABYTE,
45 1.1 scole SC_TERABYTE,
46 1.1 scole SC_BIT,
47 1.1 scole SC_KILOBIT,
48 1.1 scole SC_MEGABIT,
49 1.1 scole SC_GIGABIT,
50 1.1 scole SC_TERABIT,
51 1.1 scole SC_AUTO /* KEEP THIS LAST */
52 1.1 scole };
53 1.1 scole
54 1.1 scole extern double convert(const uintmax_t, const int);
55 1.1 scole extern const char *get_helplist(void);
56 1.1 scole extern int get_scale(const char *);
57 1.1 scole extern const char *get_string(const uintmax_t, const int);
58 1.1 scole
59 1.1 scole #endif /* ! _CONVTBL_H_ */
60