theLink 10.0
Loading...
Searching...
No Matches
LibMqMsgque_py.c File Reference

tag: nhi1-release-250425 More...

#include "LibMqMsgque_py.h"
#include "misc_check_py.h"
#include "tmpl/mq_misc_check_lng.h"
+ Include dependency graph for LibMqMsgque_py.c:

Go to the source code of this file.

Data Structures

struct  pymqmsgque_sMqMsgqueStateS
 

Macros

#define OT_SETUP_hdl
 
#define OT_SETUP_hdl_static
 
#define MqSetupTmpl()
 
#define MqCleanupTmpl()
 
#define IdentE_FromInt_doc   "MqIdentE IdentE_FromInt(value:int32)"
 
#define SlaveE_FromInt_doc   "MqSlaveE SlaveE_FromInt(value:int32)"
 
#define StartE_FromInt_doc   "MqStartE StartE_FromInt(value:int32)"
 
#define StatusIsEF_FromInt_doc   "MqStatusIsEF StatusIsEF_FromInt(value:int32)"
 
#define WaitOnEventE_FromInt_doc   "MqWaitOnEventE WaitOnEventE_FromInt(value:int32)"
 
#define IdentE_ToInt_doc   "int32 IdentE_ToInt(value:MqIdentE)"
 
#define IdentE_ToString_doc   "string IdentE_ToString(value:MqIdentE)"
 
#define SlaveE_ToInt_doc   "int32 SlaveE_ToInt(value:MqSlaveE)"
 
#define SlaveE_ToString_doc   "string SlaveE_ToString(value:MqSlaveE)"
 
#define StartE_ToInt_doc   "int32 StartE_ToInt(value:MqStartE)"
 
#define StartE_ToString_doc   "string StartE_ToString(value:MqStartE)"
 
#define StatusIsEF_ToInt_doc   "int32 StatusIsEF_ToInt(value:MqStatusIsEF)"
 
#define StatusIsEF_ToString_doc   "string StatusIsEF_ToString(value:MqStatusIsEF)"
 
#define WaitOnEventE_ToInt_doc   "int32 WaitOnEventE_ToInt(value:MqWaitOnEventE)"
 
#define WaitOnEventE_ToString_doc   "string WaitOnEventE_ToString(value:MqWaitOnEventE)"
 
#define Help_doc   "string Help(tool:string)"
 
#define HelpMsgque_doc   "string HelpMsgque()"
 
#define InitGetArg0_doc   "MkBufferListC InitGetArg0()"
 
#define InitResetArg0_doc   "MkBufferListC InitResetArg0()"
 
#define InitSetArg0_doc   "InitSetArg0(?bfl:MkBufferListC...=None?)"
 
#define Cleanup_doc   "Cleanup()"
 
#define Setup_doc   "Setup()"
 
#define Debug_doc   "Debug(prefix:str, ?obj:object?"
 
#define myTrace2(col, str)
 
#define myTrace(str)
 

Functions

int pymqmsgque_pMqFactoryC_Setup (MK_RT mkrt, OT_OBJ_T)
 
enum MkErrorE pymqmsgque_CheckConstructor (OT_Check_ARGS, MK_CCP *retP)
 
static OT_ProcRet pymqmsgque_MqMsgque_IdentE_FromInt (OtClass_ARGS)
  Python: [static] MqIdentE IdentE_FromInt(value:int32) C-API
return the MqIdentE from integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_SlaveE_FromInt (OtClass_ARGS)
  Python: [static] MqSlaveE SlaveE_FromInt(value:int32) C-API
return the MqSlaveE from integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_StartE_FromInt (OtClass_ARGS)
  Python: [static] MqStartE StartE_FromInt(value:int32) C-API
return the MqStartE from integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_StatusIsEF_FromInt (OtClass_ARGS)
  Python: [static] MqStatusIsEF StatusIsEF_FromInt(value:int32) C-API
return the MqStatusIsEF from integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_WaitOnEventE_FromInt (OtClass_ARGS)
  Python: [static] MqWaitOnEventE WaitOnEventE_FromInt(value:int32) C-API
return the MqWaitOnEventE from integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_IdentE_ToInt (OtClass_ARGS)
  Python: [static] int32 IdentE_ToInt(value:MqIdentE) C-API
return the MqIdentE as integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_IdentE_ToString (OtClass_ARGS)
  Python: [static] string IdentE_ToString(value:MqIdentE) C-API
