OSFI-C++  3.10.0
OpenSF Integration Library
ffi_base.h File Reference

Internal header used by the foreign-function interface to OSFI-C++. More...

Go to the source code of this file.

Macros

#define OSFI_FFI_NORETURN   [[noreturn]]
 
#define OSFI_FFI_DEPRECATED(reason)   [[deprecated(reason)]]
 
#define CONCAT_(A, B)   A##B
 
#define CONCAT(A, B)   CONCAT_(A,B)
 
#define OSFI_FFI_DECL_PLACEHOLDER(name)   typedef struct CONCAT(name,_t) name
 
FFI vector types "C templates"
#define OSFI_VEC_T(Tname)   OSFI_Vec_T##Tname
 
#define OSFI_DECL_VEC_T(Tname, Ttype)
 
#define OSFI_DECL_VEC_GETTER_simple(Tname, Ttype)
 
#define OSFI_DECL_VEC_GETTER_str(Tname, Ttype)
 
#define OSFI_DECL_VEC_OPER(Tname, Ttype, kind)
 
#define OSFI_DECL_VECTOR(Tname, Ttype, kind)
 

Typedefs

typedef struct OSFI_TimeValue_t OSFI_TimeValue
 

Detailed Description

Internal header used by the foreign-function interface to OSFI-C++.

This file exposes an interface to the OSFI functions that can be called without C++ name mangling or other C++-specific features such as exception handling. It is not the OSFI-C interface, which resides in "OSFIC.h". It is intended as an intermediate layer to create bindings to OSFI-C++ from other languages; currently C and Fortran are supported through it.

Macro Definition Documentation

◆ OSFI_DECL_VEC_GETTER_simple

#define OSFI_DECL_VEC_GETTER_simple (   Tname,
  Ttype 
)
Value:
\
Ttype osfi_confm_vector_##Tname##_get(const OSFI_VEC_T(Tname) *v, int index); \ \
int osfi_confm_vector_##Tname##_copyall(const OSFI_VEC_T(Tname) *v, Ttype* arr, int length);

◆ OSFI_DECL_VEC_GETTER_str

#define OSFI_DECL_VEC_GETTER_str (   Tname,
  Ttype 
)
Value:
\
int osfi_confm_vector_##Tname##_get(const OSFI_VEC_T(Tname) *v, int index, Ttype buf, int bufSz); \ \
bool osfi_confm_vector_##Tname##_copyall(const OSFI_VEC_T(Tname) *v, Ttype* strArr, int* itemSz, int* numItems);

◆ OSFI_DECL_VEC_OPER

#define OSFI_DECL_VEC_OPER (   Tname,
  Ttype,
  kind 
)
Value:
\
int osfi_confm_vector_##Tname##_numel(const OSFI_VEC_T(Tname) *v); \ \
void osfi_confm_vector_##Tname##_destroy(OSFI_VEC_T(Tname) ** obj); \
OSFI_DECL_VEC_GETTER_ ## kind(Tname, Ttype);

◆ OSFI_DECL_VEC_T

#define OSFI_DECL_VEC_T (   Tname,
  Ttype 
)
Value:
\
OSFI_FFI_DECL_PLACEHOLDER(OSFI_VEC_T(Tname))

◆ OSFI_DECL_VECTOR

#define OSFI_DECL_VECTOR (   Tname,
  Ttype,
  kind 
)
Value:
OSFI_DECL_VEC_T(Tname, Ttype); \
OSFI_DECL_VEC_OPER(Tname, Ttype, kind)

Declares an OSFI-managed vector type and its associated functions.

Parameters
Tnamethe name for the type and its functions.
Ttypethe element type in the FFI.
kindeither simple or str, depending on the element type.

◆ OSFI_FFI_DECL_PLACEHOLDER

#define OSFI_FFI_DECL_PLACEHOLDER (   name)    typedef struct CONCAT(name,_t) name

Declares an incomplete type with the given name, a placeholder to be used by the FFI API only in pointer form.

◆ OSFI_FFI_NORETURN

#define OSFI_FFI_NORETURN   [[noreturn]]

Attribute to specify that a function never returns. Empty if unsupported

Typedef Documentation

◆ OSFI_TimeValue

typedef struct OSFI_TimeValue_t OSFI_TimeValue

TimeValue object, in the FFI.