You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

string.h 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef BITS_STRING_H
  2. #define BITS_STRING_H
  3. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  4. /** @file
  5. *
  6. * String functions
  7. *
  8. */
  9. /**
  10. * Fill memory region
  11. *
  12. * @v dest Destination region
  13. * @v character Fill character
  14. * @v len Length
  15. * @ret dest Destination region
  16. */
  17. static inline __attribute__ (( always_inline )) void *
  18. memset ( void *dest, int character, size_t len ) {
  19. /* Not yet optimised */
  20. generic_memset ( dest, character, len );
  21. return dest;
  22. }
  23. /**
  24. * Copy memory region
  25. *
  26. * @v dest Destination region
  27. * @v src Source region
  28. * @v len Length
  29. * @ret dest Destination region
  30. */
  31. static inline __attribute__ (( always_inline )) void *
  32. memcpy ( void *dest, const void *src, size_t len ) {
  33. /* Not yet optimised */
  34. generic_memcpy ( dest, src, len );
  35. return dest;
  36. }
  37. /**
  38. * Copy (possibly overlapping) memory region
  39. *
  40. * @v dest Destination region
  41. * @v src Source region
  42. * @v len Length
  43. * @ret dest Destination region
  44. */
  45. static inline __attribute__ (( always_inline )) void *
  46. memmove ( void *dest, const void *src, size_t len ) {
  47. /* Not yet optimised */
  48. generic_memmove ( dest, src, len );
  49. return dest;
  50. }
  51. #endif /* BITS_STRING_H */