return the MqIdentE as string …
 
static OT_ProcRet pymqmsgque_MqMsgque_SlaveE_ToInt (OtClass_ARGS)
  Python: [static] int32 SlaveE_ToInt(value:MqSlaveE) C-API
return the MqSlaveE as integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_SlaveE_ToString (OtClass_ARGS)
  Python: [static] string SlaveE_ToString(value:MqSlaveE) C-API
return the MqSlaveE as string …
 
static OT_ProcRet pymqmsgque_MqMsgque_StartE_ToInt (OtClass_ARGS)
  Python: [static] int32 StartE_ToInt(value:MqStartE) C-API
return the MqStartE as integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_StartE_ToString (OtClass_ARGS)
  Python: [static] string StartE_ToString(value:MqStartE) C-API
return the MqStartE as string …
 
static OT_ProcRet pymqmsgque_MqMsgque_StatusIsEF_ToInt (OtClass_ARGS)
  Python: [static] int32 StatusIsEF_ToInt(value:MqStatusIsEF) C-API
return the MqStatusIsEF as integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_StatusIsEF_ToString (OtClass_ARGS)
  Python: [static] string StatusIsEF_ToString(value:MqStatusIsEF) C-API
return the MqStatusIsEF as string …
 
static OT_ProcRet pymqmsgque_MqMsgque_WaitOnEventE_ToInt (OtClass_ARGS)
  Python: [static] int32 WaitOnEventE_ToInt(value:MqWaitOnEventE) C-API
return the MqWaitOnEventE as integer …
 
static OT_ProcRet pymqmsgque_MqMsgque_WaitOnEventE_ToString (OtClass_ARGS)
  Python: [static] string WaitOnEventE_ToString(value:MqWaitOnEventE) C-API
return the MqWaitOnEventE as string …
 
static OT_ProcRet pymqmsgque_MqMsgque_Help (OtClass_ARGS)
  Python: [static] string Help(tool:string) C-API
write pymqmsgque specific user-help to stderr
 
static OT_ProcRet pymqmsgque_MqMsgque_HelpMsgque (OtClass_ARGS)
  Python: [static] string HelpMsgque() C-API
return a page with the usage of all pymqmsgque specific options
 
static OT_ProcRet pymqmsgque_MqMsgque_InitGetArg0 (OtClass_ARGS)
  Python: [static] MkBufferListC InitGetArg0() C-API
get the process startup-prefix argument
 
static OT_ProcRet pymqmsgque_MqMsgque_InitResetArg0 (OtClass_ARGS)
  Python: [static] MkBufferListC InitResetArg0() C-API
Reset the process-startup-prefix argument to an empty list …
 
static OT_ProcRet pymqmsgque_MqMsgque_InitSetArg0 (OtClass_ARGS)
  Python: [static] InitSetArg0(?bfl:MkBufferListC...=None?) C-API
set the process startup-prefix argument to bfl
 
static OT_ProcRet pymqmsgque_MqMsgque_Cleanup (OtClass_ARGS)
  Python: [static] Cleanup() C-API
cleanup pymqmsgque internal memory …
 
static OT_ProcRet pymqmsgque_MqMsgque_Setup (OtClass_ARGS)
  Python: [static] Setup() C-API
setup pymqmsgque internal memory …
 
static typeof (MqLal.MqSysServerThreadCB) save_MqSysServerThreadF
 
static MK_UNUSED enum MkErrorE pymqmsgque_PyServerThread (MK_RT mkrt, MQ_CTX const context, struct MqSysServerThreadMainS *const argP, MK_STRN name, int thread_status, struct MkIdS *idP)
 
static MK_UNUSED pymqmsgque_sMqMsgqueStateSpymqmsgque_sMqMsgqueGetState (PyObject *module)
 
static MK_UNUSED int pymqmsgque_sMqMsgqueTraverse (PyObject *module, visitproc visit, void *arg)
 
static MK_UNUSED int pymqmsgque_sMqMsgqueClear (PyObject *module)
 
static void pymqmsgque_sMqMsgqueFree (void *module)
 
static int pymqmsgque_sMqMsgqueExec (PyObject *module)
 
PyMODINIT_FUNC LibMqMsgque (void)
 

Variables

static PyMethodDef pymqmsgque_sMqMsgqueMethods []
 
static MK_UNUSED int num = 0
 
__thread MqMsgqueThreadStateS pymqmsgque_MqMsgqueThreadState = {0}
 
