memset_s.h 663 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <errno.h>
  3. #include <stdint.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #ifndef _RSIZE_T_DECLARED
  8. typedef uint64_t rsize_t;
  9. #define _RSIZE_T_DECLARED
  10. #endif
  11. #ifndef _ERRNOT_DECLARED
  12. typedef int16_t errno_t; //-V677
  13. #define _ERRNOT_DECLARED
  14. #endif
  15. /**
  16. * @brief Copies the value \p c into each of the first \p n characters of the object pointed to by \p s.
  17. * @param s pointer to the object to fill
  18. * @param smax size of the destination object
  19. * @param c fill byte
  20. * @param n number of bytes to fill
  21. * @return \c 0 on success; non-zero otherwise
  22. */
  23. errno_t memset_s(void* s, rsize_t smax, int c, rsize_t n);
  24. #ifdef __cplusplus
  25. }
  26. #endif