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