12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef DECOUT_SOURCE
- #define DECOUT_SOURCE
- #include <stdio.h>
- #include <ctype.h>
- #include "../tools/memory.h"
- #include "../tools/number.h"
- void decout (void const * memory, size_t extent, char c, char e, FILE * fp)
- {
- byte * offset = (byte *) (memory);
- while (extent--)
- {
- unsigned order = 100;
- while (order)
- {
- putc (DIGITS_DEC [(* offset / order) % RADIX_DEC], fp);
- order /= RADIX_DEC;
- }
- if ((extent) && (c))
- {
- putc (c, fp);
- }
- offset++;
- }
- if (e)
- {
- putc (e, fp);
- }
- return;
- }
- #endif
|