@@ -106,7 +106,7 @@ extension Subprocess {
106
106
}
107
107
}
108
108
109
- func tryTerminate( ) -> Error ? {
109
+ internal func tryTerminate( ) -> Error ? {
110
110
do {
111
111
try self . send ( . kill, toProcessGroup: true )
112
112
} catch {
@@ -124,9 +124,9 @@ extension Subprocess {
124
124
125
125
// MARK: - Environment Resolution
126
126
extension Subprocess . Environment {
127
- static let pathEnvironmentVariableName = " PATH "
127
+ internal static let pathEnvironmentVariableName = " PATH "
128
128
129
- func pathValue( ) -> String ? {
129
+ internal func pathValue( ) -> String ? {
130
130
switch self . config {
131
131
case . inherit( let overrides) :
132
132
// If PATH value exists in overrides, use it
@@ -145,7 +145,7 @@ extension Subprocess.Environment {
145
145
146
146
// This method follows the standard "create" rule: `env` needs to be
147
147
// manually deallocated
148
- func createEnv( ) -> [ UnsafeMutablePointer < CChar > ? ] {
148
+ internal func createEnv( ) -> [ UnsafeMutablePointer < CChar > ? ] {
149
149
func createFullCString(
150
150
fromKey keyContainer: Subprocess . StringOrRawBytes ,
151
151
value valueContainer: Subprocess . StringOrRawBytes
@@ -212,7 +212,7 @@ extension Subprocess.Environment {
212
212
extension Subprocess . Arguments {
213
213
// This method follows the standard "create" rule: `args` needs to be
214
214
// manually deallocated
215
- func createArgs( withExecutablePath executablePath: String ) -> [ UnsafeMutablePointer < CChar > ? ] {
215
+ internal func createArgs( withExecutablePath executablePath: String ) -> [ UnsafeMutablePointer < CChar > ? ] {
216
216
var argv : [ UnsafeMutablePointer < CChar > ? ] = self . storage. map { $0. createRawBytes ( ) }
217
217
// argv[0] = executable path
218
218
if let override = self . executablePathOverride {
@@ -246,7 +246,7 @@ extension Subprocess.ProcessIdentifier : CustomStringConvertible, CustomDebugStr
246
246
247
247
// MARK: - Executable Searching
248
248
extension Subprocess . Executable {
249
- static var defaultSearchPaths : Set < String > {
249
+ internal static var defaultSearchPaths : Set < String > {
250
250
return Set ( [
251
251
" /usr/bin " ,
252
252
" /bin " ,
@@ -256,7 +256,7 @@ extension Subprocess.Executable {
256
256
] )
257
257
}
258
258
259
- func resolveExecutablePath( withPathValue pathValue: String ? ) -> String ? {
259
+ internal func resolveExecutablePath( withPathValue pathValue: String ? ) -> String ? {
260
260
switch self . storage {
261
261
case . executable( let executableName) :
262
262
// If the executableName in is already a full path, return it directly
@@ -289,7 +289,7 @@ extension Subprocess.Executable {
289
289
290
290
// MARK: - Configuration
291
291
extension Subprocess . Configuration {
292
- func preSpawn( ) throws -> (
292
+ internal func preSpawn( ) throws -> (
293
293
executablePath: String ,
294
294
env: [ UnsafeMutablePointer < CChar > ? ] ,
295
295
argv: [ UnsafeMutablePointer < CChar > ? ] ,
@@ -343,7 +343,7 @@ extension Subprocess.Configuration {
343
343
)
344
344
}
345
345
346
- static func pathAccessible( _ path: String , mode: Int32 ) -> Bool {
346
+ internal static func pathAccessible( _ path: String , mode: Int32 ) -> Bool {
347
347
return path. withCString {
348
348
return access ( $0, mode) == 0
349
349
}
@@ -352,18 +352,18 @@ extension Subprocess.Configuration {
352
352
353
353
// MARK: - FileDescriptor extensions
354
354
extension FileDescriptor {
355
- static func openDevNull(
355
+ internal static func openDevNull(
356
356
withAcessMode mode: FileDescriptor . AccessMode
357
357
) throws -> FileDescriptor {
358
358
let devnull : FileDescriptor = try . open( " /dev/null " , mode)
359
359
return devnull
360
360
}
361
361
362
- var platformDescriptor : Subprocess . PlatformFileDescriptor {
362
+ internal var platformDescriptor : Subprocess . PlatformFileDescriptor {
363
363
return self
364
364
}
365
365
366
- func readChunk( upToLength maxLength: Int ) async throws -> Data ? {
366
+ internal func readChunk( upToLength maxLength: Int ) async throws -> Data ? {
367
367
return try await withCheckedThrowingContinuation { continuation in
368
368
DispatchIO . read (
369
369
fromFileDescriptor: self . rawValue,
@@ -383,7 +383,7 @@ extension FileDescriptor {
383
383
}
384
384
}
385
385
386
- func readUntilEOF( upToLength maxLength: Int ) async throws -> Data {
386
+ internal func readUntilEOF( upToLength maxLength: Int ) async throws -> Data {
387
387
return try await withCheckedThrowingContinuation { continuation in
388
388
let dispatchIO = DispatchIO (
389
389
type: . stream,
@@ -404,7 +404,7 @@ extension FileDescriptor {
404
404
continuation. resume ( throwing: POSIXError ( . init( rawValue: error) ?? . ENODEV) )
405
405
return
406
406
}
407
- if let data {
407
+ if let data = data {
408
408
buffer += Data ( data)
409
409
}
410
410
if done {
@@ -415,7 +415,7 @@ extension FileDescriptor {
415
415
}
416
416
}
417
417
418
- func write< S: Sequence > ( _ data: S ) async throws where S. Element == UInt8 {
418
+ internal func write< S: Sequence > ( _ data: S ) async throws where S. Element == UInt8 {
419
419
try await withCheckedThrowingContinuation { ( continuation: CheckedContinuation < Void , Error > ) -> Void in
420
420
let dispatchData : DispatchData = Array ( data) . withUnsafeBytes {
421
421
return DispatchData ( bytes: $0)
@@ -439,13 +439,13 @@ extension FileDescriptor {
439
439
}
440
440
441
441
extension Subprocess {
442
- typealias PlatformFileDescriptor = FileDescriptor
442
+ internal typealias PlatformFileDescriptor = FileDescriptor
443
443
}
444
444
445
445
// MARK: - Read Buffer Size
446
446
extension Subprocess {
447
447
@inline ( __always)
448
- static var readBufferSize : Int {
448
+ internal static var readBufferSize : Int {
449
449
#if canImport(Darwin)
450
450
return 16384
451
451
#else
0 commit comments