Skip to content

Commit

Permalink
Use the new cligen/unsafeAddr idea where appropriate.
Browse files Browse the repository at this point in the history
  • Loading branch information
c-blake committed Jan 4, 2023
1 parent e509731 commit 71e6717
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions bu/execstr.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
when not declared(stderr): import std/syncio
import posix, parseutils, strformat, os
include cligen/unsafeAddr

type
Kind = enum word, assign, iRedir, oRedir, fddup, bkgd, complex
Expand Down
1 change: 1 addition & 0 deletions saft.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
when not declared(stderr): import std/syncio
include cligen/unsafeAddr
import cligen, cligen/[osUt, posixUt], std/[posix, strformat]

template eStr: untyped = $strerror(errno) # Error string for last errno
Expand Down
3 changes: 2 additions & 1 deletion tails.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from cligen/osUt import getDelims, uriteBuffer, ureadBuffer, c_getdelim
when not declared(stdout): import std/syncio
include cligen/unsafeAddr
from cligen/osUt import getDelims, uriteBuffer, ureadBuffer, c_getdelim
proc free(pointr: cstring) {.importc, header: "<stdlib.h>".}

proc wrec(cs: cstring, n: int, eor: char): bool {.inline.} = # NOTE n-1
Expand Down
3 changes: 2 additions & 1 deletion unfold.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import cligen/osUt, re, cligen # cligen is early for `HelpError`
when not declared(stdin): import std/syncio
include cligen/unsafeAddr
import cligen/osUt, re, cligen # cligen is early for `HelpError`

proc unfold(sep="\t", n=0, before="", after="", ignore=false, extended=false) =
## Join blocks of stdin lines into one line sent to stdout.
Expand Down

0 comments on commit 71e6717

Please sign in to comment.