theLink 10.0
Loading...
Searching...
No Matches
mq_misc_check_lng.h
Go to the documentation of this file.
1
9/* LABEL-NO */
10
11/* variables defined - example from PYTHON
12
13#define OT_LNG_NULL_IS(obj) (obj == Py_None)
14
15#define OT_LNG_OBJ_CLASS_IS(obj,cls) PyObject_TypeCheck(obj,cls)
16#define OT_OBJ_TO_CLASS(str) NS(str)
17
18#define OT_LNG_OBJ_ENUM_IS(obj,enm) PyObject_TypeCheck(obj,enm)
19#define OT_LNG_ENUM_NAME(enm) OT_LNG_NAME_FROM_CLASS(enm)
20#define OT_ENUM_TO_I32(io,o,e) io=o
21
22#define OT_LNG_ARRAY_IS(obj) PyObject_TypeCheck(obj,&PyList_Type)
23
24#define OT_LNG_STRN_PRE(str,obj) PyObject *__##str=NULL; \
25 MkErrorCheck(PyObj_AsUTF8(obj,&__##str)); \
26 MK_STRN str=PyBytes_AsString(__##str)
27
28#define OT_LNG_STRN_POST(str,obj) Py_CLEAR(__##str)
29
30#define OT_LNG_LONG_IS(obj) (CHECK_LONG(obj) || CHECK_STRING(obj)) // from "high"
31#define OT_LNG_I32_IS(obj) (CHECK_LONG(obj) || CHECK_STRING(obj)) // from "high"
32
33#include "tmpl/misc_check_lng.h"
34
35*/
36
42
43#if defined HEADER
44
45#define OT_CHECK_CTX(val,nullB) OT_CHECK_CLASS(val, OT_OBJ_TO_CLASS(MqContextC_lngO), MqContextC_TT, nullB)
46#define OT_CHECK_FCT(val,nullB) OT_CHECK_CLASS(val, OT_OBJ_TO_CLASS(MqFactoryC_lngO), MqFactoryC_TT, nullB)
47#define OT_CHECK_DMP(val,nullB) OT_CHECK_CLASS(val, OT_OBJ_TO_CLASS(MqDumpC_lngO), MqDumpC_TT, nullB)
48#define OT_CHECK_EVC(val,nullB) OT_CHECK_CLASS(val, OT_OBJ_TO_CLASS(MqEnvC_lngO), MqEnvC_TT, nullB)
49
50#define OT_CHECK_CTXN(val,nullB) OT_CHECK_CLASS(val, OT_OBJ_TO_CLASS(MqContextC_lngO), MqContextC_TT, nullB)
51#define OT_CHECK_FCTN(val,nullB) OT_CHECK_CLASS(val, OT_OBJ_TO_CLASS(MqFactoryC_lngO), MqFactoryC_TT, nullB)
52#define OT_CHECK_DMPN(val,nullB) OT_CHECK_CLASS(val, OT_OBJ_TO_CLASS(MqDumpC_lngO), MqDumpC_TT, nullB)
53#define OT_CHECK_EVCN(val,nullB) OT_CHECK_CLASS(val, OT_OBJ_TO_CLASS(MqEnvC_lngO), MqEnvC_TT, nullB)
54
55#if !defined(NO_CheckSlaveId)
57 #define OT_CHECK_SLAVE_ID(val) \
58 MkErrorC_CheckD(MQ(CheckSlaveId)(OT_Check_CALL(#val),&val));
59#endif
60
61#if !defined(NQ_CheckConstructor)
63//#pragma message "The value of MQ_EXTERN: " MK_CPPXSTR(MQ_EXTERN)
64 #define OT_CHECK_CONSTRUCTOR(val) \
65 MkErrorC_CheckD(MQ(CheckConstructor)(OT_Check_CALL(#val), &val));
66#endif
67
73
74#else // !HEADER
75
76#if !defined(NO_CheckSlaveId)
79 MK_NUM *retP
80) {
81 if ((*skipP) >= objc) {
82 WrongNumArgs(hdl, (*skipP), objc, -999, +999, arg);
83 goto error;
84 }
85 OT_OBJ_T objV = OT_LNG_OBJV((*skipP)++);
86
87 if (OT_LNG_OBJ_ENUM_IS(objV, OT_OBJ_TO_ENUM(MqSlaveE))) {
88 OT_ENUM_TO_I32_2(objV,MqSlaveE); /* keep error for append */
90 } else if (OT_LNG_I32_IS(objV)) {
92 } else if (OT_LNG_OBJECT_IS(objV)) {
94 } else {
95 WrongTypeOfArgError("MqSlaveE", OT_OBJ_TYPE_STRING(objV));
96 }
97 return MK_OK; /* ignore PRE existing ERROR */
98error:
99 return OT_ERROR_STACK;
100}
101#endif //NO_CheckSlaveId
102
103/*****************************************************************************/
104
105#endif // HEADER
#define MK(n)
#define OT_OBJ_TYPE_STRING(val)
#define OT_OBJ_TO_ENUM(str)
#define OT_LNG_OBJV(__skip)
#define OT_LNG_OBJ_CLASSNAME(val)
#define OT_Prefix_CALL
#define OT_Check_ARGS
MOX_OBJ_T OT_OBJ_T
#define MQ(n)
#define error
Definition high_lng.h:339
#define MK_DECL
MkErrorE
MK_OK
int32_t MK_NUM
MK_PTRB * MK_CBP
#define MQ_EXTERN
static library
MqSlaveE
predefined slave-id for well known slaves …
MkErrorCheck(MqSendSTART(mqctx))
#define OT_ERROR_STACK
#define WrongNumArgs(...)
MK_ATTR_HOT MK_EXTERN enum MkErrorE MK_DECL MK LngObj_AsI32(OT_Prefix_ARGS MK_MNG, OT_OBJ_T, MK_I32 *)
#define WrongTypeOfArgError(exp, got)
MQ_EXTERN enum MkErrorE MQ CheckSlaveId(OT_Check_ARGS, MK_NUM *)
MQ_EXTERN enum MkErrorE MK_DECL MQ CheckConstructor(OT_Check_ARGS, MK_CBP *)