static MK_UNUSED PyModuleDef_Slot pymqmsgque_sMqMsgqueDefSlots []
 
static PyModuleDef pymqmsgque_sMqMsgqueDef
 

Detailed Description

tag: nhi1-release-250425

Definition in file LibMqMsgque_py.c.

Macro Definition Documentation

◆ Cleanup_doc

#define Cleanup_doc   "Cleanup()"

Definition at line 164 of file LibMqMsgque_py.c.

◆ Debug_doc

#define Debug_doc   "Debug(prefix:str, ?obj:object?"

Definition at line 169 of file LibMqMsgque_py.c.

◆ Help_doc

#define Help_doc   "string Help(tool:string)"

Definition at line 155 of file LibMqMsgque_py.c.

◆ HelpMsgque_doc

#define HelpMsgque_doc   "string HelpMsgque()"

Definition at line 156 of file LibMqMsgque_py.c.

◆ IdentE_FromInt_doc

#define IdentE_FromInt_doc   "MqIdentE IdentE_FromInt(value:int32)"

doc definition

Definition at line 136 of file LibMqMsgque_py.c.

◆ IdentE_ToInt_doc

#define IdentE_ToInt_doc   "int32 IdentE_ToInt(value:MqIdentE)"

Definition at line 143 of file LibMqMsgque_py.c.

◆ IdentE_ToString_doc

#define IdentE_ToString_doc   "string IdentE_ToString(value:MqIdentE)"

Definition at line 144 of file LibMqMsgque_py.c.

◆ InitGetArg0_doc

#define InitGetArg0_doc   "MkBufferListC InitGetArg0()"

Definition at line 159 of file LibMqMsgque_py.c.

◆ InitResetArg0_doc

#define InitResetArg0_doc   "MkBufferListC InitResetArg0()"

Definition at line 160 of file LibMqMsgque_py.c.

◆ InitSetArg0_doc

#define InitSetArg0_doc   "InitSetArg0(?bfl:MkBufferListC...=None?)"

Definition at line 161 of file LibMqMsgque_py.c.

◆ MqCleanupTmpl

#define MqCleanupTmpl ( )

Definition at line 20 of file LibMqMsgque_py.c.

◆ MqSetupTmpl

#define MqSetupTmpl ( )

Definition at line 19 of file LibMqMsgque_py.c.

◆ myTrace

#define myTrace ( str)

Definition at line 703 of file LibMqMsgque_py.c.

◆ myTrace2

#define myTrace2 ( col,
str )

Definition at line 702 of file LibMqMsgque_py.c.

◆ OT_SETUP_hdl

#define OT_SETUP_hdl
Value:
#define AllRtSetup_NULL
#define MK_ERROR_PRINT

Definition at line 14 of file LibMqMsgque_py.c.

14#define OT_SETUP_hdl AllRtSetup_NULL; \
15 MK_OBJ hdl = MK_ERROR_PRINT;

◆ OT_SETUP_hdl_static

#define OT_SETUP_hdl_static
Value:
__attribute__((unused)) MK_RT mkrt = MkRT; \
__attribute__((unused)) MK_ERR hdl = &MkERROR;
#define MkERROR
#define MkRT

Definition at line 16 of file LibMqMsgque_py.c.

16#define OT_SETUP_hdl_static __attribute__((unused)) MK_RT mkrt = MkRT; \
17 __attribute__((unused)) MK_ERR hdl = &MkERROR;

◆ Setup_doc

#define Setup_doc   "Setup()"

Definition at line 165 of file LibMqMsgque_py.c.

◆ SlaveE_FromInt_doc

#define SlaveE_FromInt_doc   "MqSlaveE SlaveE_FromInt(value:int32)"

Definition at line 137 of file LibMqMsgque_py.c.

◆ SlaveE_ToInt_doc

#define SlaveE_ToInt_doc   "int32 SlaveE_ToInt(value:MqSlaveE)"

Definition at line 145 of file LibMqMsgque_py.c.

◆ SlaveE_ToString_doc

#define SlaveE_ToString_doc   "string SlaveE_ToString(value:MqSlaveE)"

Definition at line 146 of file LibMqMsgque_py.c.

◆ StartE_FromInt_doc

#define StartE_FromInt_doc   "MqStartE StartE_FromInt(value:int32)"

Definition at line 138 of file LibMqMsgque_py.c.

◆ StartE_ToInt_doc

