memset_s.h 594 B

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