Botan 3.1.1
Crypto and TLS for C&
Classes | Namespaces | Macros | Functions
ffi_util.h File Reference

Internal Header. More...

#include <botan/exceptn.h>
#include <botan/mem_ops.h>
#include <cstdint>
#include <functional>
#include <memory>
#include <stdexcept>

Go to the source code of this file.

Classes

struct  Botan_FFI::botan_struct< T, MAGIC >
 
struct  Botan_FFI::botan_view_bounce_struct
 
class  Botan_FFI::FFI_Error
 

Namespaces

namespace  Botan_FFI
 

Macros

#define BOTAN_FFI_CHECKED_DELETE(o)   ffi_delete_object(o, __func__)
 
#define BOTAN_FFI_DECLARE_DUMMY_STRUCT(NAME, MAGIC)    struct NAME final : public Botan_FFI::botan_struct<int, MAGIC> {}
 
#define BOTAN_FFI_DECLARE_STRUCT(NAME, TYPE, MAGIC)
 
#define BOTAN_FFI_VISIT(obj, lambda)   botan_ffi_visit(obj, lambda, __func__)
 

Functions

template<typename T , uint32_t M, typename F >
int Botan_FFI::botan_ffi_visit (botan_struct< T, M > *o, F func, const char *func_name)
 
int Botan_FFI::botan_view_bin_bounce_fn (botan_view_ctx vctx, const uint8_t *buf, size_t len)
 
int Botan_FFI::botan_view_str_bounce_fn (botan_view_ctx vctx, const char *str, size_t len)
 
template<typename Fn , typename... Args>
int Botan_FFI::copy_view_bin (uint8_t out[], size_t *out_len, Fn fn, Args... args)
 
template<typename Fn , typename... Args>
int Botan_FFI::copy_view_str (uint8_t out[], size_t *out_len, Fn fn, Args... args)
 
template<typename T , uint32_t M>
int Botan_FFI::ffi_delete_object (botan_struct< T, M > *obj, const char *func_name)
 
int Botan_FFI::ffi_error_exception_thrown (const char *func_name, const char *exn, int rc)
 
int Botan_FFI::ffi_guard_thunk (const char *func_name, const std::function< int()> &thunk)
 
template<typename Alloc >
int Botan_FFI::invoke_view_callback (botan_view_bin_fn view, botan_view_ctx ctx, const std::vector< uint8_t, Alloc > &buf)
 
int Botan_FFI::invoke_view_callback (botan_view_str_fn view, botan_view_ctx ctx, std::string_view str)
 
template<typename T , uint32_t M>
TBotan_FFI::safe_get (botan_struct< T, M > *p)
 
int Botan_FFI::write_output (uint8_t out[], size_t *out_len, const uint8_t buf[], size_t buf_len)
 
int Botan_FFI::write_str_output (char out[], size_t *out_len, const std::vector< uint8_t > &str_vec)
 
int Botan_FFI::write_str_output (char out[], size_t *out_len, std::string_view str)
 
int Botan_FFI::write_str_output (uint8_t out[], size_t *out_len, std::string_view str)
 
template<typename Alloc >
int Botan_FFI::write_vec_output (uint8_t out[], size_t *out_len, const std::vector< uint8_t, Alloc > &buf)
 

Detailed Description

Internal Header.

Definition in file ffi_util.h.

Macro Definition Documentation

◆ BOTAN_FFI_CHECKED_DELETE

#define BOTAN_FFI_CHECKED_DELETE (   o)    ffi_delete_object(o, __func__)

Definition at line 134 of file ffi_util.h.

◆ BOTAN_FFI_DECLARE_DUMMY_STRUCT

#define BOTAN_FFI_DECLARE_DUMMY_STRUCT (   NAME,
  MAGIC 
)     struct NAME final : public Botan_FFI::botan_struct<int, MAGIC> {}

Definition at line 55 of file ffi_util.h.

◆ BOTAN_FFI_DECLARE_STRUCT

#define BOTAN_FFI_DECLARE_STRUCT (   NAME,
  TYPE,
  MAGIC 
)
Value:
struct NAME final : public Botan_FFI::botan_struct<TYPE, MAGIC> { \
explicit NAME(std::unique_ptr<TYPE> x) : botan_struct(std::move(x)) {} \
}
int(* final)(unsigned char *, CTX *)
Definition: bigint.h:1030

Definition at line 50 of file ffi_util.h.

◆ BOTAN_FFI_VISIT

#define BOTAN_FFI_VISIT (   obj,
  lambda 
)    botan_ffi_visit(obj, lambda, __func__)

Definition at line 117 of file ffi_util.h.