#define StartE_ToInt_doc   "int32 StartE_ToInt(value:MqStartE)"

Definition at line 147 of file LibMqMsgque_py.c.

◆ StartE_ToString_doc

#define StartE_ToString_doc   "string StartE_ToString(value:MqStartE)"

Definition at line 148 of file LibMqMsgque_py.c.

◆ StatusIsEF_FromInt_doc

#define StatusIsEF_FromInt_doc   "MqStatusIsEF StatusIsEF_FromInt(value:int32)"

Definition at line 139 of file LibMqMsgque_py.c.

◆ StatusIsEF_ToInt_doc

#define StatusIsEF_ToInt_doc   "int32 StatusIsEF_ToInt(value:MqStatusIsEF)"

Definition at line 149 of file LibMqMsgque_py.c.

◆ StatusIsEF_ToString_doc

#define StatusIsEF_ToString_doc   "string StatusIsEF_ToString(value:MqStatusIsEF)"

Definition at line 150 of file LibMqMsgque_py.c.

◆ WaitOnEventE_FromInt_doc

#define WaitOnEventE_FromInt_doc   "MqWaitOnEventE WaitOnEventE_FromInt(value:int32)"

Definition at line 140 of file LibMqMsgque_py.c.

◆ WaitOnEventE_ToInt_doc

#define WaitOnEventE_ToInt_doc   "int32 WaitOnEventE_ToInt(value:MqWaitOnEventE)"

Definition at line 151 of file LibMqMsgque_py.c.

◆ WaitOnEventE_ToString_doc

#define WaitOnEventE_ToString_doc   "string WaitOnEventE_ToString(value:MqWaitOnEventE)"

Definition at line 152 of file LibMqMsgque_py.c.

Function Documentation

◆ LibMqMsgque()

PyMODINIT_FUNC LibMqMsgque ( void )

Public API

Definition at line 920 of file LibMqMsgque_py.c.

921{
922 // Multi-phase initialization
923 return PyModuleDef_Init(&NS(sMqMsgqueDef));
924}
#define NS(n)

◆ pymqmsgque_CheckConstructor()

enum MkErrorE pymqmsgque_CheckConstructor ( OT_Check_ARGS ,
MK_CCP * retP )

Definition at line 179 of file LibMqMsgque_py.c.

182 {
183 if ((*skipP) >= objc) {
184 WrongNumArgs(hdl,(*skipP), objc, -999, +999, arg);
185 goto error;
186 }
187 PyObject *objV = OT_LNG_OBJV((*skipP)++);
188 if (PyObject_IsSubclass(objV,(OT_OBJ_T)&NS(MqContextCR)) == 1) {
189 Py_INCREF(objV);
190 *retP = (MK_CCP)objV;
191 } else if (PyObject_IsSubclass(objV,(OT_OBJ_T)&MK(MkObjectCR)) == 1) {
193 } else {
194 WrongTypeOfArgError(OT_LNG_NAME_FROM_CLASS(&NS(MqContextCR)), OT_OBJ_TYPE_STRING(objV));
195 }
196 return MK_OK;
197error:
198 return OT_ERROR_STACK;
199}
#define MK(n)
#define OT_LNG_NAME_FROM_CLASS(cls)
PyTypeObject * OT_CLS_T
PyObject * OT_OBJ_T
#define OT_LNG_OBJV(skip)
#define error
Definition high_lng.h:339
MK_OK
MK_PTRB * MK_CCP
#define OT_ERROR_STACK
#define WrongNumArgs(...)
#define WrongTypeOfArgError(exp, got)
PUBLIC data structure for the pymqmsgque-specific-data

◆ pymqmsgque_pMqFactoryC_Setup()

int pymqmsgque_pMqFactoryC_Setup ( MK_RT mkrt,
OT_OBJ_T  )

◆ pymqmsgque_PyServerThread()

static MK_UNUSED enum MkErrorE pymqmsgque_PyServerThread ( MK_RT mkrt,
MQ_CTX const context,
struct MqSysServerThreadMainS *const argP,
MK_STRN name,
int thread_status,
struct MkIdS * idP )
static

Definition at line 642 of file LibMqMsgque_py.c.

