11#define META_FILE_NAME "MqMsgque_tcl.c"
12#define VER TCL_OO_METHOD_VERSION_CURRENT
17#define OtClass_ARGS OBJCMD_ARGS
19#define OT_SETUP_hdl_static \
22 __attribute__((unused)) MK_RT mkrt = MkRT; \
23 __attribute__((unused)) MK_ERR hdl = &MkERROR;
30#include "mk_check_tcl.h"
33#define MqCleanupTmpl()
35#define META_CONTEXT_S hdl
153#define IdentE_FromInt_doc "MqIdentE [MqMsgque IdentE_FromInt value:int32]"
154#define SlaveE_FromInt_doc "MqSlaveE [MqMsgque SlaveE_FromInt value:int32]"
155#define StartE_FromInt_doc "MqStartE [MqMsgque StartE_FromInt value:int32]"
156#define StatusIsEF_FromInt_doc "MqStatusIsEF [MqMsgque StatusIsEF_FromInt value:int32]"
157#define WaitOnEventE_FromInt_doc "MqWaitOnEventE [MqMsgque WaitOnEventE_FromInt value:int32]"
160#define IdentE_ToInt_doc "int32 [MqMsgque IdentE_ToInt value:MqIdentE]"
161#define IdentE_ToString_doc "string [MqMsgque IdentE_ToString value:MqIdentE]"
162#define SlaveE_ToInt_doc "int32 [MqMsgque SlaveE_ToInt value:MqSlaveE]"
163#define SlaveE_ToString_doc "string [MqMsgque SlaveE_ToString value:MqSlaveE]"
164#define StartE_ToInt_doc "int32 [MqMsgque StartE_ToInt value:MqStartE]"
165#define StartE_ToString_doc "string [MqMsgque StartE_ToString value:MqStartE]"
166#define StatusIsEF_ToInt_doc "int32 [MqMsgque StatusIsEF_ToInt value:MqStatusIsEF]"
167#define StatusIsEF_ToString_doc "string [MqMsgque StatusIsEF_ToString value:MqStatusIsEF]"
168#define WaitOnEventE_ToInt_doc "int32 [MqMsgque WaitOnEventE_ToInt value:MqWaitOnEventE]"
169#define WaitOnEventE_ToString_doc "string [MqMsgque WaitOnEventE_ToString value:MqWaitOnEventE]"
172#define Help_doc "string [MqMsgque Help tool:string]"
173#define HelpMsgque_doc "string [MqMsgque HelpMsgque]"
176#define InitGetArg0_doc "MkBufferListC [MqMsgque InitGetArg0]"
177#define InitResetArg0_doc "MkBufferListC [MqMsgque InitResetArg0]"
178#define InitSetArg0_doc "MqMsgque InitSetArg0 ?bfl:MkBufferListC...=\"MK_NULL\"?"
181#define Main_doc "MqMsgque Main code:..."
184#define Cleanup_doc "MqMsgque Cleanup"
185#define Setup_doc "MqMsgque Setup"
397 sizeof(
struct LookupClassS),
"enum", TCL_EXACT, &index));
398 *ret = keys[index].
val;
427 sizeof(
struct LookupClassS),
"enum", TCL_EXACT, &index));
428 *ret = keys[index].
val;
451 sizeof(
struct LookupClassS),
"enum", TCL_EXACT, &index));
452 *ret = keys[index].
val;
506 sizeof(
struct LookupClassS),
"enum", TCL_EXACT, &index));
507 *ret = keys[index].
val;
525 if ((*skipP) >= objc) {
531 OT_SELF_T classO = Tcl_GetObjectFromObj(interp,objV);
535 OT_CLS_T classC = Tcl_GetObjectAsClass(classO);
563 static const char *constant[] = {
564 "thread",
"fork", NULL
570 WNA(1,1,
"(thread|fork)")
573 OtErrorCheckLng (Tcl_GetIndexFromObj (interp, objv[__skip], constant,
"configuration", 0, &index));
576 switch ((
enum constants) index) {
579 Obj = Tcl_NewBooleanObj (1);
581 Obj = Tcl_NewBooleanObj (0);
585#if defined(HAVE_FORK)
586 Obj = Tcl_NewBooleanObj (1);
588 Obj = Tcl_NewBooleanObj (0);
593 Tcl_SetObjResult (interp, Obj);
606 if (Tcl_GetVar2Ex(interp,
"MQ_STARTUP_IS_THREAD",NULL,TCL_GLOBAL_ONLY) == NULL) {
608 int ret = Tcl_EvalObjEx (interp, objv[__skip], TCL_EVAL_GLOBAL);
1008 {
VER,
"support" ,
NS(Support_Class_Cmd) , NULL, NULL},
1012 {
VER,
"IdentE_FromInt" ,
NS(MqMsgque_IdentE_FromInt) , NULL, NULL},
1013 {
VER,
"SlaveE_FromInt" ,
NS(MqMsgque_SlaveE_FromInt) , NULL, NULL},
1014 {
VER,
"StartE_FromInt" ,
NS(MqMsgque_StartE_FromInt) , NULL, NULL},
1015 {
VER,
"StatusIsEF_FromInt" ,
NS(MqMsgque_StatusIsEF_FromInt) , NULL, NULL},
1016 {
VER,
"WaitOnEventE_FromInt",
NS(MqMsgque_WaitOnEventE_FromInt) , NULL, NULL},
1019 {
VER,
"IdentE_ToInt" ,
NS(MqMsgque_IdentE_ToInt) , NULL, NULL},
1020 {
VER,
"IdentE_ToString" ,
NS(MqMsgque_IdentE_ToString) , NULL, NULL},
1021 {
VER,
"SlaveE_ToInt" ,
NS(MqMsgque_SlaveE_ToInt) , NULL, NULL},
1022 {
VER,
"SlaveE_ToString" ,
NS(MqMsgque_SlaveE_ToString) , NULL, NULL},
1023 {
VER,
"StartE_ToInt" ,
NS(MqMsgque_StartE_ToInt) , NULL, NULL},
1024 {
VER,
"StartE_ToString" ,
NS(MqMsgque_StartE_ToString) , NULL, NULL},
1025 {
VER,
"StatusIsEF_ToInt" ,
NS(MqMsgque_StatusIsEF_ToInt) , NULL, NULL},
1026 {
VER,
"StatusIsEF_ToString" ,
NS(MqMsgque_StatusIsEF_ToString) , NULL, NULL},
1027 {
VER,
"WaitOnEventE_ToInt" ,
NS(MqMsgque_WaitOnEventE_ToInt) , NULL, NULL},
1028 {
VER,
"WaitOnEventE_ToString",
NS(MqMsgque_WaitOnEventE_ToString) , NULL, NULL},
1031 {
VER,
"Help" ,
NS(MqMsgque_Help) , NULL, NULL},
1032 {
VER,
"HelpMsgque" ,
NS(MqMsgque_HelpMsgque) , NULL, NULL},
1035 {
VER,
"InitGetArg0" ,
NS(MqMsgque_InitGetArg0) , NULL, NULL},
1036 {
VER,
"InitResetArg0" ,
NS(MqMsgque_InitResetArg0) , NULL, NULL},
1037 {
VER,
"InitSetArg0" ,
NS(MqMsgque_InitSetArg0) , NULL, NULL},
1040 {
VER,
"Main" ,
NS(MqMsgque_Main) , NULL, NULL},
1043 {
VER,
"Cleanup" ,
NS(MqMsgque_Cleanup) , NULL, NULL},
1044 {
VER,
"Setup" ,
NS(MqMsgque_Setup) , NULL, NULL},
1047 {0, NULL, NULL, NULL, NULL}
1059 {0, NULL, NULL, NULL, NULL}
1077 if (Tcl_InitStubs (interp,
"8.6",
true) == NULL) {
1080 if (Tcl_OOInitStubs (interp) == NULL) {
1089 OtErrorCheckLng (Tcl_PkgProvide (interp,
"tclmqmsgque", META_VERSION));
1092 if (Tcl_GetVar(interp,
"::tcl::newPkgs", TCL_GLOBAL_ONLY) != NULL)
return TCL_OK;
1095 MK_STRN ver = Tcl_PkgRequire(interp,
"tclmkkernel", META_VERSION, 1);
1099 OT_NS_T ns = Tcl_CreateNamespace (interp,
"tclmqmsgque", NULL, NULL);
1119 OT_OBJ_T MQ_STARTUP_IS_THREAD = Tcl_GetVar2Ex(interp,
"MQ_STARTUP_IS_THREAD",NULL,TCL_GLOBAL_ONLY);
1125 if (MQ_STARTUP_IS_THREAD == NULL) {
1128 if (
MqInitGetArg0() == NULL && Tcl_GetNameOfExecutable() != NULL) {
1129 Tcl_Eval(interp,
"dict get [info frame 1] file");
1130 MqInitSetArg0VA(Tcl_GetNameOfExecutable(), Tcl_GetStringResult(interp), NULL);
#define OT_SETUP_VARARGS(min, max, d)
#define OT_SETUP_NOARG(d)
#define OT_SETUP_ONEARG(d)
#define OT_CHECK_NI4(val)
#define OT_retObj_SET_Error
#define ot_enum_append(_o, _s)
#define OT_CHECK_REQUIRED(val)
#define OT_retObj_SET_None
#define OT_retObj_SET_I32(nat)
#define OT_LNG_OBJV(__skip)
#define WNA(min, max, txt)
#define OT_retObj_SET_BFL(nat)
#define OT_CHECK_ENUM(ename, val)
#define OT_retObj_SET_STR(nat)
#define OT_CHECK_OPTIONAL(val)
#define OT_retObj_SET(val)
#define OT_REF_INCR(_obj)
#define OtErrorCheckLng(cmd)
#define MkErrorC_Check(mng, PROC)
#define OT_CHECK_STRN(val)
#define StartE_ToString_doc
OT_TCL_EXTERN int Tclmqmsgque_Init(OT_ENV_T interp)
initialize the tclmqmsgque package
#define WaitOnEventE_ToInt_doc
#define WaitOnEventE_ToString_doc
#define IdentE_ToString_doc
#define SlaveE_ToString_doc
#define StatusIsEF_FromInt_doc
#define StatusIsEF_ToString_doc
#define StatusIsEF_ToInt_doc
#define OT_SETUP_hdl_static
int(* LookupObjSF)(OT_ENV_T interp, int objc, OT_OBJ_T const *objv)
#define InitResetArg0_doc
OT_TCL_EXTERN int Tclmqmsgque_Unload(OT_ENV_T interp, int flags)
#define IdentE_FromInt_doc
#define SlaveE_FromInt_doc
#define WaitOnEventE_FromInt_doc
#define StartE_FromInt_doc
#define OT_NEW_Mq_enum_OBJ(typ, val)
#define MkBufferListCreateTLS_T(name, num)
#define MkErrorSetC_2M(err, message)
#define mk_bit_compare(t, f)
static MK_I32 MqStartE_ToInt(enum MqStartE value)
return the MqStartE as integer …
static MK_I32 MqIdentE_ToInt(enum MqIdentE value)
return the MqIdentE as integer …
MK_STRN MqWaitOnEventE_ToString(enum MqWaitOnEventE value)
return the MqWaitOnEventE as string …
static MK_I32 MqStatusIsEF_ToInt(enum MqStatusIsEF value)
return the MqStatusIsEF as integer …
MqFactoryE
the factory is called to create an object for ...
enum MkErrorE MqStartE_FromInt(MK_I32 const value, enum MqStartE *value_out)
return the MqStartE from integer …
enum MkErrorE MqIdentE_FromInt(MK_I32 const value, enum MqIdentE *value_out)
return the MqIdentE from integer …
MqWaitOnEventE
wait for an event? …
MqSlaveE
predefined slave-id for well known slaves …
MK_STRN MqIoComE_ToString(enum MqIoComE value)
return the MqIoComE as string …
MK_STRN MqFactoryE_ToString(enum MqFactoryE value)
return the MqFactoryE as string …
MK_STRN MqStatusIsEF_ToString(enum MqStatusIsEF value)
return the MqStatusIsEF as string …
enum MkErrorE MqSlaveE_FromInt(MK_I32 const value, enum MqSlaveE *value_out)
return the MqSlaveE from integer …
MqIdentE
identify the application using prefix (default) or factory …
MK_STRN MqSlaveE_ToString(enum MqSlaveE value)
return the MqSlaveE as string …
MqStartE
User preferences on HOWTO start a new entity.
MqStatusIsEF
Information about how the context was created.
MK_STRN MqIdentE_ToString(enum MqIdentE value)
return the MqIdentE as string …
MqHandShakeE
the hand-shake of a service-call …
MK_STRN MqStartE_ToString(enum MqStartE value)
return the MqStartE as string …
enum MkErrorE MqStatusIsEF_FromInt(MK_I32 const value, enum MqStatusIsEF *value_out)
return the MqStatusIsEF from integer …
MqIoComE
what kind of socket interface to use? …
static MK_I32 MqWaitOnEventE_ToInt(enum MqWaitOnEventE value)
return the MqWaitOnEventE as integer …
MqTransTypeE
the type of the transaction …
static MK_I32 MqSlaveE_ToInt(enum MqSlaveE value)
return the MqSlaveE as integer …
MK_STRN MqHandShakeE_ToString(enum MqHandShakeE value)
return the MqHandShakeE as string …
enum MkErrorE MqWaitOnEventE_FromInt(MK_I32 const value, enum MqWaitOnEventE *value_out)
return the MqWaitOnEventE from integer …
MK_STRN MqTransTypeE_ToString(enum MqTransTypeE value)
return the MqTransTypeE as string …
@ MQ_FACTORY_NEW_FILTER
create object as a filter
@ MQ_FACTORY_NEW_FORK
create object as a fork process
@ MQ_FACTORY_NEW_THREAD
create object as a thread
@ MQ_FACTORY_NEW_INIT
initial object, nothing else is known
@ MQ_FACTORY_NEW_SLAVE
create object as a slave of an other object
@ MQ_FACTORY_NEW_CHILD
create object as a child of an other object
@ 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_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_SLAVE_OTHER
internal: on the master-ctx get the slave-ctx and on the slave-ctx get the master-ctx
@ 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_MASTER
internal: the master-slave-id, (on a slave get the master)
@ MQ_SLAVE_LOOPBACK
internal: the loopback-slave-id, (call my own services)
@ MQ_SLAVE_MAX
internal: the maximum slave-id …
@ MQ_IDENT_FACTORY
value from MqFactoryS::originalIdent
@ MQ_IDENT_PREFIX
value from MqConfigS::dispPrefix
@ MQ_START_SPAWN
create entity as spawn process
@ MQ_START_DEFAULT
use application-context default entity creation
@ MQ_START_THREAD
create entity as thread
@ MQ_START_FORK
create entity as fork
@ MQ_STATUS_IS_FORK
context is created as a fork
@ 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_INITIAL
context is the first context
@ MQ_STATUS_IS_SPAWN
context is created as a spawn
@ MQ_HANDSHAKE_OK
direction: server -> client
@ MQ_HANDSHAKE_START
direction: client -> server
@ MQ_HANDSHAKE_ERROR
direction: server -> client
@ MQ_IO_UDS
using a uds socket
@ MQ_IO_LOOP
using pipe socket as stdin and stdout
@ MQ_IO_PIPE
using a pipe socket (most internal usage)
@ MQ_IO_INIT
using stdin and stdout
@ MQ_IO_TCP
using a tcp socket
@ MQ_TRANS_TYPE_WAIT
'W' = MqSendEND_AND_WAIT
@ MQ_TRANS_TYPE_SUB
'S' = MqSendEND_AND_SUB
@ MQ_TRANS_TYPE_CB
'C' = MqSendEND_AND_CALLBACK
@ MQ_TRANS_TYPE_NO
'N' = MqSendEND
@ MQ_TRANS_TYPE_TRANS
'T' = MqSendEND_AND_TRANSACTION
MK_STR MqHelp(MK_STRN tool)
write tclmqmsgque specific user-help to stderr
MK_STR MqHelpMsgque(void)
return a page with the usage of all tclmqmsgque specific options
MK_BFL MqInitGetArg0(void)
get the process startup-prefix argument
MK_BFL MqInitResetArg0(void)
Reset the process-startup-prefix argument to an empty list …
void MqInitSetArg0VA(MK_STRN arg0,...)
set the process startup-prefix to a args
void MqInitSetArg0(MK_BAC bfl)
set the process startup-prefix argument to bfl
void MqSetup(void)
setup tclmqmsgque internal memory …
#define WrongNumArgs(...)
#define OT_CHECK_BAC(val)
#define WrongTypeOfArgError(exp, got)
MQ_EXTERN enum MkErrorE MK_DECL MQ CheckConstructor(OT_Check_ARGS, MK_CBP *)