env.nim 830 B

123456789101112131415161718192021222324252627282930
  1. #
  2. #
  3. # Nim's Runtime Library
  4. # (c) Copyright 2018 Emery Hemingway
  5. #
  6. # See the file "copying.txt", included in this
  7. # distribution, for details about the copyright.
  8. #
  9. #
  10. # This file contains the minimum required definitions
  11. # for interacting with the initial Genode environment.
  12. # It is reserved for use only within the standard
  13. # library. See `componentConstructHook` in the system
  14. # module for accessing the Genode environment after the
  15. # standard library has finished initializating.
  16. #
  17. when not defined(genode):
  18. {.error: "Genode only module".}
  19. type
  20. GenodeEnvObj* {.importcpp: "Genode::Env", header: "<base/env.h>", pure.} = object
  21. GenodeEnvPtr* = ptr GenodeEnvObj
  22. const runtimeEnvSym* = "nim_runtime_env"
  23. when not defined(nimscript):
  24. var runtimeEnv* {.importcpp: runtimeEnvSym.}: GenodeEnvPtr