649 {
650 enum MkErrorE ret;
651 PyGILState_STATE gilstate;
652
653 gilstate = PyGILState_Ensure();
654 Py_BEGIN_ALLOW_THREADS
655
656//num++;
657//printV("START num<%d>, ts<%p>, gil<%o>",num,_save,gilstate);
658 ret = (*save_MqSysServerThreadF)(MK_RT_CALL context, argP, name, thread_status, idP);
659//printV("END num<%d>, ts<%p>, gil<%o>",num,_save,gilstate);
660
661 Py_END_ALLOW_THREADS
662 PyGILState_Release(gilstate);
663
664 return ret;
665}
MkErrorE
#define MK_RT_CALL

◆ pymqmsgque_sMqMsgqueClear()

static MK_UNUSED int pymqmsgque_sMqMsgqueClear ( PyObject * module)
static

Definition at line 732 of file LibMqMsgque_py.c.

733{
734myTrace("CLEAR")
735
736 // BEGIN-EnumClear - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
737
738 Py_CLEAR(MqIdentE_lngO);
739 Py_CLEAR(MqSlaveE_lngO);
740 Py_CLEAR(MqStartE_lngO);
741 Py_CLEAR(MqStatusIsEF_lngO);
742 Py_CLEAR(MqWaitOnEventE_lngO);
743
744 // END-EnumClear - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
745 // BEGIN-ClassClear - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
746
747 Py_CLEAR(MqFactoryC_MK_NULL);
748 Py_CLEAR(MqDumpC_MK_NULL);
749 Py_CLEAR(MqContextC_MK_NULL);
750
751 // END-ClassClear - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
752
753 return 0;
754}
#define myTrace(str)
#define MqStatusIsEF_lngO
#define MqContextC_MK_NULL
#define MqWaitOnEventE_lngO
#define MqIdentE_lngO
#define MqStartE_lngO
#define MqDumpC_MK_NULL
#define MqSlaveE_lngO
#define MqFactoryC_MK_NULL

◆ pymqmsgque_sMqMsgqueExec()

static int pymqmsgque_sMqMsgqueExec ( PyObject * module)
static

Definition at line 769 of file LibMqMsgque_py.c.

