123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?xml version='1.0' encoding='iso-8859-1'?>
- <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
- <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
- <head>
- <title>
- number.h
- </title>
- <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
- <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
- <meta name='author' content='cmaier@cmassoc.net'/>
- <meta name='robots' content='noindex,nofollow'/>
- <link href='toolkit.css' rel='stylesheet' type='text/css'/>
- </head>
- <body>
- <div class='headerlink'>
- [<a href='node.h.html' title=' node.h '>PREV</a>]
- [<a href='toolkit.html' title=' Index '>HOME</a>]
- [<a href='nvm.h.html' title=' nvm.h '>NEXT</a>]
- </div>
- <pre>
- /*====================================================================*
- *
- * number.h - numeric conversion definitions and declarations;
- *
- * Motley Tools by Charles Maier <cmaier@cmassoc.net>;
- * Copyright 2001-2006 by Charles Maier Associates;
- * Licensed under the Internet Software Consortium License;
- *
- *--------------------------------------------------------------------*/
- #ifndef NUMBER_HEADER
- #define NUMBER_HEADER
- /*====================================================================*
- * system header files;
- *--------------------------------------------------------------------*/
- #include <stdio.h>
- #include <stdint.h>
- #include <stddef.h>
- /*====================================================================*
- * numeric converson sizes and limits;
- *--------------------------------------------------------------------*/
- #define RADIX_BIN 2
- #define RADIX_OCT 8
- #define RADIX_DEC 10
- #define RADIX_HEX 16
- #define RADIX_MIN 2
- #define RADIX_MAX 36
- #define BIN_DIGITS 8
- #define DEC_DIGITS 3
- #define OCT_DIGITS 3
- #define HEX_DIGITS 2
- #define IPv4_SIZE 4
- #define IPv6_SIZE 16
- /*====================================================================*
- * numeric conversion strings;
- *--------------------------------------------------------------------*/
- #define DIGITS_BIN "01"
- #define DIGITS_OCT "01234567"
- #define DIGITS_DEC "0123456789"
- #define DIGITS_HEX "0123456789ABCDEF"
- #define DIGITS_ALL "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- /*====================================================================*
- * numeric string extenders;
- *--------------------------------------------------------------------*/
- #define BIN_EXTENDER '-'
- #define DEC_EXTENDER '.'
- #define HEX_EXTENDER ':'
- /*====================================================================*
- *
- *--------------------------------------------------------------------*/
- #define isodd(n) (((n)&(1)) != 0)
- #define iseven(n) (((n)&(1)) == 0)
- /*====================================================================*
- *
- *--------------------------------------------------------------------*/
- uint64_t QCASRand (uint32_t seed);
- uint32_t QCARand ();
- /*====================================================================*
- *
- *--------------------------------------------------------------------*/
- uint64_t basespec (char const * string, unsigned base, unsigned size);
- uint64_t uintspec (char const * string, uint64_t minimum, uint64_t maximum);
- uint64_t tonumber (char const * string, uint64_t minimum, uint64_t maximum, uint64_t nominal);
- signed sintspec (char const *string, signed number);
- unsigned totruth (char const *string, signed fail);
- unsigned todigit (unsigned c);
- /*====================================================================*
- * end definitions;
- *--------------------------------------------------------------------*/
- #endif
- </pre>
- <div class='footerlink'>
- [<a href='node.h.html' title=' node.h '>PREV</a>]
- [<a href='toolkit.html' title=' Index '>HOME</a>]
- [<a href='nvm.h.html' title=' nvm.h '>NEXT</a>]
- </div>
- </body>
- </html>
|