string.odin 928 B

12345678910111213141516171819202122232425262728293031323334
  1. #+build linux, darwin, netbsd, openbsd, freebsd
  2. package posix
  3. import "core:c"
  4. when ODIN_OS == .Darwin {
  5. foreign import lib "system:System.framework"
  6. } else {
  7. foreign import lib "system:c"
  8. }
  9. // string.h - string operations
  10. // NOTE: most of the symbols in this header are not useful in Odin and have been left out.
  11. foreign lib {
  12. /*
  13. Map the error number to a locale-dependent error message string and put it in the buffer.
  14. Returns: ERANGE if the buffer is not big enough
  15. [[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror_r.html ]]
  16. */
  17. strerror_r :: proc(errnum: Errno, strerrbuf: [^]byte, buflen: c.size_t) -> Errno ---
  18. /*
  19. Map the signal number to an implementation-defined string.
  20. Returns: a string that may be invalidated by subsequent calls
  21. [[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/strsignal.html ]]
  22. */
  23. strsignal :: proc(sig: Signal) -> cstring ---
  24. }