770{
771myTrace2(MK_COLOR_BLUE,"START")
772//printV("#1 PyThreadState_Get<%p>", PyThreadState_Get())
773
774 MqSetup();
776
777 NS(sMqMsgqueStateS) *state = NS(sMqMsgqueGetState)(module);
778 state->mkrt = MK_RT_PTR;
779
780 PyObject *mainM = PyImport_AddModule("__main__");
781
782 PyObject *mkM;
783 LngErrorCheckN(mkM = PyImport_ImportModule("pymkkernel"));
784 OtErrorCheckLng(PyObject_SetAttrString(mainM,"pymkkernel",mkM));
785 Py_CLEAR(mkM);
786
787 // BEGIN-CLASS-DEF - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
788
789 OtErrorCheckLng( NS(pMqFactoryC_Init) (MK_RT_CALL module) ) ;
790 OtErrorCheckLng( NS(pMqDumpC_Init) (MK_RT_CALL module) ) ;
791 OtErrorCheckLng( NS(pMqContextC_Init) (MK_RT_CALL module) ) ;
792
793 // END-CLASS-DEF - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
794
795 // init ENUM
796 MK_STR enumCode =
797 "from enum import IntEnum, IntFlag\n"
798
799 // BEGIN-EnumCode - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
800
801 "class MqIdentE(IntEnum):\n"
802 " PREFIX = 0\n"
803 " FACTORY = 1\n"
804
805 "class MqSlaveE(IntEnum):\n"
806 " LOOPBACK = 0\n"
807 " FILTER = 1\n"
808 " MASTER = 1\n"
809 " OTHER = 1\n"
810 " USER = 10\n"
811 " MAX = 1024\n"
812
813 "class MqStartE(IntEnum):\n"
814 " DEFAULT = 0\n"
815 " FORK = 1\n"
816 " THREAD = 2\n"
817 " SPAWN = 3\n"
818
819 "class MqStatusIsEF(IntFlag):\n"
820 " INITIAL = 0\n"
821 " DUP = 1\n"
822 " THREAD = 2\n"
823 " FORK = 4\n"
824 " SPAWN = 8\n"
825
826 "class MqWaitOnEventE(IntEnum):\n"
827 " NO = 0\n"
828 " ONCE = 1\n"
829 " OWN = 2\n"
830 " FOREVER = 3\n"
831
832 // END-EnumCode - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
833 ;
834
835 PyObject *myD, *mainD, *tmpO;
836 mainD = PyModule_GetDict(mainM);
837 myD = PyModule_GetDict(module);
838 tmpO = PyRun_String(enumCode, Py_file_input, mainD, myD);
839 LngErrorCheckN(tmpO);
840 Py_CLEAR(tmpO);
841
842 // BEGIN-EnumSet - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
843
844 MqIdentE_lngO = (PyTypeObject*) Py_NewRef(PyDict_GetItemString(myD,"MqIdentE"));
845 MqSlaveE_lngO = (PyTypeObject*) Py_NewRef(PyDict_GetItemString(myD,"MqSlaveE"));
846 MqStartE_lngO = (PyTypeObject*) Py_NewRef(PyDict_GetItemString(myD,"MqStartE"));
847 MqStatusIsEF_lngO = (PyTypeObject*) Py_NewRef(PyDict_GetItemString(myD,"MqStatusIsEF"));
848 MqWaitOnEventE_lngO = (PyTypeObject*) Py_NewRef(PyDict_GetItemString(myD,"MqWaitOnEventE"));
849
850 // END-EnumSet - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
851
852 // every new thread source the script
853 // "from pymqmsgque import" is calling "PyInit_pymqmsgque"
854 // → check if we on "thread" : __name__=__main__
855
856 // only ONCE on INITIAL setup
857 if (strcmp(PyModule_GetName(mainM),"__main__") == 0) {
858
859 // set the thread startup
860 //save_MqSysServerThreadF = MqLal.SysServerThread;
861 //MqLal.SysServerThread = NS(PyServerThread);
862 //MkLal.SysExit = NS(PyExit);
863
864 // init libmqmsgque global data
865 if (MqInitGetArg0() == NULL && Py_GetProgramName() != NULL) {
866 char *py = Py_EncodeLocale(Py_GetProgramName(),NULL);
867
868 PyObject *sysO = PyImport_ImportModule("sys");
869 LngErrorCheckN(sysO);
870 PyObject *argvO = PyObject_GetAttrString(sysO, "argv");
871 LngErrorCheckN(argvO);
872 PyObject *itmO = PyList_GetItem(argvO, 0);
873 LngErrorCheckN(itmO);
874
875 MqInitSetArg0VA(py, PyUnicode_AsUTF8(itmO), NULL);
876
877 Py_CLEAR(argvO);
878 Py_CLEAR(sysO);
879 PyMem_Free(py);
880 }
881
882 // create the default-factory
883 OtErrorCheckLng (NS(pMqFactoryC_Setup) (MK_RT_CALL module));
884 }
885
886 //PyErr_SetString(PyExc_RuntimeError,"this is a test");
887
888//mk_dbg_color_ln(MK_COLOR_BLUE,"END module<%p>",module);
889 return 0;
890error:
891 return -1;
892}
#define LngErrorCheckN(PROC)
#define OtErrorCheckLng(PROC)
#define myTrace2(col, str)
MK_STRB * MK_STR
#define MK_RT_PTR
#define MkRtSetup_NULL
MqWaitOnEventE
wait for an event? …
MqSlaveE
predefined slave-id for well known slaves …
MqIdentE
identify the application using prefix (default) or factory …
MqStartE
User preferences on HOWTO start a new entity.
MqStatusIsEF
Information about how the context was created.
MK_BFL MqInitGetArg0(void)
get the process startup-prefix argument
void MqInitSetArg0VA(MK_STRN arg0,...)
set the process startup-prefix to a args
void MqSetup(void)
setup pymqmsgque internal memory …
if(call==MQ_RET &&highSKIP==highSIZE) goto call
Definition high_lng.h:230

◆ pymqmsgque_sMqMsgqueFree()

static void pymqmsgque_sMqMsgqueFree ( void * module)
static

Definition at line 757 of file LibMqMsgque_py.c.

758{
759myTrace("FREE")
760 NS(sMqMsgqueStateS) *state = NS(sMqMsgqueGetState)(module);
761 NS(sMqMsgqueClear)((PyObject *)module);
762 if (state && state->mkrt) {
763 state->mkrt->mkThreadData.ptr = NULL;
764 state->mkrt=NULL;
765 }
766}

◆ pymqmsgque_sMqMsgqueGetState()

static MK_UNUSED pymqmsgque_sMqMsgqueStateS * pymqmsgque_sMqMsgqueGetState ( PyObject * module)
inlinestatic

Definition at line 691 of file LibMqMsgque_py.c.

