1330449Seadler/*-
2330449Seadler * SPDX-License-Identifier: BSD-3-Clause
3330449Seadler *
4108684Sphk * Copyright (c) 2003, Trent Nelson, <trent@arpa.com>.
5108684Sphk * All rights reserved.
6108684Sphk *
7108684Sphk * Redistribution and use in source and binary forms, with or without
8108684Sphk * modification, are permitted provided that the following conditions
9108684Sphk * are met:
10108684Sphk * 1. Redistributions of source code must retain the above copyright
11108684Sphk *    notice, this list of conditions and the following disclaimer.
12108684Sphk * 2. Redistributions in binary form must reproduce the above copyright
13108684Sphk *    notice, this list of conditions and the following disclaimer in the
14108684Sphk *    documentation and/or other materials provided with the distribution.
15108684Sphk * 3. The name of the author may not be used to endorse or promote products
16108684Sphk *    derived from this software without specific prior written permission.
17108684Sphk *
18108684Sphk * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19108684Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20108684Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21108684Sphk * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22108684Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23108684Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24108684Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25108684Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26108684Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27108684Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28108684Sphk * SUCH DAMAGE.
29108684Sphk *
30108684Sphk * $FreeBSD: stable/11/usr.bin/systat/convtbl.h 330449 2018-03-05 07:26:05Z eadler $
31108684Sphk */
32108684Sphk
33108684Sphk#ifndef _CONVTBL_H_
34108684Sphk#define _CONVTBL_H_
35108684Sphk
36108684Sphk#include <sys/types.h>
37164671Syar#include <stdint.h>
38108684Sphk
39164675Syar/*
40164675Syar * Keep the order in the enum.
41164675Syar */
42164663Syarenum scale {
43164663Syar	SC_BYTE,
44164663Syar	SC_KILOBYTE,
45164663Syar	SC_MEGABYTE,
46164663Syar	SC_GIGABYTE,
47164675Syar	SC_TERABYTE,
48164663Syar	SC_BIT,
49164663Syar	SC_KILOBIT,
50164663Syar	SC_MEGABIT,
51164663Syar	SC_GIGABIT,
52164675Syar	SC_TERABIT,
53164672Syar	SC_AUTO		/* KEEP THIS LAST */
54164663Syar};
55108684Sphk
56164671Syarextern	double		 convert(const uintmax_t, const int);
57164672Syarextern	const char	*get_helplist(void);
58164672Syarextern	int		 get_scale(const char *);
59164671Syarextern	const char	*get_string(const uintmax_t, const int);
60108684Sphk
61108684Sphk#endif		/* ! _CONVTBL_H_ */
62