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