692{
693 void *state = PyModule_GetState(module);
694 assert(state != NULL);
695 return (NS(sMqMsgqueStateS)*)state;
696}

◆ pymqmsgque_sMqMsgqueTraverse()

static MK_UNUSED int pymqmsgque_sMqMsgqueTraverse ( PyObject * module,
visitproc visit,
void * arg )
static

Definition at line 707 of file LibMqMsgque_py.c.

708{
709myTrace("TRAVERSE")
710
711 // BEGIN-EnumTraverse - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
712
713 Py_VISIT(MqIdentE_lngO);
714 Py_VISIT(MqSlaveE_lngO);
715 Py_VISIT(MqStartE_lngO);
716 Py_VISIT(MqStatusIsEF_lngO);
717 Py_VISIT(MqWaitOnEventE_lngO);
718
719 // END-EnumTraverse - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
720 // BEGIN-ClassTraverse - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
721
722 Py_VISIT(MqFactoryC_MK_NULL);
723 Py_VISIT(MqDumpC_MK_NULL);
724 Py_VISIT(MqContextC_MK_NULL);
725
726 // END-ClassTraverse - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
727
728 return 0;
729}

◆ typeof()

static typeof ( MqLal. MqSysServerThreadCB)
static

Variable Documentation

◆ num

MK_UNUSED int num = 0
static

Definition at line 640 of file LibMqMsgque_py.c.

◆ pymqmsgque_MqMsgqueThreadState

__thread MqMsgqueThreadStateS pymqmsgque_MqMsgqueThreadState = {0}

Definition at line 684 of file LibMqMsgque_py.c.

684{0};

◆ pymqmsgque_sMqMsgqueDef

PyModuleDef pymqmsgque_sMqMsgqueDef
static
Initial value:
= {
PyModuleDef_HEAD_INIT,
.m_name = "pymqmsgque",
.m_doc = "python language binding for 'theLink'",
.m_size = sizeof( pymqmsgque_sMqMsgqueStateS ),
}
static MK_UNUSED int pymqmsgque_sMqMsgqueClear(PyObject *module)
static MK_UNUSED int pymqmsgque_sMqMsgqueTraverse(PyObject *module, visitproc visit, void *arg)
static void pymqmsgque_sMqMsgqueFree(void *module)
static MK_UNUSED PyModuleDef_Slot pymqmsgque_sMqMsgqueDefSlots[]
static PyMethodDef pymqmsgque_sMqMsgqueMethods[]

Definition at line 900 of file LibMqMsgque_py.c.

900 {
901 PyModuleDef_HEAD_INIT,
902 .m_name = "pymqmsgque",
903 .m_doc = "python language binding for 'theLink'",
904 .m_size = sizeof(NS(sMqMsgqueStateS)),
905 .m_methods = NS(sMqMsgqueMethods),
906 .m_slots = NS(sMqMsgqueDefSlots),
907 .m_traverse = NS(sMqMsgqueTraverse), // garbage collection
908 .m_clear = NS(sMqMsgqueClear),
909 .m_free = NS(sMqMsgqueFree),
910};

◆ pymqmsgque_sMqMsgqueDefSlots

MK_UNUSED PyModuleDef_Slot pymqmsgque_sMqMsgqueDefSlots[]
static
Initial value:
= {
{Py_mod_exec, pymqmsgque_sMqMsgqueExec },
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{0, NULL}
}
static int pymqmsgque_sMqMsgqueExec(PyObject *module)

Definition at line 894 of file LibMqMsgque_py.c.

