libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_marshal.h File Reference

Go to the source code of this file.

Macros

#define GBL_DEFINE_CCLOSURE_MARSHAL_VOID___(paramsPostfix, paramCount, paramList, argList)
 
Generator Macros

Macro utilities for autogenerating a GblMarshalFn

#define GBL_DECL_CCLOSURE_MARSHAL_VOID__(postFix)
 
#define GBL_DEFINE_CCLOSURE_MARSHAL_VOID__(paramsPostfix, paramCount, paramList, argList)
 

Typedefs

typedef GBL_RESULT(* GblMarshalFn) (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
typedef GBL_RESULT(* GblMarshalVaFn) (GblClosure *pClosure, GblVariant *pRetValue, void *pInstance, va_list args, void *pMarshalData, size_t argCount, const GblType *pParamTypes)
 

Builtin Marshals

Marshals which come pregenerated with libGimbal

#define GBL_DECL_CCLOSURE_MARSHAL_VOID___(postFix)
 
GBL_RESULT GblMarshal_CClosure_VOID__VOID (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_ClassClosureMeta (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_SignalForwarder (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_BOOL (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_CHAR (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_UINT8 (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_UINT16 (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_INT16 (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_UINT32 (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_INT32 (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_UINT64 (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_INT64 (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_SIZE (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_FLOAT (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_DOUBLE (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_STRING (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_ENUM (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_FLAGS (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_POINTER (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_OPAQUE (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_INSTANCE (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 
GBL_RESULT GblMarshal_CClosure_VOID__INSTANCE_INSTANCE_SIZE (GblClosure *pClosure, GblVariant *pRetValue, size_t argCount, GblVariant *pArgs, GblPtr pMarshalData)
 

Detailed Description

Builtin GblMarshalFn functions and generator macros.

This file contains the declarations and utilities for GblMarshalFn and various builtin implementations of it.

See also
GblMarshalFn
Author
2023 Falco Girgis

Definition in file gimbal_marshal.h.

Macro Definition Documentation

◆ GBL_DECL_CCLOSURE_MARSHAL_VOID__

#define GBL_DECL_CCLOSURE_MARSHAL_VOID__ (   postFix)

Declares a GblMarshalFn for a GblCClosure which returns nothing and has the given name postfix (usually underscore separated arg types)

Definition at line 25 of file gimbal_marshal.h.

129 { \
130 GBL_UNUSED(pRetValue, argCount); \
131 typedef void (*CFunction)(GBL_EVAL paramList); \
132 GBL_ASSERT(argCount >= paramCount); \
133 GBL_ASSERT(!pRetValue || GblVariant_typeOf(pRetValue) == GBL_INVALID_TYPE); \
134 GblCClosure* pCClosure = (GblCClosure*)pClosure; \
135 CFunction pFnPtr = (CFunction)((pMarshalData.pFunc)? \
136 pMarshalData.pFunc : GBL_PRIV_REF(pCClosure).pFnCallback); \
137 pFnPtr(GBL_EVAL argList); \
138 return GBL_RESULT_SUCCESS; \
139 }
140
141#endif // GIMBAL_MARSHAL_H
#define GBL_INVALID_TYPE
GblType UUID of the invalid type.
Definition gimbal_type.h:31
Closure type for invoking C functions.

◆ GBL_DEFINE_CCLOSURE_MARSHAL_VOID__

#define GBL_DEFINE_CCLOSURE_MARSHAL_VOID__ (   paramsPostfix,
  paramCount,
  paramList,
  argList 
)

Defines a GblMarshalFn for a GblCClosure autogenerating the implementation with the given info.

Definition at line 28 of file gimbal_marshal.h.

◆ GBL_DECL_CCLOSURE_MARSHAL_VOID___

#define GBL_DECL_CCLOSURE_MARSHAL_VOID___ (   postFix)

Definition at line 88 of file gimbal_marshal.h.

◆ GBL_DEFINE_CCLOSURE_MARSHAL_VOID___

#define GBL_DEFINE_CCLOSURE_MARSHAL_VOID___ (   paramsPostfix,
  paramCount,
  paramList,
  argList 
)

Definition at line 123 of file gimbal_marshal.h.

129 { \
130 GBL_UNUSED(pRetValue, argCount); \
131 typedef void (*CFunction)(GBL_EVAL paramList); \
132 GBL_ASSERT(argCount >= paramCount); \
133 GBL_ASSERT(!pRetValue || GblVariant_typeOf(pRetValue) == GBL_INVALID_TYPE); \
134 GblCClosure* pCClosure = (GblCClosure*)pClosure; \
135 CFunction pFnPtr = (CFunction)((pMarshalData.pFunc)? \
136 pMarshalData.pFunc : GBL_PRIV_REF(pCClosure).pFnCallback); \
137 pFnPtr(GBL_EVAL argList); \
138 return GBL_RESULT_SUCCESS; \
139 }

Typedef Documentation

◆ GblMarshalVaFn

typedef GBL_RESULT(* GblMarshalVaFn) (GblClosure *pClosure, GblVariant *pRetValue, void *pInstance, va_list args, void *pMarshalData, size_t argCount, const GblType *pParamTypes)

Unimplemented, but mirror of GblMarshalFn using a va_list to hold args instead of GblVariant.

Definition at line 57 of file gimbal_marshal.h.

Function Documentation

◆ GblMarshal_CClosure_VOID__VOID()

GBL_RESULT GblMarshal_CClosure_VOID__VOID ( GblClosure pClosure,
GblVariant pRetValue,
size_t  argCount,
GblVariant pArgs,
GblPtr  pMarshalData 
)

< GblMarshalFn which takes nothing and returns nothing

GblMarshalFn to be used as the meta marshal for GblClassClosure

◆ GblMarshal_ClassClosureMeta()

GBL_RESULT GblMarshal_ClassClosureMeta ( GblClosure pClosure,
GblVariant pRetValue,
size_t  argCount,
GblVariant pArgs,
GblPtr  pMarshalData 
)

GblMarshalFn to be used as the marshal for GblSignalClosure.