/red-system/runtime/darwin.reds

http://github.com/dockimbel/Red · Redscript · 39 lines · 33 code · 6 blank · 0 comment · 0 complexity · 91424752f9c6b5de1279fd974792d716 MD5 · raw file

  1. Red/System [
  2. Title: "Red/System MacOS X runtime"
  3. Author: "Nenad Rakocevic"
  4. File: %darwin.reds
  5. Rights: "Copyright (C) 2011 Nenad Rakocevic. All rights reserved."
  6. License: {
  7. Distributed under the Boost Software License, Version 1.0.
  8. See https://github.com/dockimbel/Red/blob/master/red-system/runtime/BSL-License.txt
  9. }
  10. ]
  11. #define OS_TYPE 4
  12. #syscall [
  13. write: 4 [
  14. fd [integer!]
  15. buffer [c-string!]
  16. count [integer!]
  17. return: [integer!]
  18. ]
  19. ]
  20. #if use-natives? = yes [
  21. #syscall [
  22. quit: 1 [ ;-- "exit" syscall
  23. status [integer!]
  24. ]
  25. ]
  26. ]
  27. ;-------------------------------------------
  28. ;-- Retrieve command-line information from stack
  29. ;-------------------------------------------
  30. system/args-count: pop
  31. system/args-list: as str-array! system/stack/top
  32. system/env-vars: system/args-list + system/args-count + 1
  33. #include %BSD.reds