894 {
895 {Py_mod_exec, NS(sMqMsgqueExec)},
896 {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
897 {0, NULL}
898};

◆ pymqmsgque_sMqMsgqueMethods

PyMethodDef pymqmsgque_sMqMsgqueMethods[]
static

Type definition

Definition at line 589 of file LibMqMsgque_py.c.

589 {
590
591 // BEGIN-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
592
593 // doc-key: MqMsgque,EnumFunc,sco
594 { "IdentE_FromInt" , (PyCFunction) NS(MqMsgque_IdentE_FromInt) , METH_O , IdentE_FromInt_doc },
595 { "SlaveE_FromInt" , (PyCFunction) NS(MqMsgque_SlaveE_FromInt) , METH_O , SlaveE_FromInt_doc },
596 { "StartE_FromInt" , (PyCFunction) NS(MqMsgque_StartE_FromInt) , METH_O , StartE_FromInt_doc },
597 { "StatusIsEF_FromInt" , (PyCFunction) NS(MqMsgque_StatusIsEF_FromInt) , METH_O , StatusIsEF_FromInt_doc },
598 { "WaitOnEventE_FromInt" , (PyCFunction) NS(MqMsgque_WaitOnEventE_FromInt) , METH_O , WaitOnEventE_FromInt_doc },
599
600 // doc-key: MqMsgque,EnumFunc,sm_
601 { "IdentE_ToInt" , (PyCFunction) NS(MqMsgque_IdentE_ToInt) , METH_O , IdentE_ToInt_doc },
602 { "IdentE_ToString" , (PyCFunction) NS(MqMsgque_IdentE_ToString) , METH_O , IdentE_ToString_doc },
603 { "SlaveE_ToInt" , (PyCFunction) NS(MqMsgque_SlaveE_ToInt) , METH_O , SlaveE_ToInt_doc },
604 { "SlaveE_ToString" , (PyCFunction) NS(MqMsgque_SlaveE_ToString) , METH_O , SlaveE_ToString_doc },
605 { "StartE_ToInt" , (PyCFunction) NS(MqMsgque_StartE_ToInt) , METH_O , StartE_ToInt_doc },
606 { "StartE_ToString" , (PyCFunction) NS(MqMsgque_StartE_ToString) , METH_O , StartE_ToString_doc },
607 { "StatusIsEF_ToInt" , (PyCFunction) NS(MqMsgque_StatusIsEF_ToInt) , METH_O , StatusIsEF_ToInt_doc },
608 { "StatusIsEF_ToString" , (PyCFunction) NS(MqMsgque_StatusIsEF_ToString) , METH_O , StatusIsEF_ToString_doc },
609 { "WaitOnEventE_ToInt" , (PyCFunction) NS(MqMsgque_WaitOnEventE_ToInt) , METH_O , WaitOnEventE_ToInt_doc },
610 { "WaitOnEventE_ToString" , (PyCFunction) NS(MqMsgque_WaitOnEventE_ToString) , METH_O , WaitOnEventE_ToString_doc },
611
612 // doc-key: MqMsgque,MqHelp,sm_
613 { "Help" , (PyCFunction) NS(MqMsgque_Help) , METH_O , Help_doc },
614 { "HelpMsgque" , (PyCFunction) NS(MqMsgque_HelpMsgque) , METH_NOARGS , HelpMsgque_doc },
615
616 // doc-key: MqMsgque,MqInit,sm_
617 { "InitGetArg0" , (PyCFunction) NS(MqMsgque_InitGetArg0) , METH_NOARGS , InitGetArg0_doc },
618 { "InitResetArg0" , (PyCFunction) NS(MqMsgque_InitResetArg0) , METH_NOARGS , InitResetArg0_doc },
619 { "InitSetArg0" , (PyCFunction) NS(MqMsgque_InitSetArg0) , METH_VARARGS , InitSetArg0_doc },
620
621 // doc-key: MqMsgque,Setup,sm_
622 { "Cleanup" , (PyCFunction) NS(MqMsgque_Cleanup) , METH_NOARGS , Cleanup_doc },
623 { "Setup" , (PyCFunction) NS(MqMsgque_Setup) , METH_NOARGS , Setup_doc },
624
625 // END-CLASS - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
626
627 // BEGIN-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
628
629 // → no data
630
631 // END-OBJ - created by 'py_MqS.tcl -i NHI1_HOME/theLink/c/gen/c_mqmsgque.meta' - DO NOT change
632
633 {NULL, NULL, 0, NULL} /* Sentinel */
634};
#define StartE_ToString_doc
#define WaitOnEventE_ToInt_doc
#define WaitOnEventE_ToString_doc
#define IdentE_ToInt_doc
#define IdentE_ToString_doc
#define InitGetArg0_doc
#define SlaveE_ToString_doc
#define StatusIsEF_FromInt_doc
#define StatusIsEF_ToString_doc
#define StatusIsEF_ToInt_doc
#define HelpMsgque_doc
#define Help_doc
#define InitSetArg0_doc
#define InitResetArg0_doc
#define StartE_ToInt_doc
#define Cleanup_doc
#define IdentE_FromInt_doc
#define SlaveE_ToInt_doc
#define SlaveE_FromInt_doc
#define Setup_doc
#define WaitOnEventE_FromInt_doc
#define StartE_FromInt_doc