From 59a1890c12a3b98d534dbf84575f821eafaacd77 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Mon, 21 Mar 2011 22:34:14 +0100 Subject: _fpmaxtostr.c: move common to _fpmaxtostr.h Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- libc/stdio/_fpmaxtostr.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 libc/stdio/_fpmaxtostr.h (limited to 'libc/stdio/_fpmaxtostr.h') diff --git a/libc/stdio/_fpmaxtostr.h b/libc/stdio/_fpmaxtostr.h new file mode 100644 index 000000000..5adb9312a --- /dev/null +++ b/libc/stdio/_fpmaxtostr.h @@ -0,0 +1,41 @@ +/* vi: set sw=4 ts=4: */ +/* + * Copyright (C) 2000,2001,2003,2004 Manuel Novoa III + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + * + * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. + */ + +#ifndef _FPMAXTOSTR_H +#define _FPMAXTOSTR_H 1 + +#include +#ifdef __UCLIBC_HAS_FLOATS__ + +#define __need_size_t +#include +#include +#include +#include +#include +#include +#include + +/* WARNING: Adjust _fp_out_wide() in _vfprintf.c if this changes! */ +/* With 32 bit ints, we can get 9 decimal digits per block. */ +#define DIGITS_PER_BLOCK 9 + +#define NUM_DIGIT_BLOCKS ((DECIMAL_DIG+DIGITS_PER_BLOCK-1)/DIGITS_PER_BLOCK) + +/* WARNING: Adjust _fp_out_wide() in _vfprintf.c if this changes! */ +/* extra space for '-', '.', 'e+###', and nul */ +#define BUF_SIZE ( 3 + NUM_DIGIT_BLOCKS * DIGITS_PER_BLOCK ) + +typedef size_t (__fp_outfunc_t)(FILE *fp, intptr_t type, intptr_t len, intptr_t buf); + +extern ssize_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info, + __fp_outfunc_t fp_outfunc) attribute_hidden; + +#endif /* __UCLIBC_HAS_FLOATS__ */ +#endif /* _FPMAXTOSTR_H */ -- cgit v1.2.3