From ecc9c5fcfa4831b290cc1a63c0346cbb0c1fcf42 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 14 Jul 2011 00:51:45 -0400 Subject: new restartable integer parsing framework. this fixes a number of bugs in integer parsing due to lazy haphazard wrapping, as well as some misinterpretations of the standard. the new parser is able to work character-at-a-time or on whole strings, making it easy to support the wide functions without unbounded space for conversion. it will also be possible to update scanf to use the new parser. --- src/internal/intparse.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/internal/intparse.h (limited to 'src/internal/intparse.h') diff --git a/src/internal/intparse.h b/src/internal/intparse.h new file mode 100644 index 00000000..78e800d1 --- /dev/null +++ b/src/internal/intparse.h @@ -0,0 +1,11 @@ +#include +#include + +struct intparse { + uintmax_t val; + unsigned small; + size_t cnt; + char neg, base, state, err; +}; + +int __intparse(struct intparse *, const void *, size_t); -- cgit 1.4.1