1108684Sphk/* 2108684Sphk * Copyright (c) 2003, Trent Nelson, <trent@arpa.com>. 3108684Sphk * All rights reserved. 4108684Sphk * 5108684Sphk * Redistribution and use in source and binary forms, with or without 6108684Sphk * modification, are permitted provided that the following conditions 7108684Sphk * are met: 8108684Sphk * 1. Redistributions of source code must retain the above copyright 9108684Sphk * notice, this list of conditions and the following disclaimer. 10108684Sphk * 2. Redistributions in binary form must reproduce the above copyright 11108684Sphk * notice, this list of conditions and the following disclaimer in the 12108684Sphk * documentation and/or other materials provided with the distribution. 13108684Sphk * 3. The name of the author may not be used to endorse or promote products 14108684Sphk * derived from this software without specific prior written permission. 15108684Sphk * 16108684Sphk * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17108684Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18108684Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19108684Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20108684Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21108684Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22108684Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23108684Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24108684Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25108684Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26108684Sphk * SUCH DAMAGE. 27108684Sphk * 28108684Sphk * $FreeBSD$ 29108684Sphk */ 30108684Sphk 31108684Sphk#ifndef _CONVTBL_H_ 32108684Sphk#define _CONVTBL_H_ 33108684Sphk 34108684Sphk#include <sys/types.h> 35164671Syar#include <stdint.h> 36108684Sphk 37164675Syar/* 38164675Syar * Keep the order in the enum. 39164675Syar */ 40164663Syarenum scale { 41164663Syar SC_BYTE, 42164663Syar SC_KILOBYTE, 43164663Syar SC_MEGABYTE, 44164663Syar SC_GIGABYTE, 45164675Syar SC_TERABYTE, 46164663Syar SC_BIT, 47164663Syar SC_KILOBIT, 48164663Syar SC_MEGABIT, 49164663Syar SC_GIGABIT, 50164675Syar SC_TERABIT, 51164672Syar SC_AUTO /* KEEP THIS LAST */ 52164663Syar}; 53108684Sphk 54164671Syarextern double convert(const uintmax_t, const int); 55164672Syarextern const char *get_helplist(void); 56164672Syarextern int get_scale(const char *); 57164671Syarextern const char *get_string(const uintmax_t, const int); 58108684Sphk 59108684Sphk#endif /* ! _CONVTBL_H_ */ 60