CRYPTO_BUFFER_new function

  1. @RecordUse.new()
  2. @Native<Pointer<CRYPTO_BUFFER> Function(Pointer<Uint8>, Size, Pointer<CRYPTO_BUFFER_POOL>)>(ffi.Pointer<ffi.Uint8>, ffi.Size, ffi.Pointer<CRYPTO_BUFFER_POOL>)>(symbol: 'bssl_dart_CRYPTO_BUFFER_new')
Pointer<CRYPTO_BUFFER> CRYPTO_BUFFER_new(
  1. Pointer<Uint8> data,
  2. int len,
  3. Pointer<CRYPTO_BUFFER_POOL> pool
)

CRYPTO_BUFFER_new returns a |CRYPTO_BUFFER| containing a copy of |data|, or else NULL on error. If |pool| is not NULL then the returned value may be a reference to a previously existing |CRYPTO_BUFFER| that contained the same data. Otherwise, the returned, fresh |CRYPTO_BUFFER| will be added to the pool.

There is no requirement that |pool| outlive the |CRYPTO_BUFFER|, or vice versa. If the |CRYPTO_BUFFER| is released first, it will be removed from |pool|. If |pool| is released first, the |CRYPTO_BUFFER| remains valid.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Pointer<CRYPTO_BUFFER> Function(
    ffi.Pointer<ffi.Uint8>,
    ffi.Size,
    ffi.Pointer<CRYPTO_BUFFER_POOL>,
  )
>(symbol: 'bssl_dart_CRYPTO_BUFFER_new')
external ffi.Pointer<CRYPTO_BUFFER> CRYPTO_BUFFER_new(
  ffi.Pointer<ffi.Uint8> data,
  int len,
  ffi.Pointer<CRYPTO_BUFFER_POOL> pool,
);