14
14
* limitations under the License.
15
15
*/
16
16
17
- internal import CGRPCZlib
17
+ internal import CGRPCNIOTransportZlib
18
18
internal import GRPCCore
19
19
internal import NIOCore
20
20
@@ -152,7 +152,7 @@ extension UnsafeMutablePointer<z_stream> {
152
152
self . pointee. zalloc = nil
153
153
self . pointee. opaque = nil
154
154
155
- let rc = CGRPCZlib_inflateInit2 ( self , windowBits)
155
+ let rc = CGRPCNIOTransportZlib_inflateInit2 ( self , windowBits)
156
156
// Possible return codes:
157
157
// - Z_OK
158
158
// - Z_MEM_ERROR: not enough memory
@@ -163,7 +163,7 @@ extension UnsafeMutablePointer<z_stream> {
163
163
}
164
164
165
165
func inflateReset( ) throws {
166
- let rc = CGRPCZlib_inflateReset ( self )
166
+ let rc = CGRPCNIOTransportZlib_inflateReset ( self )
167
167
168
168
// Possible return codes:
169
169
// - Z_OK
@@ -179,15 +179,15 @@ extension UnsafeMutablePointer<z_stream> {
179
179
}
180
180
181
181
func inflateEnd( ) {
182
- _ = CGRPCZlib_inflateEnd ( self )
182
+ _ = CGRPCNIOTransportZlib_inflateEnd ( self )
183
183
}
184
184
185
185
func deflateInit( windowBits: Int32) {
186
186
self . pointee. zfree = nil
187
187
self . pointee. zalloc = nil
188
188
self . pointee. opaque = nil
189
189
190
- let rc = CGRPCZlib_deflateInit2 (
190
+ let rc = CGRPCNIOTransportZlib_deflateInit2 (
191
191
self ,
192
192
Z_DEFAULT_COMPRESSION, // compression level
193
193
Z_DEFLATED, // compression method (this must be Z_DEFLATED)
@@ -207,7 +207,7 @@ extension UnsafeMutablePointer<z_stream> {
207
207
}
208
208
209
209
func deflateReset( ) throws {
210
- let rc = CGRPCZlib_deflateReset ( self )
210
+ let rc = CGRPCNIOTransportZlib_deflateReset ( self )
211
211
212
212
// Possible return codes:
213
213
// - Z_OK
@@ -223,11 +223,11 @@ extension UnsafeMutablePointer<z_stream> {
223
223
}
224
224
225
225
func deflateEnd( ) {
226
- _ = CGRPCZlib_deflateEnd ( self )
226
+ _ = CGRPCNIOTransportZlib_deflateEnd ( self )
227
227
}
228
228
229
229
func deflateBound( inputBytes: Int ) -> Int {
230
- let bound = CGRPCZlib_deflateBound ( self , UInt ( inputBytes) )
230
+ let bound = CGRPCNIOTransportZlib_deflateBound ( self , UInt ( inputBytes) )
231
231
return Int ( bound)
232
232
}
233
233
@@ -243,7 +243,7 @@ extension UnsafeMutablePointer<z_stream> {
243
243
244
244
func setNextInputBuffer( _ buffer: UnsafeMutableRawBufferPointer ? ) {
245
245
if let buffer = buffer, let baseAddress = buffer. baseAddress {
246
- self . pointee. next_in = CGRPCZlib_castVoidToBytefPointer ( baseAddress)
246
+ self . pointee. next_in = CGRPCNIOTransportZlib_castVoidToBytefPointer ( baseAddress)
247
247
self . pointee. avail_in = UInt32 ( buffer. count)
248
248
} else {
249
249
self . pointee. next_in = nil
@@ -263,7 +263,7 @@ extension UnsafeMutablePointer<z_stream> {
263
263
264
264
func setNextOutputBuffer( _ buffer: UnsafeMutableRawBufferPointer ? ) {
265
265
if let buffer = buffer, let baseAddress = buffer. baseAddress {
266
- self . pointee. next_out = CGRPCZlib_castVoidToBytefPointer ( baseAddress)
266
+ self . pointee. next_out = CGRPCNIOTransportZlib_castVoidToBytefPointer ( baseAddress)
267
267
self . pointee. avail_out = UInt32 ( buffer. count)
268
268
} else {
269
269
self . pointee. next_out = nil
@@ -339,7 +339,7 @@ extension UnsafeMutablePointer<z_stream> {
339
339
//
340
340
// Note that Z_OK is not okay here since we always flush with Z_FINISH and therefore
341
341
// use Z_STREAM_END as our success criteria.
342
- let rc = CGRPCZlib_inflate ( self , Z_FINISH)
342
+ let rc = CGRPCNIOTransportZlib_inflate ( self , Z_FINISH)
343
343
switch rc {
344
344
case Z_STREAM_END:
345
345
finished = true
@@ -392,7 +392,7 @@ extension UnsafeMutablePointer<z_stream> {
392
392
return try output. writeWithUnsafeMutableBytes ( minimumWritableBytes: upperBound) { output in
393
393
self . setNextOutputBuffer ( output)
394
394
395
- let rc = CGRPCZlib_deflate ( self , Z_FINISH)
395
+ let rc = CGRPCNIOTransportZlib_deflate ( self , Z_FINISH)
396
396
397
397
// Possible return codes:
398
398
// - Z_OK: some progress has been made
0 commit comments