string.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (C) 2021 Rain */
  2. /* This file is part of Cunix. */
  3. /*
  4. Cunix is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) and later version.
  8. */
  9. /*
  10. Cunix is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. */
  15. /*
  16. You should have received a copy of the GNU General Public License
  17. along with Cunix. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. #ifndef INCLUDED_STRING_H
  20. #define INCLUDED_STRING_H
  21. /* copy src to dest for n bytes */
  22. void *memcpy(void *dest, void *src, __uint64_t n);
  23. /* set n to src for n bytes */
  24. void *memset(void *dest, char c, __uint64_t n);
  25. /* set n to src for n words (n must be power of 2) */
  26. void *memsetw(void *dest, __uint16_t c, __uint64_t n);
  27. /* set n to src for n dwords (n must be power of 4) */
  28. void *memsetl(void *dest, __uint32_t c, __uint64_t n);
  29. /* set n to src for n quads (n must be power of 8) */
  30. void *memsetq(void *dest, __uint64_t c, __uint64_t n);
  31. #endif