11#include "LibMkKernel_mk.h"
146#ifndef META_HAVE_LIBCONFIG
147 #error "META_HAVE_LIBCONFIG was NOT defined, require 1 or 0"
158#ifndef META_USE_GLOBAL_EVENT
159# define META_USE_GLOBAL_EVENT 0
167#define META_BROKEN_LINK_SEND_FAIL_COUNTER 16
173# undef MQ_C_BUILD_DLL
174# define MQ_C_BUILD_DLL
178# define MQ_DEBUG_RUNTIME mk_dbg_color_ln(MK_COLOR_YELLOW,"mkrt<%p:%p>, mqrt<%p:%p>", mkrt, MkRT, mqrt, MqRT)
180# define MQ_DEBUG_RUNTIME
214# define MQ_RT_ARGS_ONLY MK_RT mkrt, MQ_RT mqrt
215# define MQ_RT_ARGS MQ_RT_ARGS_ONLY,
216# define MQ_RT_CALL_ONLY mkrt, mqrt
217# define MQ_RT_CALL MQ_RT_CALL_ONLY,
218# define MQ_RT_PTR mqrt
219# define MQ_RT_REF (*mqrt)
221# define MQ_RT_ARGS_ONLY void
223# define MQ_RT_CALL_ONLY
225# define MQ_RT_PTR &MqRuntimeRLS
226# define MQ_RT_REF MqRuntimeRLS
231#define MQ_INSTANCE_RT_X(x) MK_INSTANCE_RT_X(x) ; MqRtSetup_XN(x)
232#define MQ_INSTANCE_RT_X_NULL(x) MK_INSTANCE_RT_X_NULL(x) ; MqRtSetup_X(x)
233#define MQ_INSTANCE_RT_O(o) MK_INSTANCE_RT_O(o) ; MqRtSetup_ON(o)
234#define MQ_INSTANCE_RT_O_NULL(o) MK_INSTANCE_RT_O_NULL(o) ; MqRtSetup_O(o)
235#define MQ_DESTRUCTOR_RT_X(c,x) MK_DESTRUCTOR_RT_X(c,x) ; MqRtSetup_XN(x)
236#define MQ_STATIC_RT MK_STATIC_RT ; MqRtSetup_NULL
245#undef BEGIN_MQ_C_DECLS
247#if defined(META_COMPILE_AS_CC)
248# define BEGIN_MQ_C_DECLS namespace libmqmsgque { using namespace libmkkernel;
249# define END_MQ_C_DECLS }
250#elif defined(__cplusplus)
251# define BEGIN_MQ_C_DECLS extern "C" {
252# define END_MQ_C_DECLS }
254# define BEGIN_MQ_C_DECLS
255# define END_MQ_C_DECLS
259#ifndef PARSE_C_HEADER_TO_META
385#if defined(META_IGNORE_EXTERN)
389# if defined(DLL_EXPORT)
391# if defined(MQ_C_BUILD_DLL)
392# define MQ_EXTERN __declspec(dllexport)
394# define MQ_EXTERN __declspec(dllimport)
398# define MQ_EXTERN __attribute__ ((visibility("default")))
407#if defined(META_PRIVATE)
408# define MQ_EXTERN_DATA extern
409#elif defined(META_IGNORE_EXTERN)
410# define MQ_EXTERN_DATA extern
413# if defined(DLL_EXPORT)
415# if defined(MQ_C_BUILD_DLL)
416# define MQ_EXTERN_DATA __declspec(dllexport)
418# define MQ_EXTERN_DATA __declspec(dllimport)
422# define MQ_EXTERN_DATA __attribute__ ((visibility("default"))) extern
425# define MQ_EXTERN_DATA extern
465__parser__(type=ME_NI4_MQ_HDL:"handle data-type")
482 __parser__(internal,type=ME_CCC_MqErrorC:"extension management class for
MqErrorS":internal)
485 __parser__(internal,type=ME_CCN_MqErrorC:"const - extension management class for
MqErrorS":internal)
496 __parser__(internal,type=ME_CCC_MqRuntimeC:"MqRuntimeC class handle":internal)
499 __parser__(internal,type=ME_CCN_MqRuntimeC:"const - MqRuntimeC class handle":internal)
524 __parser__(type=ME_CCC_MqFactoryC:"MqFactoryC class handle":primary)
527 __parser__(type=ME_CCN_MqFactoryC:"const - MqFactoryC class handle":primary)
538 __parser__(type=ME_CCC_MqContextC:"MqContextC class handle":primary)
541 __parser__(type=ME_CCN_MqContextC:"const - MqContextC class handle":primary)
552 __parser__(type=ME_CCC_MqDumpC:"MqDumpC class handle":primary)
555 __parser__(type=ME_CCN_MqDumpC:"const - MqDumpC class handle":primary)
566 __parser__(internal,type=ME_CCC_MqEnvC:"MqEnvC class handle":internal)
569 __parser__(internal,type=ME_CCN_MqEnvC:"const - MqEnvC class handle":internal)
596#if defined(__MINGW32__) || defined(_MSC_VER)
598# define MK_FORMAT_SOCK "%I64u"
602# define MK_FORMAT_SOCK "%i"
637__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
642__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
675__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
680__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
715__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc,
return-type-
default-no)
720__parser__(doc-group=Enum,doc-index=_ignore_,class=MqMsgque,no-rpc,prefix=EnumFunc,return-type-default-no)
728__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc)
808 #define MqEnvC_SIGNATURE (MkObjectC_SIGNATURE ^ (15u<<10))
809 #define MqEnvC_MASK (((1u<<22)-1)<<10)
817 #define MqEnvC_X2env(x) (x)
818 #define MqEnvC_X2obj(x) MkOBJ(x)
831 #define MqEnvC_T (&MQ_RT_REF._MqEnvC_T)
833 #define MqEnvC_TT (MkTYP(MqEnvC_T))
835 #define MqEnvST MqEnvC_T
837 #define MqEnvSTT (MkTYP(MqEnvST))
839 #define MqEnvC_type MQ_ENV
841 #define MqEnvCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
843 #define MqEnvCTT_X(instance) (MkOBJ_R(instance).type)
845 #define MqEnvCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
849 #define MqEnvCTT MqEnvCTT
851 #define MqEnvCT ( (struct MkTypeDefS *) MqEnvCTT )
859 #pragma GCC diagnostic push
860 #pragma GCC diagnostic ignored "-Wattributes"
878 #pragma GCC diagnostic pop
879 #define MqEnvC_Check(mng) MqEnvCheck(mng)
889 META_ATTRIBUTE_SANITIZE
897 META_ATTRIBUTE_SANITIZE
904 #define MqEnvRaise(_env) if (!_MkCheckX(MqEnvC,_env)) { \
905 MkErrorSetC_1E("'MqEnvC' hdl is NULL"); \
910 #define MqENV_R(x) (*(x)).super.env
912 #define MqENV(x) (&MqENV_R(x))
929#define MQ_SERVICE_CALL_CHECK do { \
930 assert (__data__ != NULL); \
931 if (MqCtxCheck(mqctx) == false || MkOBJ_R(mqctx).self == NULL) return MK_OK; \
936#define MQ_SERVICE_CALL_ARGS MK_RT_ARGS MQ_CTX const mqctx, MK_PTR const __data__
938#define MQ_SERVICE_CALL MK_RT_CALL mqctx, __data__
959#define MQ_SERVICE_FREE_ARGS MK_RT_ARGS MQ_CTX const mqctx, MK_PTR *dataP __parser__(inout)
968#define MQ_SERVICE_COPY_ARGS MK_RT_ARGS MQ_CTX const mqctx, MK_PTR *dataP __parser__(inout)
1000#if defined(MQ_C_BUILD_DLL)
1002 #define META_SECTION_DEFINE
1003 #include "MqLinkS_mq.h"
1004 #undef META_SECTION_DEFINE
1018 #define MqLinkS_targetIdent_size 64
1190#define MQ_CALLBACK_CREATE_ARGS MK_RT_ARGS MQ_CTX const mqctx, MK_BFL const argv
1191#define MQ_CALLBACK_CREATE_CALL MK_RT_CALL mqctx, argv
1213) __attribute__ ((noreturn));
1382#ifndef META_COMPILE_AS_CC
1383__attribute__ ((constructor(300)))
1391#ifndef META_COMPILE_AS_CC
1392__attribute__ ((destructor(300)))
1436__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc,
return-type-
default-no)
1441__parser__(doc-group=Enum,doc-index=_ignore_,class=MqMsgque,no-rpc,prefix=EnumFunc,return-type-default-no)
1449__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc)
1479__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc,
return-type-
default-no)
1484__parser__(doc-group=Enum,doc-index=_ignore_,class=MqMsgque,no-rpc,prefix=EnumFunc,return-type-default-no)
1492__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc)
1518__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
1523__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
1556__parser__(internal,no-rpc,prefix=EnumFunc,
return-type-
default-no)
1561__parser__(internal,no-rpc,prefix=EnumFunc,return-type-default-no)
1624__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc,
return-type-
default-no)
1629__parser__(doc-group=Enum,doc-index=_ignore_,class=MqMsgque,no-rpc,prefix=EnumFunc,return-type-default-no)
1637__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc)
1673__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc,
return-type-
default-no)
1678__parser__(doc-group=Enum,doc-index=_ignore_,class=MqMsgque,no-rpc,prefix=EnumFunc,return-type-default-no)
1686__parser__(doc-group=Enum,doc-index=_ignore_,
class=MqMsgque,no-rpc,prefix=EnumFunc)
1782 #define MqConfigS_dispName_size 64
1812 #define MqConfigS_dispPrefix_size 64
1829 #define MqConfigS_dispPostfix_size 64
1863 #define MqConfigS_storageFile_size 256
1913#if META_HAVE_LIBCONFIG
1973 void * filterH_dummy;
2372#define MqInterfaceDoc(mkrt,ctx,fCall,callback,fFree,fCopy)
2379__parser__(no-rpc,callback-name=ServerSetup,callback-null,flags=
public-internal)
2386 MqDataFreeF fFree
__parser__(callback-free,null-allowed),
2387 MqDataCopyF fCopy
__parser__(callback-copy,null-allowed)
2395__parser__(no-rpc,callback-name=ServerCleanup,callback-null,flags=
public-internal)
2411__parser__(no-rpc,callback-name=BgError,callback-null,flags=
public-internal)
2431__parser__(no-rpc,callback-name=Event,callback-null,flags=
public-internal)
2456#define MQ_IS_SERVER(ctx) (ctx->setup.isServer == true)
2457#define MQ_IS_SERVER_PARENT(ctx) (MQ_IS_SERVER(ctx) && MQ_IS_PARENT(ctx))
2458#define MQ_IS_CLIENT(ctx) (ctx->setup.isServer == false)
2459#define MQ_IS_CLIENT_PARENT(ctx) (MQ_IS_CLIENT(ctx) && MQ_IS_PARENT(ctx))
2460#define MQ_IS_CHILD(ctx) ((ctx)->config.parent != NULL)
2461#define MQ_IS_PARENT(ctx) ((ctx)->config.parent == NULL)
2462#define MQ_IS_SLAVE(ctx) ((ctx)->config.master != NULL)
2463#define MQ_IS_MASTER(ctx) ((ctx)->config.master == NULL)
2464#define MQ_IS_LOOPBACK(ctx) ((ctx)->config.io.com == MQ_IO_LOOP)
2466#define MQ_GET_PARENT(ctx) (MQ_IS_CHILD(ctx) ? ctx->link.ctxIdP : ctx)
2467#define MQ_GET_MASTER(ctx) (MQ_IS_SLAVE(ctx) ? ctx->config.master : ctx)
2469#define MQ_IS_ON_EXIT(ctx) (MQ_GET_PARENT(ctx)->bits.onExit == true)
2665typedef
int (*MqSysSelectF) (
int max,
void* read,
void* write,
void* except, struct timeval* timeout);
2727typedef enum
MkErrorE (*MqSysServerSpawnF) (
2732 struct
MkIdS * idPtrOut
2749typedef enum
MkErrorE (*MqSysServerThreadF) (
2774typedef enum
MkErrorE (*MqSysServerForkF) (
2864 #define MqErrorC_SIGNATURE (MkErrExtC_SIGNATURE ^ (1u<<3))
2865 #define MqErrorC_MASK (((1u<<29)-1)<<3)
2873 #define MqErrorC_X2err(x) (x)
2874 #define MqErrorC_X2errext(x) MkERREXT(x)
2875 #define MqErrorC_X2ext(x) MkEXT(x)
2876 #define MqErrorC_X2obj(x) MkOBJ(x)
2889 #define MqErrorC_T (&MQ_RT_REF._MqErrorC_T)
2891 #define MqErrorC_TT (MkTYP(MqErrorC_T))
2893 #define MqErrorST MqErrorC_T
2895 #define MqErrorSTT (MkTYP(MqErrorST))
2897 #define MqErrorC_type MQ_ERR
2899 #define MqErrorCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
2901 #define MqErrorCTT_X(instance) (MkOBJ_R(instance).type)
2903 #define MqErrorCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
2905 #define MqErrorC_NS MQ
2907 #define MqErrorCTT MqErrorCTT
2909 #define MqErrorCT ( (struct MkTypeDefS *) MqErrorCTT )
2917 #pragma GCC diagnostic push
2918 #pragma GCC diagnostic ignored "-Wattributes"
2936 #pragma GCC diagnostic pop
2937 #define MqErrorC_Check(mng) MqErrCheck(mng)
2947 META_ATTRIBUTE_SANITIZE
2955 META_ATTRIBUTE_SANITIZE
2962 #define MqErrRaise(_err) if (!_MkCheckX(MqErrorC,_err)) { \
2963 MkErrorSetC_1E("'MqErrorC' hdl is NULL"); \
2968 #define MqERR_R(x) (*(x)).super.err
2970 #define MqERR(x) (&MqERR_R(x))
2982#define MqERROR_R(r) ((*r).error_mq)
2983#define MqERROR_RT MqERROR_R(&MQ_RT_REF)
2984#define MqERROR_O(o) MqERROR_R(MqRT_O(o))
2985#define MqERROR_X(x) MqERROR_R(MqRT_X(x))
2986#define MqERROR_XN(x) MqERROR_R(MqRT_XN(x))
2987#define MqERROR MqERROR_R(&MqRuntimeRLS)
3068#define MqFactoryPanic(fct) if (fct == NULL) MkPanicC(MK_ERROR_PANIC, __func__, -1, "MqFactoryS exception");
3078typedef enum MkErrorE (
MK_DECL
3083 enum MqFactoryE create,
3089#define MQ_CALLBACK_FACTORY_CTOR_ARGS \
3091 MQ_CTX const tmpl, \
3092 enum MqFactoryE create, \
3093 struct MqFactoryS * const fct, \
3096#define MQ_CALLBACK_FACTORY_CTOR_CALL MQ_RT_CALL tmpl, create, fct, contextP
3116 bool doFactoryCleanup,
3121#define MQ_CALLBACK_FACTORY_DTOR_ARGS \
3124 bool doFactoryCleanup, \
3161#define MqDbgFct_2(f,c) \
3162 mk_dbg_color_ln(c,"MqDbgFct[%-16s]: fct<P=%p:T=%p:R=%p>, MqFactoryC_TT<%p>", \
3163 MK_TRIM_LEFT(16,f->originalIdent), f, MkTYP_X(f), MkRT_X(f), MqFactoryC_TT)
3164#define MqDbgFct(f) MqDbgFct_2(f,MK_COLOR_YELLOW)
3180 #define MqFactoryS_originalIdent_size 63
3198 #define MqFactoryC_SIGNATURE (MkObjectC_SIGNATURE ^ (12u<<10))
3199 #define MqFactoryC_MASK (((1u<<22)-1)<<10)
3207 #define MqFactoryC_X2fct(x) (x)
3208 #define MqFactoryC_X2obj(x) MkOBJ(x)
3221 #define MqFactoryC_T (&MQ_RT_REF._MqFactoryC_T)
3223 #define MqFactoryC_TT (MkTYP(MqFactoryC_T))
3225 #define MqFactoryST MqFactoryC_T
3227 #define MqFactorySTT (MkTYP(MqFactoryST))
3229 #define MqFactoryC_type MQ_FCT
3231 #define MqFactoryCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
3233 #define MqFactoryCTT_X(instance) (MkOBJ_R(instance).type)
3235 #define MqFactoryCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
3237 #define MqFactoryC_NS MQ
3239 #define MqFactoryCTT MqFactoryCTT
3241 #define MqFactoryCT ( (struct MkTypeDefS *) MqFactoryCTT )
3249 #pragma GCC diagnostic push
3250 #pragma GCC diagnostic ignored "-Wattributes"
3268 #pragma GCC diagnostic pop
3269 #define MqFactoryC_Check(mng) MqFctCheck(mng)
3279 META_ATTRIBUTE_SANITIZE
3287 META_ATTRIBUTE_SANITIZE
3294 #define MqFctRaise(_fct) if (!_MkCheckX(MqFactoryC,_fct)) { \
3295 MkErrorSetC_1E("'MqFactoryC' hdl is NULL"); \
3300 #define MqFCT_R(x) (*(x)).super.fct
3302 #define MqFCT(x) (&MqFCT_R(x))
3321__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MqFactoryC);
3373#define MqFactoryHandleResolve_e(netHdl) ({ \
3374 MK_HDL tmpHdl=netHdl; \
3379 tmp=MqFactoryHandleResolve(tmpHdl); \
3381 MkErrorSetC_1_NULL("ERROR: 'MqFactoryC' handle is 'NULL'"); \
3396 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MqFactoryC,null-
return-allow)
3569__parser__(constructor,lng-constr,no-rpc,overload-c-no)
3574 MqFactoryCTorF const createCallF
__parser__(internal,default=FactoryObjCreate),
3576 MqFactoryDataFreeF const createDataFreeF
__parser__(internal,default=FactoryFree),
3577 MqFactoryDataCopyF const createDataCopyF
__parser__(internal,default=FactoryDup2),
3579 MqFactoryDTorF const deleteCallF
__parser__(internal,default=FactoryObjDelete),
3581 MqFactoryDataFreeF const deleteDataFreeF
__parser__(internal,default=NULL),
3582 MqFactoryDataCopyF const deleteDataCopyF
__parser__(internal,default=NULL),
3587#define MqFactoryAdd_1(fct) MqFactoryAdd(MK_ERROR_PANIC,fct,NULL, NULL, NULL, NULL, NULL, NULL, NULL, #fct)
3588#define MqFactoryAdd_2(fct,ident) MqFactoryAdd(MK_ERROR_PANIC,fct,NULL, NULL, NULL, NULL, NULL, NULL, NULL, ident)
3589#define MqFactoryAdd_3(ctor,dtor,ident) MqFactoryAdd(MK_ERROR_PANIC,ctor,NULL, NULL, NULL, dtor, NULL, NULL, NULL, ident)
3607 MkSelfCreateF const fctCreate,
3608 MkSelfDeleteF const fctDelete,
3609 MkConstructorF const constructor,
3610 MkSelfDeleteF const selfDelete
3746#define MqFactoryLog_2M(fct,m) MqFactoryLog(fct,MkObj(m),0,__func__,0)
3897 #define MqTypeCtxC_SIGNATURE (MkTypeC_SIGNATURE ^ (2u<<6))
3898 #define MqTypeCtxC_MASK (((1u<<26)-1)<<6)
3906 #define MqTypeCtxC_X2ctxtyp(x) (x)
3907 #define MqTypeCtxC_X2typ(x) MkTYP(x)
3908 #define MqTypeCtxC_X2obj(x) MkOBJ(x)
3921 #define MqTypeCtxSTT (&MQ_RT_REF._MqTypeCtxC_TT)
3923 #define MqTypeCtxC_TT (&MQ_RT_REF._MqTypeCtxC_TT)
3925 #define MqTypeCtxC_type MQ_CTXTYP
3927 #define MqTypeCtxCT_X(instance) ( (struct MkTypeS *) (MkOBJ_R(instance).type) )
3929 #define MqTypeCtxCTT_X(instance) (MkOBJ_R(instance).type)
3931 #define MqTypeCtxCT_TT(typ) ( (struct MkTypeS *) (typ) )
3933 #define MqTypeCtxC_NS MQ
3935 #define MqTypeCtxCTT MqTypeCtxCTT
3937 #define MqTypeCtxCT ( (struct MkTypeS *) MqTypeCtxCTT )
3945 #pragma GCC diagnostic push
3946 #pragma GCC diagnostic ignored "-Wattributes"
3964 #pragma GCC diagnostic pop
3965 #define MqTypeCtxC_Check(mng) MqCtxTypCheck(mng)
3978 if (!MkObjCheck(mng))
return NULL;
4006#define MqTypeCtxLog_1(typ) MqTypeCtxLog_RT(MK_RT_CALL typ,NULL,0,__func__,0)
4102#if defined(MQ_C_BUILD_DLL)
4104 #define META_SECTION_DEFINE
4105 #include "MqContextS_mq.h"
4106 #undef META_SECTION_DEFINE
4144 #define MqContextC_SIGNATURE (MkObjectC_SIGNATURE ^ (13u<<10))
4145 #define MqContextC_MASK (((1u<<22)-1)<<10)
4153 #define MqContextC_X2ctx(x) (x)
4154 #define MqContextC_X2obj(x) MkOBJ(x)
4167 #define MqContextC_T (&MQ_RT_REF._MqContextC_T)
4169 #define MqContextC_TT (MkTYP(MqContextC_T))
4171 #define MqContextST MqContextC_T
4173 #define MqContextSTT (MkTYP(MqContextST))
4175 #define MqContextC_type MQ_CTX
4177 #define MqContextCT_X(instance) ( (struct MqTypeCtxS *) (MkOBJ_R(instance).type) )
4179 #define MqContextCTT_X(instance) (MkOBJ_R(instance).type)
4181 #define MqContextCT_TT(typ) ( (struct MqTypeCtxS *) (typ) )
4183 #define MqContextC_NS MQ
4185 #define MqContextCTT MqContextCTT
4187 #define MqContextCT ( (struct MqTypeCtxS *) MqContextCTT )
4195 #pragma GCC diagnostic push
4196 #pragma GCC diagnostic ignored "-Wattributes"
4214 #pragma GCC diagnostic pop
4215 #define MqContextC_Check(mng) MqCtxCheck(mng)
4225 META_ATTRIBUTE_SANITIZE
4233 META_ATTRIBUTE_SANITIZE
4240 #define MqCtxRaise(_ctx) if (!_MkCheckX(MqContextC,_ctx)) { \
4241 MkErrorSetC_1E("'MqContextC' hdl is NULL"); \
4246 #define MqCTX_R(x) (*(x)).super.ctx
4248 #define MqCTX(x) (&MqCTX_R(x))
4267__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MqContextC);
4319#define MqContextHandleResolve_e(netHdl) ({ \
4320 MK_HDL tmpHdl=netHdl; \
4325 tmp=MqContextHandleResolve(tmpHdl); \
4327 MkErrorSetC_1_NULL("ERROR: 'MqContextC' handle is 'NULL'"); \
4342 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MqContextC,null-
return-allow)
4740MQ_EXTERN bool MK_DECL MqContextCheckLock (
4819#define MqEnvLog_0() MqEnvLog(&(META_CONTEXT_S)->link.protect,META_CONTEXT_S,NULL,0,__func__,0,"ENV")
4820#define MqEnvLog_1(env) MqEnvLog(env,NULL,NULL,0,__func__,0,"ENV")
4821#define MqEnvLog_2(env,fmt) MqEnvLog(env,fmt,NULL,0,__func__,0,"ENV")
4822#define MqEnvLog_3(env,fmt,lbl) MqEnvLog(env,fmt,lbl,0,__func__,0,"ENV")
5103#define MqStorageLog_1(ctx) MqStorageLog(ctx,__func__)
5681#define MQ_ROUTE_CTX_MAX 50
5907__parser__(type=ME_PSN_MQ_TOKEN:"token identifer")
5911#define MQ_TOK_SIZE (8+1)
6029 MkMarkF fMark
__parser__(internal,default=NULL)
6261 MK_I8 * const val_out
6391__parser__(template-required,no-rpc,keep,no-static)
6406__parser__(template-required,no-rpc,keep,no-static)
6858__parser__(internal,doc-no,doc-group=Atom,doc-index=SendApi)
8092#define MQ_SEND_TRANSACTION_TOKEN_SIZE 10
8093#define MQ_SEND_TOKEN_SIGNATURE_SIZE 50
8413 return MkSysStringGetNoNULL((ctx)->config.dispName);
8426 return MkSysStringGetNoNULL((ctx)->config.dispPrefix);
8439 return MkSysStringGetNoNULL((ctx)->config.dispPostfix);
8452 return MkSysStringGetNoNULL((ctx)->config.storageFile);
8464 return (ctx)->config.io.buffersize;
8476 return (ctx)->config.io.pkgsize;
8488 return (ctx)->config.io.timeout;
8651#if defined(MQ_C_BUILD_DLL)
8653 #define META_SECTION_DEFINE
8654 #include "MqDumpS_mq.h"
8655 #undef META_SECTION_DEFINE
8687 #define MqDumpC_SIGNATURE (MkObjectC_SIGNATURE ^ (14u<<10))
8688 #define MqDumpC_MASK (((1u<<22)-1)<<10)
8696 #define MqDumpC_X2dmp(x) (x)
8697 #define MqDumpC_X2obj(x) MkOBJ(x)
8710 #define MqDumpC_T (&MQ_RT_REF._MqDumpC_T)
8712 #define MqDumpC_TT (MkTYP(MqDumpC_T))
8714 #define MqDumpST MqDumpC_T
8716 #define MqDumpSTT (MkTYP(MqDumpST))
8718 #define MqDumpC_type MQ_DMP
8720 #define MqDumpCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
8722 #define MqDumpCTT_X(instance) (MkOBJ_R(instance).type)
8724 #define MqDumpCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
8726 #define MqDumpC_NS MQ
8728 #define MqDumpCTT MqDumpCTT
8730 #define MqDumpCT ( (struct MkTypeDefS *) MqDumpCTT )
8738 #pragma GCC diagnostic push
8739 #pragma GCC diagnostic ignored "-Wattributes"
8757 #pragma GCC diagnostic pop
8758 #define MqDumpC_Check(mng) MqDmpCheck(mng)
8768 META_ATTRIBUTE_SANITIZE
8776 META_ATTRIBUTE_SANITIZE
8783 #define MqDmpRaise(_dmp) if (!_MkCheckX(MqDumpC,_dmp)) { \
8784 MkErrorSetC_1E("'MqDumpC' hdl is NULL"); \
8789 #define MqDMP_R(x) (*(x)).super.dmp
8791 #define MqDMP(x) (&MqDMP_R(x))
8810__parser__push__(doc-group=_ignore_,doc-index=Class,doc-name=Export,
class=MqDumpC);
8862#define MqDumpHandleResolve_e(netHdl) ({ \
8863 MK_HDL tmpHdl=netHdl; \
8868 tmp=MqDumpHandleResolve(tmpHdl); \
8870 MkErrorSetC_1_NULL("ERROR: 'MqDumpC' handle is 'NULL'"); \
8885 __parser__(flags=
new,doc-group=_ignore_,doc-index=Class,doc-name=Misc,
class=MqDumpC,null-
return-allow)
8916#define MqDumpLog_1XS(dump) MqDumpLog(dump,0,__func__,0,MkOBJ(META_CONTEXT_S))
8961 MQ_DMP * const dumpP_inout
8986 MQ_DMP * const dumpP_inout
9167#define MqDbgRt() mk_dbg_color_ln(MK_COLOR_PURPLE,"mkrt<%p>, MkRT<%p>, mqrt<%p>, MqRT<%p>", mkrt, MkRT, mqrt, MqRT)
9172#pragma GCC diagnostic push
9173#pragma GCC diagnostic ignored "-Wlto-type-mismatch"
9175#if defined(MQ_C_BUILD_DLL)
9177 #define META_SECTION_DEFINE
9178 #include "MqRuntimeS_mq.h"
9179 #undef META_SECTION_DEFINE
9233#pragma GCC diagnostic pop
9246 #define MqRuntimeC_SIGNATURE (MkRtExtC_SIGNATURE ^ (1u<<3))
9247 #define MqRuntimeC_MASK (((1u<<29)-1)<<3)
9255 #define MqRuntimeC_X2rt(x) (x)
9256 #define MqRuntimeC_X2rtext(x) MkRTEXT(x)
9257 #define MqRuntimeC_X2ext(x) MkEXT(x)
9258 #define MqRuntimeC_X2obj(x) MkOBJ(x)
9271 #define MqRuntimeC_T (&MQ_RT_REF._MqRuntimeC_T)
9273 #define MqRuntimeC_TT (MkTYP(MqRuntimeC_T))
9275 #define MqRuntimeST MqRuntimeC_T
9277 #define MqRuntimeSTT (MkTYP(MqRuntimeST))
9279 #define MqRuntimeC_type MQ_RT
9281 #define MqRuntimeCT_X(instance) ( (struct MkTypeDefS *) (MkOBJ_R(instance).type) )
9283 #define MqRuntimeCTT_X(instance) (MkOBJ_R(instance).type)
9285 #define MqRuntimeCT_TT(typ) ( (struct MkTypeDefS *) (typ) )
9287 #define MqRuntimeC_NS MQ
9289 #define MqRuntimeCTT MqRuntimeCTT
9291 #define MqRuntimeCT ( (struct MkTypeDefS *) MqRuntimeCTT )
9299 #pragma GCC diagnostic push
9300 #pragma GCC diagnostic ignored "-Wattributes"
9318 #pragma GCC diagnostic pop
9319 #define MqRuntimeC_Check(mng) MqRtCheck(mng)
9329 META_ATTRIBUTE_SANITIZE
9337 META_ATTRIBUTE_SANITIZE
9344 #define MqRtRaise(_rt) if (!_MkCheckX(MqRuntimeC,_rt)) { \
9345 MkErrorSetC_1E("'MqRuntimeC' hdl is NULL"); \
9360#define MqRT &MqRuntimeRLS
9362 #define MqRT_O(o) MqRuntimeGet( MK_RT_CALL_ONLY )
9363 #define MqRT_X(x) MqRuntimeGet( MK_RT_CALL_ONLY )
9364 #define MqRT_ON(o) MqRuntimeGet( MK_RT_CALL_ONLY )
9365 #define MqRT_XN(x) MqRuntimeGet( MK_RT_CALL_ONLY )
9367 #define MqRT_O(o) ((o) && (*o).objRtExt ? (MQ_RT)(*o).objRtExt : MqRuntimeGet( MK_RT_CALL_ONLY ))
9368 #define MqRT_X(x) ((x) && MkOBJ_R(x).objRtExt ? (MQ_RT)MkOBJ_R(x).objRtExt : MqRuntimeGet( MK_RT_CALL_ONLY ))
9369 #define MqRT_ON(o) ( (*o).objRtExt ? (MQ_RT)(*o).objRtExt : MqRuntimeGet( MK_RT_CALL_ONLY ))
9370 #define MqRT_XN(x) ( MkOBJ_R(x).objRtExt ? (MQ_RT)MkOBJ_R(x).objRtExt : MqRuntimeGet( MK_RT_CALL_ONLY ))
9374 #define MqRtSetup_O(o) MK_RT_UNUSED MQ_RT const mqrt = MqRT_O(o)
9375 #define MqRtSetup_ON(o) MK_RT_UNUSED MQ_RT const mqrt = MqRT_ON(o)
9376 #define MqRtSetup_X(x) MK_RT_UNUSED MQ_RT const mqrt = MqRT_X(x)
9377 #define MqRtSetup_XN(x) MK_RT_UNUSED MQ_RT const mqrt = MqRT_XN(x)
9378 #define MqRtSetup_RT(r) MK_RT_UNUSED MQ_RT const mqrt = r
9379 #define MqRtSetup_NULL MK_RT_UNUSED MQ_RT const mqrt = MqRuntimeGet( MK_RT_CALL_ONLY )
9381 #define MqRtSetup_O_RT(o) MkRtSetup_O_RT(o) ; MqRtSetup_O(o)
9382 #define MqRtSetup_ON_RT(o) MkRtSetup_ON_RT(o) ; MqRtSetup_ON(o)
9383 #define MqRtSetup_X_RT(x) MkRtSetup_X_RT(x) ; MqRtSetup_X(x)
9384 #define MqRtSetup_XN_RT(x) MkRtSetup_XN_RT(x) ; MqRtSetup_XN(x)
9385 #define MqRtSetup_NULL_RT MkRtSetup_NULL_RT ; MqRtSetup_NULL
9388 #undef AllRtSetup_ON
9390 #undef AllRtSetup_XN
9391 #undef AllRtSetup_NULL
9393 #define AllRtSetup_O(o) MkRtSetup_O(o) ; MqRtSetup_O(o)
9394 #define AllRtSetup_ON(o) MkRtSetup_ON(o) ; MqRtSetup_ON(o)
9395 #define AllRtSetup_X(x) MkRtSetup_X(x) ; MqRtSetup_X(x)
9396 #define AllRtSetup_XN(x) MkRtSetup_XN(x) ; MqRtSetup_XN(x)
9397 #define AllRtSetup_NULL MkRtSetup_NULL ; MqRtSetup_NULL
9399 #define MqRtSetup_O(o)
9400 #define MqRtSetup_ON(o)
9401 #define MqRtSetup_X(x)
9402 #define MqRtSetup_XN(x)
9403 #define MqRtSetup_RT(r)
9404 #define MqRtSetup_NULL
9406 #define MqRtSetup_O_RT(o)
9407 #define MqRtSetup_ON_RT(o)
9408 #define MqRtSetup_X_RT(x)
9409 #define MqRtSetup_XN_RT(x)
9410 #define MqRtSetup_NULL_RT
9467#define MqRuntimeLog_2M(mqrt,m) MqRuntimeLog_2(mqrt,MkObj(m))
9565__parser__(hide,
template-required,
class=MqMsgque)
9771__parser__push__(doc-name=Introspection,doc-index=Class,class=MqContextC,no-rpc,null-return-allow,flags=new);
9806__parser__push__(doc-name=Introspection,doc-index=Class,
class=MqDumpC,no-rpc,null-
return-allow,flags=
new);
9841__parser__push__(doc-name=Introspection,doc-index=Class,
class=MqFactoryC,no-rpc,null-
return-allow,flags=
new);
#define MqFactoryS_originalIdent_size
#define MqLinkS_targetIdent_size
MqClassIdentGet of the link target, only valid on parent-context
#define MqConfigS_dispPostfix_size
#define MqConfigS_storageFile_size
storage file used as default if a database is requested
#define MqConfigS_dispName_size
#define MqConfigS_dispPrefix_size
MK_ERR MkErrorFORMAT(MK_OBJN fmtobj)
void Log(MK_DBG debug=0, MK_STRN callfunc=__builtin_FUNCTION(), MK_I32 lvl=0) const
#define __parser__global__(...)
#define __parser__push__(...)
void(* MkMarkF)(MK_RT mkrt, MK_PTR data)
#define __MkCheckX(cls, x)
#define MkSanitizeCheck(_root, _m)
#define MkSanitizeCheckO(_root, _o)
#define MkObjectHandleResolve(...)
#define MkObjectHandleGet(...)
#define MkObjectToString(...)
#define MK_ATTR_RT_INSTANCE
#define MK_RT_ATTR_FORMAT_2
#define MK_PARSER_RT_ONLY
#define MK_ATTR_RT_STATIC
#define MK_INSTANCE_HDL(x)
MK_STRN MqClassIdentGet(MQ_CTXN const ctx)
get the application-identification …
enum MkErrorE MqClassIdentSet_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN ident)
link the MqContextC to a new MqFactoryC identified by ident
MQ_FCT const MqClassFactoryGet(MQ_CTXN const ctx)
get the MqFactoryC used by the MqContextC
enum MkErrorE MqClassFactorySet_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_FCT const item)
link the MqContextC to a new MqFactoryC
MK_STRN MqClassOriginalIdentGet(MQ_CTXN const ctx)
get the libmqmsgque::MqFactoryS::originalIdent from the MqContextC
static MQ_CTX MqContextGetNull(void)
Null-Slot - return a MqContextC typed NULL instance …
static MQ_CTX MqContextNext(MQ_CTX const ctx)
get next instance from linked-list of MqContextS type
static MQ_CTX MqContextPrev(MQ_CTX const ctx)
get previous instance from linked-list of MqContextS type
static MK_HDL MqContextHandleGet_RT(MK_RT mkrt, MQ_CTX const ctx)
Handle-Get-Slot - returns a export-hdl to the MqContextC useable for external storage
static MQ_CTX MqCtx(MK_MNG mng)
cast a unknown-object into an MqContextS pointer or NULL if not possible
static bool MqCtxCheckO(MK_OBJN obj)
check MqContextS -> libmkkernel::MkObjectS::signature …
static bool MqCtxCheck(MK_MNGN mng)
check MqContextS -> libmkkernel::MkObjectS::signature …
#define MqContextC_X2obj(x)
#define MqContextC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
void(* MqDataCopyF)(MQ_SERVICE_COPY_ARGS)
prototype for a copy additional token data function …
enum MkErrorE(* MqTokenF)(MQ_SERVICE_CALL_ARGS)
prototype for an object method function …
#define MQ_SERVICE_FREE_ARGS
the libmqmsgque::MqDataFreeF arguments with default names
void(* MqDataFreeF)(MQ_SERVICE_FREE_ARGS)
prototype for a free additional token data function …
#define MQ_SERVICE_CALL_ARGS
the libmqmsgque::MqTokenF arguments with default names
#define MQ_SERVICE_COPY_ARGS
the libmqmsgque::MqDataFreeF arguments with default names
static bool MqConfigGetIsString(MQ_CTX const ctx)
does the context object is using the string-mode ?
static bool MqConfigGetIsParent(MQ_CTX const ctx)
does the context object is a parent ? An objext is a parent id the libmqmsgque::MqConfigS::parent att...
static bool MqConfigGetIsServer(MQ_CTX const ctx)
does the context object is a server ?
static MK_STRN MqConfigGetPostfix(MQ_CTXN const ctx)
get the libmqmsgque::MqConfigS::dispPostfix
static MK_STRN MqConfigGetStorage(MQ_CTXN const ctx)
get the storage of the context object
static MK_TIME_T MqConfigGetTimeout(MQ_CTXN const ctx)
get the timeout value of the context object
static MQ_SOCK_HDL MqConfigGetIoPipe(MQ_CTX const ctx)
return the libmqmsgque::MqIoPipeConfigS
enum MkErrorE MqConfigGetIoTcp(MQ_CTX const ctx, MK_STRN *host_out, MK_STRN *port_out, MK_STRN *myhost_out, MK_STRN *myport_out)
get the configuration-data of the tcp-client-server-link …
static enum MqStartE MqConfigGetStartAs(MQ_CTX const ctx)
return the libmqmsgque::MqConfigS::startAs value
static MK_STRN MqConfigGetName(MQ_CTXN const ctx)
get the name of the context object
static enum MqIdentE MqConfigGetIdentFrom(MQ_CTX const ctx)
get the libmqmsgque::MqConfigS::identFrom
static MK_STRN MqConfigGetIoUds(MQ_CTXN const ctx)
return the libmqmsgque::MqIoUdsConfigS
static MK_I32 MqConfigGetPkgsize(MQ_CTXN const ctx)
get the maximun size of a BDY package
static MK_I32 MqConfigGetBuffersize(MQ_CTXN const ctx)
get the minimum of the read/send buffersize of the socket
#define MQ_GET_PARENT(ctx)
#define MQ_IS_PARENT(ctx)
static enum MqStatusIsEF MqConfigGetStatusIs(MQ_CTX const ctx)
return the libmqmsgque::MqContextS::statusIs value
enum MkErrorE MqConfigGetIoTcpL_RT(MK_RT mkrt, MQ_CTX const ctx, MK_BFL *vals_out)
get the configuration-data of the tcp-client-server-link as MkBufferListC …
#define MQ_IS_SERVER(ctx)
extract boolean information from context
#define MQ_IS_MASTER(ctx)
static MK_STRN MqConfigGetPrefix(MQ_CTXN const ctx)
get the libmqmsgque::MqConfigS::dispPrefix
void MqConfigSetServerCleanup_RT(MK_RT mkrt, MQ_CTX const ctx, MqTokenF fCall, MK_CBP callback, MqDataFreeF fFree, MqDataCopyF fCopy)
set the libmqmsgque::MqSetupS::ServerCleanup
void MqConfigSetEvent_RT(MK_RT mkrt, MQ_CTX const ctx, MqTokenF fCall, MK_CBP callback, MqDataFreeF fFree, MqDataCopyF fCopy)
set the libmqmsgque::MqSetupS::Event
void MqConfigSetBgError_RT(MK_RT mkrt, MQ_CTX const ctx, MqTokenF fCall, MK_CBP callback, MqDataFreeF fFree, MqDataCopyF fCopy)
set the libmqmsgque::MqSetupS::BgError
void MqConfigSetServerSetup_RT(MK_RT mkrt, MQ_CTX const ctx, MqTokenF fCall, MK_CBP callback, MqDataFreeF fFree, MqDataCopyF fCopy)
set the libmqmsgque::MqSetupS::ServerSetup
void MqConfigReset_RT(MK_RT mkrt, MQ_CTX const ctx)
clean the libmqmsgque::MqContextS::config data
void MqConfigSetAllTimeout(MQ_CTX const ctx, MK_TIME_T data)
set the libmqmsgque::MqIoConfigS::timeout value
void MqConfigSetIsServer(MQ_CTX const ctx, bool data)
set the libmqmsgque::MqSetupS::isServer value
enum MkErrorE MqConfigSetStartAsString(MQ_CTX const ctx, MK_STRN data)
set the libmqmsgque::MqConfigS::startAs value using string default, thread, fork or spawn
bool MqConfigCheckStartAs(MQ_CTX const ctx, enum MqStartE data)
check if libmqmsgque::MqConfigS::startAs can be set to data
void MqConfigSetBuffersize(MQ_CTX const ctx, MK_I32 data)
set the libmqmsgque::MqIoConfigS::buffersize value
void MqConfigSetPrefixWithNoLock_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN data)
set the libmqmsgque::MqConfigS::dispPrefix with low-priority …
enum MkErrorE MqConfigSetIoTcp_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN host, MK_STRN port, MK_STRN myhost, MK_STRN myport)
configure a context to use a tcp-client-server-link …
void MqConfigSetIgnoreExit(MQ_CTX const ctx, bool data)
set the libmqmsgque::MqSetupS::ignoreExit value
#define MqConfigSetIoTcp(...)
void MqConfigSetIsString(MQ_CTX const ctx, bool data)
set the libmqmsgque::MqConfigS::native value 'S'string or 'L'owEndian or 'B'igEndian
void MqConfigSetStorage_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN data)
set the Storage value and cleanup old value
void MqConfigSetTimeout(MQ_CTX const ctx, MK_TIME_T data)
set the libmqmsgque::MqIoConfigS::timeout value
void MqConfigSetPostfix_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN data)
set the client-part (2) of the application-identifer libmqmsgque::MqConfigS::dispName …
enum MkErrorE MqConfigSetIoTcpL_RT(MK_RT mkrt, MQ_CTX const ctx, MK_BFL const vals)
configure a context to use a tcp-client-server-link …
void MqConfigSetIdentFrom(MQ_CTX const ctx, enum MqIdentE data)
set the libmqmsgque::MqConfigS::identFrom value
enum MkErrorE MqConfigSetIoUds_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN file)
configure a context to use a uds-client-server-link …
void MqConfigSetPrefix_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN data)
set the server-part (1) of the application-identifer libmqmsgque::MqConfigS::dispName …
enum MkErrorE MqConfigSetAllDebug_RT(MK_RT mkrt, MQ_CTX const ctx, MK_I32 const data)
set the MkRuntimeS::debug value
enum MkErrorE MqConfigSetIoPipe_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_SOCK_HDL fh)
set the pipe configuration data …
enum MkErrorE MqConfigSetDaemon_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN pidfile)
start the server-context as daemon …
enum MkErrorE MqConfigSetStartAs(MQ_CTX const ctx, enum MqStartE data)
set the libmqmsgque::MqConfigS::startAs value
void MqConfigSetPkgsize(MQ_CTX const ctx, MK_I32 data)
set the libmqmsgque::MqIoConfigS::pkgsize value
void MqConfigSetName_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN data)
set the libmqmsgque::MqConfigS::dispName value and cleanup old value
enum MkErrorE MqSendVL2_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN cstr, va_list var_list)
A version of MqSend with va_list support …
static MK_STRN MqLinkGetTargetIdent(MQ_CTX const ctx)
get the ident of the link-target …
static MK_NUM MqLinkGetCtxId(MQ_CTX const ctx)
get an identifier which is unique per parent-or-child-context …
static bool MqLinkIsParent(MQ_CTX const ctx)
is the context a parent-context? …
static MK_STRN MqLogServerOrClient(MQ_CTXN const ctx)
is ctx a SERVER or a CLIENT ? …
static MK_STRN MqLogParentOrChild(MQ_CTXN ctx)
is ctx a PARENT or a CHILD ? …
static MQ_CTXN MqGetRootN(MQ_CTXN ctx)
(const) get the Root (toplevel initial context)
static MQ_CTX MqGetRoot(MQ_CTX ctx)
get the Root (toplevel initial context)
int MqExit_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN const callfunc, MK_STRN const callfile, MK_I32 const callline)
delete the context and exit the current process or thread …
MQ_CTX_A MqRouteResolve_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN const ident, MK_NUM const retnum)
return a list of all context belonging to ident …
enum MkErrorE MqRouteCreate_RT(MK_RT mkrt, MQ_CTX ctx, MK_STRN route, MK_STRN service, bool overwrite)
create/delete a routing-link between context an a service using route
enum MkErrorE MqSendBUF_RT(MK_RT mkrt, MQ_CTX const ctx, MK_BUFN const val)
append a MkBufferC object to the send-data-package object …
enum MkErrorE MqSendBUS_FLAT_RT(MK_RT mkrt, MQ_CTX const ctx, MK_BUSN const val)
append a MkBufferStreamC object to the send-data-package object …
enum MkErrorE MqSendL_FLAT_RT(MK_RT mkrt, MQ_CTX const ctx, MK_BFLN const val)
append a MkBufferListC object as flat list of items to the send-data-package object …
enum MkErrorE MqSendV_RT(MK_RT mkrt, MQ_CTX const ctx, MK_FST const printfmt,...)
append a vararg string to the send-data-package object …
enum MkErrorE MqSendBIN_RT(MK_RT mkrt, MQ_CTX const ctx, MkBinaryR const val)
append a libmkkernel::MK_BIN object to the send-data-package. …
enum MkErrorE MqSendBFL_RT(MK_RT mkrt, MQ_CTX const ctx, MK_BFLN const val)
append a MkBufferListC object to the send-data-package object …
static bool MqServiceIsTransaction(MQ_CTX const ctx)
check if the ongoing-service-call belongs to a transaction …
MK_STRN MQ_TOK
MqContextC - a char[4+1] or hex[8+1] string used to unique identify a service …
MqTokenF MqServiceCallbackF
MqContextC - the callback-function is used as a service-handle or as a event-handle …
MQ_TOK MqServiceTokenGet(MQ_CTX const ctx)
in an ongoing-service-call get the current MqContextC_ServiceApi_Identifer …
bool MqServiceTokenCheck(MQ_CTX const ctx, MQ_TOK const token)
in an ongoing-service-call check if the current MqContextC_ServiceApi_Identifer is token …
bool MqServiceTokenExists(MQ_CTX const ctx, MQ_TOK const token)
check if the MqContextC_ServiceApi_Identifer token is defined as ctx service …
enum MkErrorE MqSlaveGetFilter_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_CTX *ctx_out)
get the filter-ctx or the master-ctx …
enum MkErrorE MqSlaveGetProxy_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_SLAVE_ID const id, MQ_CTX *ctx_out)
on slave return the master and on master return the slave identified by id.
static bool MqSlaveCheck(MQ_CTXN const ctx, MQ_SLAVE_ID const id)
check if slave-id is valid
enum MkErrorE MqSlaveCreate_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_SLAVE_ID const id, MQ_CTX const slave)
create a master/slave link between the master-parent-context and the slave-parent-context …
enum MkErrorE MqSlaveGet_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_SLAVE_ID const id, MQ_CTX *ctx_out)
get the slave-context from a master-context …
enum MkErrorE MqSlaveDelete_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_SLAVE_ID const id)
Delete a slave object from a master/slave link identified by id. …
static MQ_CTX MqSlaveGetMaster(MQ_CTX const ctx)
opposite function of MqSlaveGetFilter
static bool MqSlaveIs(MQ_CTXN const ctx)
is the context a slave-context ? …
enum MkErrorE MqStorageImport_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *transLIdP_inout)
import the storage-package into the read-data-package …
enum MkErrorE MqStorageClose_RT(MK_RT mkrt, MQ_CTX const ctx)
close the storage. …
enum MkErrorE MqStorageErrCnt_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR transLId, MK_I32 *cnt_out)
increment and return the database row-error-count for the row defined with transLId
enum MkErrorE MqStorageExport_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *ltid_out)
export the read-data-package into the STORAGE …
enum MkErrorE MqStorageOpen_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN const storageFile)
switch to a file-based-transaction-database …
bool(* MqWaitForPipeF)(MK_RT mkrt, MQ_CTX const ctx, const struct MkIdS *idP)
Wait for a pipe-server to finish …
void(* MqSetupF)(MQ_CTX const ctx)
used to setup (initialize) a new thread/fork/process created by ccmqmsgque using the SysServer?...
enum MkErrorE(* MqCreateF)(MK_RT mkrt, MQ_CTX const ctx, MK_BFL const args)
the prototype for the ContextCreate function …
int(* MqExitF)(MK_RT mkrt, int num)
prototype for exit a process or thread …
void(* MqDeleteF)(MQ_CTX const ctx)
the prototype for a ContextDelete function …
void(* MqHelpF)(MK_STRN basename)
application specific help function type …
void(* MqRefCountF)(MK_RT mkrt, MQ_CTX ctx, MK_PTR const env)
used in libmqmsgque::MqTypeCtxS::fIncrSelf and libmqmsgque::MqTypeCtxS::fDecrSelf to protect an "embe...
static MK_HDL MqDumpHandleGet_RT(MK_RT mkrt, MQ_DMP const dmp)
Handle-Get-Slot - returns a export-hdl to the MqDumpC useable for external storage
static MQ_DMP MqDumpPrev(MQ_DMP const dmp)
get previous instance from linked-list of MqDumpS type
static MQ_DMP MqDumpInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MqDumpS type …
static MQ_DMP MqDumpNext(MQ_DMP const dmp)
get next instance from linked-list of MqDumpS type
static MQ_DMP MqDumpGetNull(void)
Null-Slot - return a MqDumpC typed NULL instance …
static MQ_DMP MqDmp(MK_MNG mng)
cast a unknown-object into an MqDumpS pointer or NULL if not possible
#define MqDumpC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static bool MqDmpCheck(MK_MNGN mng)
check MqDumpS -> libmkkernel::MkObjectS::signature …
static bool MqDmpCheckO(MK_OBJN obj)
check MqDumpS -> libmkkernel::MkObjectS::signature …
static bool MqEnvCheckO(MK_OBJN obj)
check MqEnvS -> libmkkernel::MkObjectS::signature …
static bool MqEnvCheck(MK_MNGN mng)
check MqEnvS -> libmkkernel::MkObjectS::signature …
static bool MqErrCheckO(MK_OBJN obj)
check MqErrorS -> libmkkernel::MkObjectS::signature …
static bool MqErrCheck(MK_MNGN mng)
check MqErrorS -> libmkkernel::MkObjectS::signature …
void(* MqFactoryDataFreeF)(MK_RT mkrt, MK_PTR *dataP)
prototype for a free additional factory data function
enum MkErrorE(* MqFactoryCTorF)(MK_RT mkrt, MQ_RT mqrt, MQ_CTX const tmpl, enum MqFactoryE create, MQ_FCT const fct, MQ_CTX *ctx_out)
type of a MqFactoryC constructor
void(* MqFactoryDataCopyF)(MK_RT mkrt, MK_PTR *dataP)
prototype for a copy additional factory data function
void(* MqFactoryDTorF)(MK_RT mkrt, MQ_CTX ctx, bool doFactoryCleanup, MQ_FCT const fct)
type of a MqFactoryC destructor
static MQ_FCT MqFactoryPrev(MQ_FCT const fct)
get previous instance from linked-list of MqFactoryS type
static MQ_FCT MqFactoryGetNull(void)
Null-Slot - return a MqFactoryC typed NULL instance …
static MK_HDL MqFactoryHandleGet_RT(MK_RT mkrt, MQ_FCT const fct)
Handle-Get-Slot - returns a export-hdl to the MqFactoryC useable for external storage
static MQ_FCT MqFactoryNext(MQ_FCT const fct)
get next instance from linked-list of MqFactoryS type
static MQ_FCT MqFactoryInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MqFactoryS type …
static bool MqFctCheckO(MK_OBJN obj)
check MqFactoryS -> libmkkernel::MkObjectS::signature …
#define MqFactoryC_X2obj(x)
static bool MqFctCheck(MK_MNGN mng)
check MqFactoryS -> libmkkernel::MkObjectS::signature …
#define MqFactoryC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
static MQ_FCT MqFct(MK_MNG mng)
cast a unknown-object into an MqFactoryS pointer or NULL if not possible
MQ_FCT MqFactoryGetCalled_RT(MK_RT mkrt, MK_STRN const ident)
returns the MqFactoryC identified by ident …
#define MqFactoryGetCalled(...)
#define MQ_EXTERN
static library
MqIdentE
identify the application using prefix (default) or factory …
MqWaitOnEventE
wait for an event? …
MqFactoryE
the factory is called to create an object for ...
MqStatusIsEF
Information about how the context was created.
MqSlaveE
predefined slave-id for well known slaves …
MqIoComE
what kind of socket interface to use? …
MqHandShakeE
the hand-shake of a service-call …
MqTransTypeE
the type of the transaction …
MqStartE
User preferences on HOWTO start a new entity.
@ MQ_IDENT_FACTORY
value from libmqmsgque::MqFactoryS::originalIdent
@ MQ_IDENT_PREFIX
value from libmqmsgque::MqConfigS::dispPrefix
@ MQ_WAIT_NO
Check for one event but do not wait …
@ MQ_WAIT_FOREVER
Wait maximum timeout seconds for an event or raise an timeout-error …
@ MQ_WAIT_ONCE
Wait maximum timeout seconds for one new event, doesn't matter which context the event belongs to or ...
@ MQ_WAIT_OWN
Wait maximum timeout seconds for one new event that belongs to the current context or raise an timeou...
@ MQ_FACTORY_NEW_INIT
initial object, nothing else is known
@ MQ_FACTORY_NEW_CHILD
create object as a child of an other object
@ MQ_FACTORY_NEW_FILTER
create object as a filter
@ MQ_FACTORY_NEW_SLAVE
create object as a slave of an other object
@ MQ_FACTORY_NEW_FORK
create object as a fork process
@ MQ_FACTORY_NEW_THREAD
create object as a thread
@ MQ_STATUS_IS_DUP
context is created as a duplicate of an other context
@ MQ_STATUS_IS_THREAD
context is created as a thread
@ MQ_STATUS_IS_FORK
context is created as a fork
@ MQ_STATUS_IS_INITIAL
context is the first context
@ MQ_STATUS_IS_SPAWN
context is created as a spawn
@ MQ_SLAVE_FILTER
internal: the filter-slave-id, (on a master get the filter-slave)
@ MQ_SLAVE_USER
internal: start of user-defined-slave-id
@ MQ_SLAVE_LOOPBACK
internal: the loopback-slave-id, (call my own services)
@ MQ_SLAVE_MASTER
internal: the master-slave-id, (on a slave get the master)
@ MQ_SLAVE_MAX
internal: the maximum slave-id …
@ MQ_SLAVE_OTHER
internal: on the master-ctx get the slave-ctx and on the slave-ctx get the master-ctx
@ MQ_IO_LOOP
using pipe socket as stdin and stdout
@ MQ_IO_INIT
using stdin and stdout
@ MQ_IO_PIPE
using a pipe socket (most internal usage)
@ MQ_IO_UDS
using a uds socket
@ MQ_IO_TCP
using a tcp socket
@ MQ_HANDSHAKE_START
direction: client -> server
@ MQ_HANDSHAKE_ERROR
direction: server -> client
@ MQ_HANDSHAKE_OK
direction: server -> client
@ MQ_TRANS_TYPE_TRANS
'T' = MqSendEND_AND_TRANSACTION
@ MQ_TRANS_TYPE_NO
'N' = MqSendEND
@ MQ_TRANS_TYPE_SUB
'S' = MqSendEND_AND_SUB
@ MQ_TRANS_TYPE_WAIT
'W' = MqSendEND_AND_WAIT
@ MQ_TRANS_TYPE_CB
'C' = MqSendEND_AND_CALLBACK
@ MQ_START_SPAWN
create entity as spawn process
@ MQ_START_THREAD
create entity as thread
@ MQ_START_FORK
create entity as fork
@ MQ_START_DEFAULT
use application-context default entity creation
int(* MqSysSelectF)(int max, void *read, void *write, void *except, struct timeval *timeout)
select syscall …
enum MkErrorE(* MqSysServerForkF)(MK_RT mkrt, MQ_RT mqrt, MQ_CTX const ctx, MQ_FCT factory, MK_BFL *argsP, MK_STRN name, MQ_SOCK_HDL socket, struct MkIdS *idPtrOut)
fork server create syscall with ccmqmsgque error plugin
struct MqLalS MqLal
Language Abstraction Layer in duty.
enum MkErrorE(* MqSysServerThreadF)(MK_RT mkrt, MQ_CTX const ctx, struct MqSysServerThreadMainS *const argP, MK_STRN name, int state, struct MkIdS *idPtrOut)
thread server create syscall with ccmqmsgque error plugin
enum MkErrorE(* MqSysServerSpawnF)(MK_RT mkrt, MQ_RT mqrt, MQ_CTX const ctx, char *const *argv, MK_STRN name, struct MkIdS *idPtrOut)
spawn server create syscall with ccmqmsgque error plugin
int MQ_ROU
32bit routing token because PHP-32 does NOT support long long
MK_NUM MQ_SLAVE_ID
a slave identiver
int MQ_LTR
32bit longterm transaction token because PHP-32 does NOT support long long
struct config_setting_t config_setting_t
libconfig struct
int MQ_HDL
handle data-type
struct config_t config_t
libconfig struct
static bool MqRtCheckO(MK_OBJN obj)
check MqRuntimeS -> libmkkernel::MkObjectS::signature …
static bool MqRtCheck(MK_MNGN mng)
check MqRuntimeS -> libmkkernel::MkObjectS::signature …
static bool MqCtxTypCheckO(MK_OBJN obj)
check MqTypeCtxS -> libmkkernel::MkObjectS::signature …
static bool MqCtxTypCheck(MK_MNGN mng)
check MqTypeCtxS -> libmkkernel::MkObjectS::signature …
MQ_RT MqRuntimeSetup(MK_RT const mkrt, MQ_RT const mqrt)
initialize MqRuntimeRLS
__thread struct MqRuntimeS MqRuntimeRLS
RLS.
size_t MqRuntimeId
identify the custom runtime
array of MqContextC instances
used for callback function pointer management
MqTokenF fCall
callback method
MqDataCopyF fCopy
copy additional data pointer, used in a MqSetupDup
MkMarkF fMark
garbage-collector marker for data
MK_PTR data
additional data for the callback function
MqDataFreeF fFree
free additional data pointer
end-user configuration data, also available as command-line options
config_t * cfg
add libconfig configuration file …
enum MkNativeIsE native
define if data is string or little or big endian …
MQ_CTX parent
CHILD: a pointer to the parent object or MK_NULL.
MQ_CTX master
SLAVE: a pointer to the master object or MK_NULL.
enum MqStartE startAs
create a new application-context as thread, spawn or fork … A new application-context is created if:
config_setting_t * rootH
libconfig data root
bool dispPrefixLOCK
protect prefix
config_setting_t * filterH
libconfig data root
MK_NUM master_id
SLAVE: the ID in the master SLAVES array or O.
bool storageFileLOCK
protect storage
struct MqIoConfigS io
Global configuration data belonging to "io".
enum MqIdentE identFrom
select how to identify the application from remote …
bool dispNameLOCK
protect name
bool dispPostfixLOCK
protect postfix
PUBLIC data structure for the ccmqmsgque-specific-data
const struct MqConfigS config
the configuration data is used for "end-user" configuration
enum MqStatusIsEF statusIs
how the context was created?
struct MqLinkS link
link object data
MqDumpC - the class known as dmp or dump is used to export a ccmqmsgque data package as binary …
MqEnvS - the class known as env or environment is used to store the protected environment in an servi...
bool SIdLck
Short-Term-Transaction-Lock -> the "transSId" was already used.
bool LIdLck
Long-Term-Transaction-Lock -> the "transLId" was forwarded.
MQ_LTR transLId
longterm-transaction-id (rowid from readTrans table) used for persistent-transaction
MQ_HDL routeId
TODO: route-id remote or local. (rowid from the Routing-Table) if "0" -> the default route is used)
struct MqEnvS * link
work together with MqEnvProtect and MqEnvRestore
enum MqTransTypeE transType
what kind of transaction is it: W)ait, T)rans, S)ub, C)allback or N)o
enum MqHandShakeE handShake
what kind of call is it: S)tart, O)k or E)rror
MQ_HDL transSId
storage for the shortterm-transaction
MQ_LTR rmtTransLId
remote transaction-id (rowid from the remote readTrans table) if ">0LL" -> the value to use or "OLL"...
Extend the MkErrorS with ccmqmsgque specific features …
interface for the constructor
MqFactoryDataCopyF fCopy
copy additional data pointer
MK_PTR data
additional data pointer for the fCall
MqFactoryCTorF fCall
create a new object
MqFactoryDataFreeF fFree
free additional data pointer
interface for the destructor
MqFactoryDataCopyF fCopy
copy additional data pointer
MK_PTR data
additional data pointer for the fCall
MqFactoryDTorF fCall
delete the object created with libmqmsgque::MqFactoryCTorS
MqFactoryDataFreeF fFree
free additional data pointer
data used to define a factory
bool isDeleted
mark a factory as deleted -> MqFactoryGet will ignore this factory
bool factoryCalled
was the factory called?
Basic configuration of a context …
MK_I32 buffersize
set the OS specific value for the socket-operation-buffer (default: OS specific)
MK_I32 pkgsize
set maximum package size (default: 10 KiB)
enum MqIoComE com
what kind of socket interface to use?
struct MqIoUdsConfigS uds
set uds configuration-data
MK_TIME_T timeout
user defined timeout to terminate a blocking function call (default: 90 sec)
struct MqIoPipeConfigS pipe
set pipe configuration-data
configure a context to use a init-client-server-link …
Configure a context to use a loop-client-server-link …
configure a context to use a pipe-client-server-link …
MQ_SOCK_HDL hdl
server-result from a socketpair function-call, [0] for the client-socket and [1] for the server-socke...
configure a context to use a tcp-client-server-link …
configure a context to use a uds-client-server-link …
Interface between libmqmsgque::MqContextS and the Operating-System …
MqSysSelectF SysSelect
select syscall …
MqSysServerSpawnF MqSysServerSpawnCB
spawn server create syscall with ccmqmsgque error plugin
MqSysServerForkF MqSysServerForkCB
fork server create syscall with ccmqmsgque error plugin
MqSysServerThreadF MqSysServerThreadCB
thread server create syscall with ccmqmsgque error plugin
object responsible to manage a client/server link data
struct MqEnvS * protectStack
work together with MqEnvProtect and MqEnvRestore
MK_NUM ctxId
the ctxId of this MqContextS object
MK_STRB targetIdent[MqLinkS_targetIdent_size]
struct MqEnvS protect
important part for consistency
struct MqLinkSlaveS slave
link to the SLAVE object
MQ_CTX ctxIdP
the initial (first) context (home of the ctxIdA)
MqContextC - used to create or delete a instance to manage a link …
MqDeleteF fDelete
delete a instance
MqCreateF fCreate
create a new instance
needed to "run-over-all-slaves" → example: MqRouteGetTree
MK_NUM size
size of slaves[]
MK_NUM used
number of slave objects in slaves[]
MQ_CTX context
link to MQ and initialisation-flag
MQ_CTX * slaves
SLAVE: MK_NULL, MASTER a list of pointers of slave objects.
Extend the MkRuntimeS wie ccmqmsgque specific features …
MkThreadDataS mqThreadData
data used to link EXTERNAL runtime to MQ_RT
application-programmer configuration data
enum MqFactoryE factoryCall
an object is created by an factory but using a different call-style
bool isServer
change the context to act as server-context (true) or not (false) …
MQ_FCT factory
set the application-identifier …
bool EventIsServer
if libmqmsgque::MqSetupS::Event is a server event
bool ignoreExit
do not delete the server-context on client-server-link shutdown … By default the server-context is de...
data used to initialize a new created thread …
MQ_RT mqrt
runtime used to intialize the new thread-runtime
MK_TYP typ
all types from calling thread
MkThreadDataS mkThreadData
thread-data to set after new runtime was initialized
MK_RT mkrt
runtime used to intialize the new thread-runtime
bool isUsed
is the object used and initialisation-flag
MkBufferStream16384R argvR
command-line arguments, owned by SysServerThread
MQ_SOCK_HDL socket
"accept" socket for the new thread
MQ_FCT fct
factory used for recreate
MQ_FCT factory
server configuration (memory belongs to caller)
MQ_CTX tmpl
calling (parent) context
MqTypeCtxS - the instance-base for the MqContextC …
MqSetupF fParentBeforeFork
setup and initialize a fork-process before a new fork-process is created by ccmqmsgque
bool ignoreDisasterSetup
do not setup the disaster-handler at startup.
MqSetupF fChildAfterFork
cleanup a child fork-process after a new fork-process is created by ccmqmsgque
bool ignoreThread
do not allow the usage of threads
bool ignoreSpawn
do not allow the usage of spawn
bool argvFix
add first argument in MkBufferListC argument to MqLinkCreate and MqLinkCreateChild
MqWaitForPipeF MqWaitForPipeCB
wait for pipe target to finish
MqSetupF fThreadInit
setup and initialize a thread before a new thread is created by ccmqmsgque
MqExitF MqThreadExitCB
exit/cleanup a thread
MqRefCountF fIncrSelf
increment the libmqmsgque::MqContextS::obj->self reference counting
MqExitF MqProcessExitCB
exit/cleanup a process
MqSetupF fParentAfterFork
cleanup a parent fork-process after a new fork-process is created by ccmqmsgque
MqSetupF fSpawnInit
setup and initialize a spawn-process before a new spawn-process is created by ccmqmsgque
MkMarkF callbackMF
Mark the callback-data-pointer.
MqRefCountF fDecrSelf
decrement the libmqmsgque::MqContextS::obj->self reference counting
MkMarkF dataMF
Mark the data-pointer.
bool ignoreFork
do not allow the usage of fork
MqHelpF fHelp
Create a link to the calling tool help function.