decstring.c 953 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*====================================================================*
  2. *
  3. * char * decstring ( char buffer [], size_t length, void const * memory, size_t extent);
  4. *
  5. * memory.h
  6. *
  7. * decode a memory region into a decimal character buffer and
  8. * return the buffer address;
  9. *
  10. * allow four string characters for each memory byte; this means
  11. * that the buffer must hold at least four characters or nothing
  12. * will be decoded;
  13. *
  14. * Motley Tools by Charles Maier;
  15. * Copyright (c) 2001-2006 by Charles Maier Associates;
  16. * Licensed under the Internet Software Consortium License;
  17. *
  18. *--------------------------------------------------------------------*/
  19. #ifndef DECSTRING_SOURCE
  20. #define DECSTRING_SOURCE
  21. #include <stdint.h>
  22. #include "../tools/memory.h"
  23. char * decstring (char buffer [], size_t length, void const * memory, size_t extent)
  24. {
  25. decdecode (memory, extent, buffer, length);
  26. return ((char *)(buffer));
  27. }
  28. #endif