refactor envvars, oserrors; register vmops (#20592)

* refactor envvars, oserrors; register vmops

* remove type definitions
This commit is contained in:
ringabout 2022-10-19 01:44:26 +08:00 • committed by GitHub
commit b07526b2c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 347 deletions

View file

@ -81,11 +81,6 @@ else:
proc normalizePathAux(path: var string){.inline, raises: [], noSideEffect.}
type
ReadEnvEffect* = object of ReadIOEffect ## Effect that denotes a read
## from an environment variable.
WriteEnvEffect* = object of WriteIOEffect ## Effect that denotes a write
## to an environment variable.
ReadDirEffect* = object of ReadIOEffect ## Effect that denotes a read
## operation from the directory
## structure.
@ -93,8 +88,6 @@ type
## operation to
## the directory structure.
OSErrorCode* = distinct int32 ## Specifies an OS Error Code.
import std/private/osseps
export osseps
@ -884,8 +877,11 @@ proc unixToNativePath*(path: string, drive=""): string {.
add result, path[i]
inc(i)
include "includes/oserr"
include "includes/osenv"
import std/oserrors
export oserrors
import std/envvars
export envvars
proc getHomeDir*(): string {.rtl, extern: "nos$1",
tags: [ReadEnvEffect, ReadIOEffect].} =