diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62c8935 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ \ No newline at end of file diff --git a/mqseries.c b/mqseries.c index b5ea348..0145d24 100644 --- a/mqseries.c +++ b/mqseries.c @@ -31,8 +31,8 @@ any other GPL-like (LGPL, GPL2) License. $Id$ Author: Michael Bretterklieber - Philippe Tjon A Hen - Pierrick Charron + Philippe Tjon A Hen + Pierrick Charron */ @@ -49,6 +49,7 @@ Author: Michael Bretterklieber static void _mqseries_disc(zend_resource *rsrc); static void _mqseries_close(zend_resource *rsrc); static void _mqseries_bytes(zend_resource *rsrc); +static void _mqseries_hmsg(zend_resource *rsrc); static int _mqseries_is_compcode_reason_ref(zval *, zval *); static int _mqseries_is_called_by_ref(zval *, char *); @@ -63,6 +64,7 @@ ZEND_DECLARE_MODULE_GLOBALS(mqseries) int le_mqseries_conn; int le_mqseries_obj; int le_mqseries_bytes; +int le_mqseries_message; static HashTable *ht_reason_texts; @@ -217,6 +219,85 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mqseries_stat, 0, 0, 5) ZEND_ARG_INFO(1, reason) /* OR: Reason code qualifying CompCode */ ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_mqseries_bufmh, 0, 0, 8) + ZEND_ARG_INFO(0, hconn) /* I: Connection handle */ + ZEND_ARG_INFO(1, hmsg) + ZEND_ARG_ARRAY_INFO(1, bufMsgHOpts, 0) + ZEND_ARG_ARRAY_INFO(1, msgDesc, 0) /* IO: Message descriptor */ + ZEND_ARG_INFO(0, buffer) /* IB: Message data */ + ZEND_ARG_INFO(1, dataLength) /* O: Length of the message */ + ZEND_ARG_INFO(1, compCode) /* OC: Completion code */ + ZEND_ARG_INFO(1, reason) /* OR: Reason code qualifying CompCode */ +ZEND_END_ARG_INFO() + + +ZEND_BEGIN_ARG_INFO_EX(arginfo_mqseries_crtmh, 0, 0, 5) + ZEND_ARG_INFO(0, hconn) /* I: Connection handle */ + ZEND_ARG_ARRAY_INFO(1, crtMsgHOpt, 0) + ZEND_ARG_INFO(1, hmsg) + ZEND_ARG_INFO(1, compCode) /* OC: Completion code */ + ZEND_ARG_INFO(1, reason) /* OR: Reason code qualifying CompCode */ +ZEND_END_ARG_INFO() + + +ZEND_BEGIN_ARG_INFO_EX(arginfo_mqseries_dltmh, 0, 0, 5) + ZEND_ARG_INFO(0, hconn) /* I: Connection handle */ + ZEND_ARG_INFO(1, hmsg) + ZEND_ARG_ARRAY_INFO(1, dltMsgHOpt, 0) + ZEND_ARG_INFO(1, compCode) /* OC: Completion code */ + ZEND_ARG_INFO(1, reason) /* OR: Reason code qualifying CompCode */ +ZEND_END_ARG_INFO() + + +ZEND_BEGIN_ARG_INFO_EX(arginfo_mqseries_dltmp, 0, 0, 6) + ZEND_ARG_INFO(0, hconn) /* I: Connection handle */ + ZEND_ARG_INFO(1, hmsg) + ZEND_ARG_ARRAY_INFO(1, dltPropOpts, 0) + ZEND_ARG_INFO(0, name) /* I: Name */ + ZEND_ARG_INFO(1, compCode) /* OC: Completion code */ + ZEND_ARG_INFO(1, reason) /* OR: Reason code qualifying CompCode */ +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_mqseries_inqmp, 0, 0, 11) + ZEND_ARG_INFO(0, hconn) /* I: Connection handle */ + ZEND_ARG_INFO(1, hmsg) + ZEND_ARG_ARRAY_INFO(1, inqPropOpts, 0) + ZEND_ARG_INFO(1, name) /* I: Name */ + ZEND_ARG_ARRAY_INFO(1, propDesc, 0) /* IO: Message descriptor */ + ZEND_ARG_INFO(1, type) /* I: Status information type */ + ZEND_ARG_INFO(0, bufferlength) /* IL: Length in bytes of the Buffer area */ + ZEND_ARG_INFO(1, value) /* IB: Message data */ + ZEND_ARG_INFO(1, dataLength) /* O: Length of the message */ + ZEND_ARG_INFO(1, compCode) /* OC: Completion code */ + ZEND_ARG_INFO(1, reason) /* OR: Reason code qualifying CompCode */ +ZEND_END_ARG_INFO() + + +ZEND_BEGIN_ARG_INFO_EX(arginfo_mqseries_mhbuf, 0, 0, 9) + ZEND_ARG_INFO(0, hconn) /* I: Connection handle */ + ZEND_ARG_INFO(1, hmsg) + ZEND_ARG_ARRAY_INFO(1, msgHBufOpts, 0) + ZEND_ARG_INFO(0, name) /* I: Name */ + ZEND_ARG_ARRAY_INFO(1, msgDesc, 0) /* IO: Message descriptor */ + ZEND_ARG_INFO(0, buffer) /* IB: Message data */ + ZEND_ARG_INFO(1, dataLength) /* O: Length of the message */ + ZEND_ARG_INFO(1, compCode) /* OC: Completion code */ + ZEND_ARG_INFO(1, reason) /* OR: Reason code qualifying CompCode */ +ZEND_END_ARG_INFO() + + +ZEND_BEGIN_ARG_INFO_EX(arginfo_mqseries_setmp, 0, 0, 10) + ZEND_ARG_INFO(0, hconn) /* I: Connection handle */ + ZEND_ARG_INFO(1, hmsg) + ZEND_ARG_ARRAY_INFO(1, setPropOpts, 0) + ZEND_ARG_INFO(0, name) /* I: Name */ + ZEND_ARG_ARRAY_INFO(1, propDesc, 0) /* IO: Message descriptor */ + ZEND_ARG_INFO(0, type) /* I: Status information type */ + ZEND_ARG_INFO(0, value) /* IB: Message data */ + ZEND_ARG_INFO(1, compCode) /* OC: Completion code */ + ZEND_ARG_INFO(1, reason) /* OR: Reason code qualifying CompCode */ +ZEND_END_ARG_INFO() + #endif /* HAVE_MQSERIESLIB_V7 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_mqseries_strerror, 0, 0, 1) @@ -251,6 +332,13 @@ zend_function_entry mqseries_functions[] = { #ifdef HAVE_MQSERIESLIB_V7 PHP_FE(mqseries_sub, arginfo_mqseries_sub) PHP_FE(mqseries_stat, arginfo_mqseries_stat) + PHP_FE(mqseries_bufmh, arginfo_mqseries_bufmh) + PHP_FE(mqseries_crtmh, arginfo_mqseries_crtmh) + PHP_FE(mqseries_dltmh, arginfo_mqseries_dltmh) + PHP_FE(mqseries_dltmp, arginfo_mqseries_dltmp) + PHP_FE(mqseries_inqmp, arginfo_mqseries_inqmp) + PHP_FE(mqseries_mhbuf, arginfo_mqseries_mhbuf) + PHP_FE(mqseries_setmp, arginfo_mqseries_setmp) #endif /* HAVE_MQSERIESLIB_V7 */ {NULL, NULL, NULL} /* Must be the last line in mqseries_functions[] */ }; @@ -294,6 +382,8 @@ PHP_MINIT_FUNCTION(mqseries) le_mqseries_bytes = zend_register_list_destructors_ex(_mqseries_bytes, NULL, PHP_MQSERIES_BYTES_RES_NAME, module_number); + le_mqseries_message = zend_register_list_destructors_ex(_mqseries_hmsg, NULL, PHP_MQSERIES_MESSAGE_RES_NAME, module_number); + #include "mqseries_init_const.h" ht_reason_texts = (HashTable *) malloc(sizeof(HashTable)); @@ -350,17 +440,16 @@ MQ call: MQLONG Reason; -- Reason code qualifying CompCode */ -PHP_FUNCTION(mqseries_conn) -{ - char *name; - size_t name_len; +PHP_FUNCTION(mqseries_conn) { + char *name = NULL; + size_t name_len= 0; zval *z_conn, *z_comp_code, *z_reason; mqseries_descriptor *mqdesc; MQCHAR48 qManagerName; - MQLONG comp_code; - MQLONG reason; + MQLONG comp_code = 0; + MQLONG reason = 0; if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z/z/", &name, &name_len, &z_conn, &z_comp_code, &z_reason) == FAILURE) { return; @@ -1278,7 +1367,12 @@ PHP_FUNCTION(mqseries_bytes_val) } if (bytes && bytes->bytes) { - RETVAL_STRINGL((char *) bytes->bytes, 24); /* MQBYTE24 */ + if (bytes->size > 0) { + RETVAL_STRINGL((char *)bytes->bytes, bytes->size); + } else { + RETVAL_STRINGL((char *) bytes->bytes, 24); /* MQBYTE24 */ + } + } else { RETVAL_NULL(); } @@ -1423,6 +1517,610 @@ PHP_FUNCTION(mqseries_stat) _mqseries_set_array_from_mqsts(z_status, &status); } + +/* 21.07.2017 */ +/* + MQ call: + + MQBUFMH (Hconn, Hmsg, &BufMsgHOpts, &MsgDesc, BufferLength, Buffer, &DataLength, &CompCode, &Reason); + + MQHCONN Hconn; -- Connection handle + MQHMSG Hmsg; -- Message handle + MQBMHO BufMsgHOpts; -- Options that control the action of MQBUFMH + MQMD MsgDesc; -- Message descriptor + MQLONG BufferLength; -- Length in bytes of the Buffer area + MQBYTE Buffer[n]; -- Area to contain the message buffer + MQLONG DataLength; -- Length of the output buffer + MQLONG CompCode; -- Completion code + MQLONG Reason; -- Reason code qualifying CompCode +*/ +PHP_FUNCTION(mqseries_bufmh) { + mqseries_descriptor *mqdesc; + mqseries_message *mqhandle; + MQCHARV prop_name = { MQCHARV_DEFAULT }; + zend_long type; + MQLONG comp_code = 0, reason = 0; + zval *z_mqdesc, + *z_hmsg, + *z_msg_desc, + *z_buf_msg_hopts, + *z_buffer, + *z_data_length, + *z_comp_code, + *z_reason; + + MQLONG data_length = 0, buffer_size = 0; + MQBYTE *data; + + zend_long buf_len = 0L; + MQBYTE *buf; + + MQBMHO buf_msg_hopts = { MQBMHO_DEFAULT }; + MQMD msg_desc = { MQMD_DEFAULT }; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rraaslz/z/", &z_mqdesc, &z_hmsg, &z_buf_msg_hopts, &z_msg_desc, &data, &data_length, &buf_len, &z_comp_code, &z_reason) == FAILURE) { + return; + } + + if ((mqdesc = (mqseries_descriptor *)zend_fetch_resource(Z_RES_P(z_mqdesc), PHP_MQSERIES_DESCRIPTOR_RES_NAME, le_mqseries_conn)) == NULL) { + RETURN_FALSE; + } + if ((mqhandle = (mqseries_message *)zend_fetch_resource(Z_RES_P(z_hmsg), PHP_MQSERIES_MESSAGE_RES_NAME, le_mqseries_message)) == NULL) { + RETURN_FALSE; + } + + _mqseries_set_mqmd_from_array(z_msg_desc, &msg_desc); + _mqseries_set_mqbmho_from_array(z_buf_msg_hopts, &buf_msg_hopts); + + //data = buf = (MQBYTE *)emalloc(sizeof(MQBYTE) * buf_len); + MQBUFMH(mqdesc->conn, mqhandle->handle, &buf_msg_hopts, &msg_desc, (MQLONG)buf_len, data, &data_length, &comp_code, &reason); + + ZVAL_LONG(z_comp_code, (long)comp_code); + ZVAL_LONG(z_reason, (long)reason); + _mqseries_set_array_from_mqmd(z_msg_desc, &msg_desc); +} + +/* +MQ call: + +MQMHBUF (Hconn, Hmsg, &MsgHBufOpts, &Name, &MsgDesc, BufferLength, Buffer, &DataLength, &CompCode, &Reason); + +MQHCONN Hconn; -- Connection handle +MQHMSG Hmsg; -- Message handle +MQMHBO MsgHBufOpts; -- Options that control the action of MQMHBUF +MQCHARV Name; -- Property name +MQMD MsgDesc; -- Message descriptor +MQLONG BufferLength; -- Length in bytes of the Buffer area +MQBYTE Buffer[n]; -- Area to contain the properties +MQLONG DataLength; -- Length of the properties +MQLONG CompCode; -- Completion code +MQLONG Reason; -- Reason code qualifying CompCode +*/ +PHP_FUNCTION(mqseries_mhbuf) { + mqseries_descriptor *mqdesc; + mqseries_message *mqhandle; + MQLONG comp_code, reason; + MQCHARV prop_name = { MQCHARV_DEFAULT }; + zval *z_mqdesc, + *z_hmsg, + *z_msg_desc, + *z_buffer, + *z_data_length, + *z_buf_msg_hopts, + *z_comp_code, + *z_reason; + + char *name = NULL; + size_t name_len = 0; + zend_long buf_len = 0L; + MQLONG data_length = 0L; + MQBYTE *buf, *data; + MQMHBO buf_msg_hopts = { MQMHBO_DEFAULT }; + MQMD msg_desc = { MQMD_DEFAULT }; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rra/s/al/z/z/z/z/", &z_mqdesc, &z_hmsg, &z_buf_msg_hopts, &name, &name_len, &z_msg_desc, &buf_len, &z_buffer, &z_data_length, &z_comp_code, &z_reason) == FAILURE) { + return; + } + + if ((mqdesc = (mqseries_descriptor *)zend_fetch_resource(Z_RES_P(z_mqdesc), PHP_MQSERIES_DESCRIPTOR_RES_NAME, le_mqseries_conn)) == NULL) { + RETURN_FALSE; + } + if ((mqhandle = (mqseries_message *)zend_fetch_resource(Z_RES_P(z_hmsg), PHP_MQSERIES_MESSAGE_RES_NAME, le_mqseries_message)) == NULL) { + RETURN_FALSE; + } + + _mqseries_set_mqmhbo_from_array(z_buf_msg_hopts, &buf_msg_hopts); + _mqseries_set_mqmd_from_array(z_msg_desc, &msg_desc); + + data = buf = (MQBYTE *)emalloc(sizeof(MQBYTE) * buf_len); + prop_name.VSPtr = name; + prop_name.VSLength = name_len; + MQMHBUF(mqdesc->conn, mqhandle->handle, &buf_msg_hopts, &prop_name, &msg_desc, (MQLONG)buf_len, buf, &data_length, &comp_code, &reason); + + if (comp_code == MQCC_OK) { + ZVAL_LONG(z_data_length, (long)data_length); + zval_dtor(z_buffer); + ZVAL_STRINGL(z_buffer, (char *)data, (buf_len > 0) ? (buf_len < (long)data_length ? buf_len : (long)data_length) : 0); + } + _mqseries_set_array_from_mqmd(z_msg_desc, &msg_desc); + ZVAL_LONG(z_comp_code, (long)comp_code); + ZVAL_LONG(z_reason, (long)reason); + efree(buf); +} + +/* +MQ call: + +MQCRTMH (Hconn, &CrtMsgHOpts, &Hmsg, &CompCode, &Reason); + +MQHCONN Hconn; -- Connection handle +MQCMHO CrtMsgHOpts; -- Options that control the action of MQCRTMH +MQHMSG Hmsg; -- Message handle +MQLONG CompCode; -- Completion code +MQLONG Reason; -- Reason code qualifying CompCode +*/ +PHP_FUNCTION(mqseries_crtmh) { + mqseries_descriptor *mqdesc; + mqseries_message *mqmsg; + MQLONG comp_code, reason; + zval *z_mqdesc, + *z_mhandle, + *z_crt_msg_opts, + *z_comp_code, + *z_reason; + + MQCMHO crt_msg_opts = { MQCMHO_DEFAULT }; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/a/z/z/z/", &z_mqdesc, &z_crt_msg_opts, &z_mhandle, &z_comp_code, &z_reason) == FAILURE) { + return; + } + if ((mqdesc = (mqseries_descriptor *)zend_fetch_resource(Z_RES_P(z_mqdesc), PHP_MQSERIES_DESCRIPTOR_RES_NAME, le_mqseries_conn)) == NULL) { + RETURN_FALSE; + } + _mqseries_set_mqcmho_from_array(z_crt_msg_opts, &crt_msg_opts); + + mqmsg = (mqseries_message *)emalloc(sizeof(mqseries_message)); + MQCRTMH(mqdesc->conn, &crt_msg_opts, &mqmsg->handle, &comp_code, &reason); + ZVAL_LONG(z_comp_code, (long)comp_code); + ZVAL_LONG(z_reason, (long)reason); + if (comp_code == MQCC_OK) { + zval_dtor(z_mhandle); + ZVAL_RES(z_mhandle, zend_register_resource(mqmsg, le_mqseries_message)); + mqmsg->id = Z_RES_P(z_mhandle)->handle; + } + else { + efree(mqmsg); + } +} + +/* +MQ call: + +MQDLTMH (Hconn, &Hmsg, &DltMsgHOpts, &CompCode, &Reason); + +MQHCONN Hconn; -- Connection handle +MQHMSG Hmsg; -- Message handle +MQDMHO DltMsgHOpts; -- Options that control the action of MQDLTMH +MQLONG CompCode; -- Completion code +MQLONG Reason; -- Reason code qualifying CompCode +*/ + +PHP_FUNCTION(mqseries_dltmh) { + mqseries_descriptor *mqdesc; + mqseries_message *mqhandle; + MQLONG comp_code, reason; + zval *z_mqdesc, + *z_hmsg, + *z_dlt_msg_hopts, + *z_comp_code, + *z_reason; + + MQDMHO dmho = { MQDMHO_DEFAULT }; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rra/z/z/", &z_mqdesc, &z_hmsg, &z_dlt_msg_hopts, &z_comp_code, &z_reason) == FAILURE) { + return; + } + + if ((mqdesc = (mqseries_descriptor *)zend_fetch_resource(Z_RES_P(z_mqdesc), PHP_MQSERIES_DESCRIPTOR_RES_NAME, le_mqseries_conn)) == NULL) { + RETURN_FALSE; + } + if ((mqhandle = (mqseries_message *)zend_fetch_resource(Z_RES_P(z_hmsg), PHP_MQSERIES_MESSAGE_RES_NAME, le_mqseries_message)) == NULL) { + RETURN_FALSE; + } + + _mqseries_set_mqdmho_from_array(z_dlt_msg_hopts, &dmho); + + MQDLTMH(mqdesc->conn, &mqhandle->handle, &dmho, &comp_code, &reason); + + ZVAL_LONG(z_comp_code, (long)comp_code); + ZVAL_LONG(z_reason, (long)reason); + if (comp_code == MQCC_OK) { + zend_list_close(Z_RES_P(z_hmsg)); + } +} + +/* +MQ call: + +MQDLTMP (Hconn, Hmsg, &DltPropOpts, &Name, &CompCode, &Reason) + +MQHCONN Hconn; -- Connection handle +MQHMSG Hmsg; -- Message handle +MQDMPO DltPropOpts; -- Options that control the action of MQDLTMP +MQCHARV Name; -- Property name +MQLONG CompCode; -- Completion code +MQLONG Reason; -- Reason code qualifying CompCode +*/ +PHP_FUNCTION(mqseries_dltmp) { + mqseries_descriptor *mqdesc; + mqseries_message *mqhandle; + char *name = NULL; + size_t name_len = 0; + MQCHARV prop_name = { MQCHARV_DEFAULT }; + MQLONG comp_code, reason; + zval *z_mqdesc, + *z_hmsg, + *z_dlt_prop_opts, + *z_comp_code, + *z_reason; + + MQDMPO dlt_prop_opts = { MQDMPO_DEFAULT}; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rra/s/z/z/", &z_mqdesc, &z_hmsg, &z_dlt_prop_opts, &name, &name_len, &z_comp_code, &z_reason) == FAILURE) { + return; + } + if ((mqdesc = (mqseries_descriptor *)zend_fetch_resource(Z_RES_P(z_mqdesc), PHP_MQSERIES_DESCRIPTOR_RES_NAME, le_mqseries_conn)) == NULL) { + RETURN_FALSE; + } + if ((mqhandle = (mqseries_message *)zend_fetch_resource(Z_RES_P(z_hmsg), PHP_MQSERIES_MESSAGE_RES_NAME, le_mqseries_message)) == NULL) { + RETURN_FALSE; + } + _mqseries_set_mqdmpo_from_array(z_dlt_prop_opts, &dlt_prop_opts); + + prop_name.VSPtr = name; + prop_name.VSLength = name_len; + + + MQDLTMP(mqdesc->conn, mqhandle->handle, &dlt_prop_opts, &prop_name, &comp_code, &reason); + + ZVAL_LONG(z_comp_code, (long)comp_code); + ZVAL_LONG(z_reason, (long)reason); +} + +/* +MQ call: + +MQINQMP (Hconn, Hmsg, &InqPropOpts, &Name, &PropDesc, &Type, ValueLength, Value, &DataLength, &CompCode, &Reason); + +MQHCONN Hconn; -- Connection handle +MQHMSG Hmsg; -- Message handle +MQIMPO InqPropOpts; -- Options that control the action of MQINQMP +MQCHARV Name; -- Property name +MQPD PropDesc; -- Property descriptor +MQLONG Type; -- Property data type +MQLONG ValueLength; -- Length in bytes of the Value area +MQBYTE Value[n]; -- Area to contain the property value +MQLONG DataLength; -- Length of the property value +MQLONG CompCode; -- Completion code +MQLONG Reason; -- Reason code qualifying CompCode +*/ +PHP_FUNCTION(mqseries_inqmp) { + mqseries_descriptor *mqdesc; + mqseries_message *mqhandle; + MQLONG type = 0; + MQLONG comp_code, reason; + zval *z_mqdesc, + *z_hmsg, + *z_inq_prop_opts, + *z_proc_desc, + *z_comp_code, + *z_reason, + *z_data_length, + *z_value, + *z_type, + *z_name; + MQPD pd = { MQPD_DEFAULT }; + MQCHARV prop_name = { MQPROP_INQUIRE_ALL }; + MQLONG data_length = 0, buffer_size = 0; + MQBYTE *data; + //char *name = NULL; + //size_t name_len = 0; + + MQIMPO inq_prop_opts = { MQIMPO_DEFAULT}; + + MQCHARV tmp_name_property = { MQPROP_INQUIRE_ALL }; + + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rraz/a/z/lz/z/z/z/", + &z_mqdesc, + &z_hmsg, + &z_inq_prop_opts, + &z_name, + //&name_len, + &z_proc_desc, + &z_type, + &buffer_size, + &z_value, + &z_data_length, + &z_comp_code, + &z_reason) == FAILURE) { + return; + } + + if ((mqdesc = (mqseries_descriptor *)zend_fetch_resource(Z_RES_P(z_mqdesc), PHP_MQSERIES_DESCRIPTOR_RES_NAME, le_mqseries_conn)) == NULL) { + RETURN_FALSE; + } + if ((mqhandle = (mqseries_message *)zend_fetch_resource(Z_RES_P(z_hmsg), PHP_MQSERIES_MESSAGE_RES_NAME, le_mqseries_message)) == NULL) { + RETURN_FALSE; + } + + _mqseries_set_mqpd_from_array(z_proc_desc, &pd); + _mqseries_set_mqimpo_from_array(z_inq_prop_opts, &inq_prop_opts); + + //if (memcmp(name, "-3", name_len) != 0) { + // prop_name.VSPtr = name; + // prop_name.VSLength = MQVS_NULL_TERMINATED; + //} + //MQPROP_INQUIRE_ALL + if (Z_TYPE_P(z_name) != IS_NULL) { + prop_name.VSPtr = Z_STRVAL_P(z_name); + prop_name.VSLength = Z_STRLEN_P(z_name); //MQVS_NULL_TERMINATED; + } + data = (MQBYTE *)emalloc(sizeof(MQBYTE) * buffer_size); + MQBYTE *tmp_buffer = (MQBYTE *)emalloc(sizeof(MQBYTE) * buffer_size); + memset(tmp_buffer, 0, (sizeof(MQBYTE) * buffer_size)); + //type = z_type->value.lval; + + tmp_name_property.VSPtr = (MQBYTE *)emalloc(sizeof(MQBYTE) * MQ_MAX_PROPERTY_NAME_LENGTH); + tmp_name_property.VSBufSize = MQ_MAX_PROPERTY_NAME_LENGTH; + inq_prop_opts.ReturnedName = tmp_name_property; + + MQINQMP(mqdesc->conn, mqhandle->handle, &inq_prop_opts, &prop_name, &pd, &type, (MQLONG)buffer_size, data, &data_length, &comp_code, &reason); + if (comp_code == MQCC_OK) { + zval_dtor(z_name); + ZVAL_STRINGL(z_name, (char *)inq_prop_opts.ReturnedName.VSPtr, inq_prop_opts.ReturnedName.VSLength); + zval_dtor(z_value); + + MQINT8 value_int8; + MQINT16 value_int16; + MQINT32 value_int32; + MQINT64 value_int64; + + switch (type) { + case MQTYPE_BOOLEAN: /* 4 bytes */ + memcpy(&value_int32, data, data_length); + //sprintf(tmp_buffer, "%d", value_int32); + ZVAL_BOOL(z_value, value_int32); + break; + case MQTYPE_BYTE_STRING: /* zero size allowed */ + case MQTYPE_STRING: /* zero size allowed */ + if (buffer_size > 0) { + memcpy(tmp_buffer, data, MIN(data_length, buffer_size)); + data_length = MIN(data_length, buffer_size); + } + ZVAL_STRINGL(z_value, (char *)tmp_buffer, (buffer_size > 0) ? (buffer_size < (long)data_length ? buffer_size : (long)data_length) : 0); + break; + case MQTYPE_INT8: + if (buffer_size > 0) { + memcpy(&value_int8, data, data_length); + //sprintf(tmp_buffer, "%d", value_int8); + ZVAL_LONG(z_value, value_int8); + } + break; + case MQTYPE_INT16: + if (buffer_size > 0) { + memcpy(&value_int16, data, data_length); + //sprintf(tmp_buffer, "%d", value_int16); + ZVAL_LONG(z_value, value_int16); + } + break; + case MQTYPE_INT32: + if (buffer_size > 0) { + memcpy(&value_int32, data, data_length); + //sprintf(tmp_buffer, "%d", value_int32); + ZVAL_LONG(z_value, value_int32); + } + break; + case MQTYPE_INT64: + if (buffer_size > 0) { + memcpy(&value_int64, data, data_length); + //sprintf(tmp_buffer, "%ld", value_int64); + ZVAL_LONG(z_value, value_int64); + } + break; + case MQTYPE_FLOAT32: { + MQFLOAT32 value_float32; + if (buffer_size > 0) { + memcpy(&value_float32, data, data_length); + sprintf(tmp_buffer, "%g", value_float32); + ZVAL_DOUBLE(z_value, atof(tmp_buffer)); + } + break; + } + case MQTYPE_FLOAT64: { + MQFLOAT64 value_float64; + if (buffer_size > 0) { + memcpy(&value_float64, data, data_length); + sprintf(tmp_buffer, "%g", value_float64); + ZVAL_DOUBLE(z_value, atof(tmp_buffer)); + } + break; + } + case MQTYPE_NULL: /* Must be zero bytes */ + data_length = 0; + break; + default: + break; + } + + // + + ZVAL_LONG(z_data_length, (long)data_length); + ZVAL_LONG(z_type, (long)type); + _mqseries_set_array_from_mqpd(z_proc_desc, &pd); + } + efree(tmp_name_property.VSPtr); + efree(data); + efree(tmp_buffer); + ZVAL_LONG(z_comp_code, (long)comp_code); + ZVAL_LONG(z_reason, (long)reason); +} + +/* +MQ call: + +MQSETMP (Hconn, Hmsg, &SetPropOpts, &Name, &PropDesc, Type, ValueLength, &Value, &CompCode, &Reason); + +MQHCONN Hconn; -- Connection handle +MQHMSG Hmsg; -- Message handle +MQSMPO SetPropOpts; -- Options that control the action of MQSETMP +MQCHARV Name; -- Property name +MQPD PropDesc; -- Property descriptor +MQLONG Type; -- Property data type +MQLONG ValueLength; -- Length of property value in Value +MQBYTE Value[n]; -- Property value +MQLONG CompCode; -- Completion code +MQLONG Reason; -- Reason code qualifying CompCode +*/ + +PHP_FUNCTION(mqseries_setmp) { + mqseries_descriptor *mqdesc; + mqseries_message *mqhandle; + zend_long type = 0; + char *name = NULL; + size_t name_len = 0; + char *value; + zend_long value_len; + + MQLONG comp_code, reason; + zval *z_mqdesc, + *z_hmsg, + *z_set_prop_opts, + *z_proc_desc, + *z_comp_code, + *z_reason; + + MQSMPO msg_po = { MQSMPO_DEFAULT }; + MQSTS status = { MQSTS_DEFAULT }; + MQPD pd = { MQPD_DEFAULT}; + MQCHARV prop_name = { MQCHARV_DEFAULT }; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rra/s/a/ls/z/z/", + &z_mqdesc, + &z_hmsg, + &z_set_prop_opts, + &name, + &name_len, + &z_proc_desc, + &type, + &value, + &value_len, + &z_comp_code, + &z_reason) == FAILURE) { + return; + } + + if ((mqdesc = (mqseries_descriptor *)zend_fetch_resource(Z_RES_P(z_mqdesc), PHP_MQSERIES_DESCRIPTOR_RES_NAME, le_mqseries_conn)) == NULL) { + RETURN_FALSE; + } + + if ((mqhandle = (mqseries_message *)zend_fetch_resource(Z_RES_P(z_hmsg), PHP_MQSERIES_MESSAGE_RES_NAME, le_mqseries_message)) == NULL) { + RETURN_FALSE; + } + + void *value_ptr = NULL; + MQINT8 value_int8; + MQINT16 value_int16; + MQINT32 value_int32; + MQINT64 value_int64; + MQFLOAT32 value_float32; + MQFLOAT64 value_float64; + + /* Convert value, based on declared type*/ + + switch (type) { + case MQTYPE_BOOLEAN: /* 4 bytes */ + if (value[0] == '1') { + value_int32 = 1; + } + else { + value_int32 = 0; + } + value_ptr = &value_int32; + value_len = sizeof(MQINT32); + break; + case MQTYPE_BYTE_STRING: /* zero size allowed */ + case MQTYPE_STRING: /* zero size allowed */ + if (value_len) { + value_ptr = value; + } + else { + value_ptr = NULL; + value_len = 0; + } + break; + case MQTYPE_INT8: + if (!sscanf(value, "%d", &value_int8)) { + RETURN_FALSE; + } + value_ptr = &value_int8; + value_len = sizeof(MQTYPE_INT8); + break; + case MQTYPE_INT16: + if (!sscanf(value, "%d", &value_int16)) { + RETURN_FALSE; + } + value_ptr = &value_int16; + value_len = sizeof(MQTYPE_INT16); + break; + case MQTYPE_INT32: + if (!sscanf(value, "%d", &value_int32)) { + RETURN_FALSE; + } + value_ptr = &value_int32; + value_len = sizeof(MQTYPE_INT32); + break; + case MQTYPE_INT64: + if (!sscanf(value, "%ld", &value_int64)) { + RETURN_FALSE; + } + value_ptr = &value_int64; + value_len = sizeof(MQTYPE_INT64); + break; + case MQTYPE_FLOAT32: + if (!sscanf(value, "%f", &value_float32)) { + RETURN_FALSE; + } + value_ptr = &value_float32; + value_len = sizeof(MQTYPE_FLOAT32); + break; + case MQTYPE_FLOAT64: + if (!sscanf(value, "%lf", &value_float64)) { + RETURN_FALSE; + } + value_ptr = &value_float64; + value_len = sizeof(MQTYPE_FLOAT64); + // break; + case MQTYPE_NULL: /* Must be zero bytes */ + value_len = 0; + break; + default: + break; + } + _mqseries_set_array_from_mqpd(z_proc_desc, &pd); + _mqseries_set_mqsmpo_from_array(z_set_prop_opts, &msg_po); + prop_name.VSPtr = name; + prop_name.VSLength = name_len; + + MQSETMP(mqdesc->conn, mqhandle->handle, &msg_po, &prop_name, &pd, type, (MQLONG)value_len, value_ptr, &comp_code, &reason); + + ZVAL_LONG(z_comp_code, (long)comp_code); + ZVAL_LONG(z_reason, (long)reason); + +} + + +//////////////////////////////////////////////// /* }}} */ #endif /* HAVE_MQSERIESLIB_V7 */ @@ -1435,6 +2133,13 @@ void _mqseries_bytes(zend_resource *rsrc) efree(((mqseries_bytes *)rsrc->ptr)->bytes); efree(rsrc->ptr); } + +void _mqseries_hmsg(zend_resource *rsrc) { + //if (((mqseries_bytes *)rsrc->ptr)->bytes) { + //efree(((mqseries_message *)rsrc->ptr)->handle); + //} + efree(rsrc->ptr); +} /* }}} */ /* diff --git a/mqseries_helper.c b/mqseries_helper.c index e149be5..dada616 100644 --- a/mqseries_helper.c +++ b/mqseries_helper.c @@ -89,6 +89,22 @@ Author: Michael Bretterklieber } \ } while(0) + +#define MQSERIES_SETOPT_RESBYTES_MEMCPY(s,m) \ + do { \ + if ((tmp = zend_hash_str_find(ht, #m, sizeof(#m)-1)) != NULL) { \ + if (Z_TYPE_P(tmp) == IS_RESOURCE) { \ + mqseries_bytes *mqbytes = (mqseries_bytes *) zend_fetch_resource(Z_RES_P(tmp), PHP_MQSERIES_BYTES_RES_NAME, le_mqseries_bytes); \ + if (mqbytes != NULL) { \ + memcpy(s->m, mqbytes->bytes, sizeof(s->m)); \ + } \ + } else if (Z_TYPE_P(tmp) != IS_NULL) { \ + convert_to_string(tmp); \ + memcpy((MQCHAR *) s->m, Z_STRVAL_P(tmp), sizeof(s->m)); \ + } \ + } \ + } while(0) + #define MQSERIES_SETOPT_PTR(s,m) \ do { \ if ((tmp = zend_hash_str_find(ht, #m, sizeof(#m)-1)) != NULL) {\ @@ -118,6 +134,17 @@ Author: Michael Bretterklieber } \ } while(0) +#define MQSERIES_SETOPT_HMSG(s,m) \ + do { \ + if ((tmp = zend_hash_str_find(ht, #m, sizeof(#m)-1)) != NULL && \ + Z_TYPE_P(tmp) == IS_RESOURCE) { \ + mqseries_message *mqhmsg = (mqseries_message *) zend_fetch_resource(Z_RES_P(tmp), PHP_MQSERIES_MESSAGE_RES_NAME, le_mqseries_message); \ + if (mqhmsg != NULL) { \ + s->m = mqhmsg->handle; \ + } \ + } \ + } while(0) + #define MQSERIES_ADD_ASSOC_LONG(s, m) \ add_assoc_long(array, #m, s->m) @@ -164,6 +191,7 @@ static zval* create_mqseries_bytes_resource(PMQBYTE bytes, size_t size) pBytes = (mqseries_bytes *) emalloc(sizeof(mqseries_bytes)); pBytes->bytes = (PMQBYTE) emalloc(size*sizeof(MQBYTE)); + pBytes->size = size; memcpy(pBytes->bytes, bytes, size); ZVAL_RES(z_bytes, zend_register_resource(pBytes, le_mqseries_bytes)); @@ -368,6 +396,14 @@ static void _mqseries_set_channel_definition_from_array(zval *array, PMQCD chann } /* }}} */ +void _mqseries_set_mqcmho_from_array(zval *array, PMQCMHO handle ) { /* {{{ */ + HashTable *ht = Z_ARRVAL_P(array); + zval *tmp; + + MQSERIES_SETOPT_LONG(handle, Options); + MQSERIES_SETOPT_LONG(handle, Version); +} + void _mqseries_set_mqcno_from_array(zval *array, PMQCNO connect_opts, PMQCD channel_definition, PMQSCO ssl_configuration, PMQAIR authentication_information_record, PMQCHAR LDAPUserName) /* {{{ */ { HashTable *ht = Z_ARRVAL_P(array); @@ -390,8 +426,62 @@ void _mqseries_set_mqcno_from_array(zval *array, PMQCNO connect_opts, PMQCD chan } /* }}} */ -void _mqseries_set_mqpmo_from_array(zval *array, PMQPMO put_msg_opts) /* {{{ */ -{ +void _mqseries_set_mqdmpo_from_array(zval *array, PMQDMPO handle) { + HashTable *ht = Z_ARRVAL_P(array); + zval *tmp; + MQSERIES_SETOPT_LONG(handle, Version); + MQSERIES_SETOPT_LONG(handle, Options); +} + +void _mqseries_set_mqdmho_from_array(zval *array, PMQDMHO handle) { + HashTable *ht = Z_ARRVAL_P(array); + zval *tmp; + MQSERIES_SETOPT_LONG(handle, Version); + MQSERIES_SETOPT_LONG(handle, Options); +} + +void _mqseries_set_mqbmho_from_array(zval *array, PMQBMHO handle) { + HashTable *ht = Z_ARRVAL_P(array); + zval *tmp; + MQSERIES_SETOPT_LONG(handle, Version); + MQSERIES_SETOPT_LONG(handle, Options); +} + +void _mqseries_set_mqmhbo_from_array(zval *array, PMQMHBO handle) { + HashTable *ht = Z_ARRVAL_P(array); + zval *tmp; + MQSERIES_SETOPT_LONG(handle, Version); + MQSERIES_SETOPT_LONG(handle, Options); + +} + +void _mqseries_set_mqsmpo_from_array(zval *array, PMQSMPO handle) { + HashTable *ht = Z_ARRVAL_P(array); + zval *tmp; + MQSERIES_SETOPT_LONG(handle, Version); + MQSERIES_SETOPT_LONG(handle, Options); + MQSERIES_SETOPT_LONG(handle, ValueEncoding); + MQSERIES_SETOPT_LONG(handle, ValueCCSID); +} + +void _mqseries_set_mqimpo_from_array(zval *array, PMQIMPO handle) { + HashTable *ht = Z_ARRVAL_P(array); + zval *tmp; + MQSERIES_SETOPT_LONG(handle, Version); + MQSERIES_SETOPT_LONG(handle, Options); + + MQSERIES_SETOPT_LONG(handle, RequestedEncoding); + MQSERIES_SETOPT_LONG(handle, RequestedCCSID); + + MQSERIES_SETOPT_LONG(handle, ReturnedEncoding); + MQSERIES_SETOPT_LONG(handle, ReturnedCCSID); + + MQSERIES_SETOPT_CHAR(handle, Reserved1); + MQSERIES_SETOPT_CHARV(handle, ReturnedName); + MQSERIES_SETOPT_STRING(handle, TypeString); +} + +void _mqseries_set_mqpmo_from_array(zval *array, PMQPMO put_msg_opts) { /* {{{ */ HashTable *ht = Z_ARRVAL_P(array); zval *tmp; @@ -403,8 +493,8 @@ void _mqseries_set_mqpmo_from_array(zval *array, PMQPMO put_msg_opts) /* {{{ */ #ifdef MQPMO_VERSION_3 case MQPMO_VERSION_3: - // MQHMSG OriginalMsgHandle; - // MQHMSG NewMsgHandle; + MQSERIES_SETOPT_HMSG(put_msg_opts, OriginalMsgHandle); + MQSERIES_SETOPT_HMSG(put_msg_opts, NewMsgHandle); MQSERIES_SETOPT_LONG(put_msg_opts, Action); MQSERIES_SETOPT_LONG(put_msg_opts, PubLevel); // no break intentional @@ -447,8 +537,8 @@ void _mqseries_set_array_from_mqpmo(zval *array, PMQPMO put_msg_opts) { /* {{{ * #ifdef MQPMO_VERSION_3 case MQPMO_VERSION_3: - // MQHMSG OriginalMsgHandle; - // MQHMSG NewMsgHandle; + MQSERIES_ADD_ASSOC_LONG(put_msg_opts, OriginalMsgHandle); + MQSERIES_ADD_ASSOC_LONG(put_msg_opts, NewMsgHandle); MQSERIES_ADD_ASSOC_LONG(put_msg_opts, Action); MQSERIES_ADD_ASSOC_LONG(put_msg_opts, PubLevel); // no break intentional @@ -512,8 +602,8 @@ void _mqseries_set_mqmd_from_array(zval *array, PMQMD msg_desc) /* {{{ */ MQSERIES_SETOPT_STRING(msg_desc, Format); MQSERIES_SETOPT_LONG(msg_desc, Priority); MQSERIES_SETOPT_LONG(msg_desc, Persistence); - MQSERIES_SETOPT_RESBYTES(msg_desc, MsgId); - MQSERIES_SETOPT_RESBYTES(msg_desc, CorrelId); + MQSERIES_SETOPT_RESBYTES_MEMCPY(msg_desc, MsgId); + MQSERIES_SETOPT_RESBYTES_MEMCPY(msg_desc, CorrelId); MQSERIES_SETOPT_LONG(msg_desc, BackoutCount); MQSERIES_SETOPT_STRING(msg_desc, ReplyToQ); MQSERIES_SETOPT_STRING(msg_desc, ReplyToQMgr); @@ -690,7 +780,7 @@ void _mqseries_set_mqgmo_from_array(zval *array, PMQGMO get_msg_opts) /* {{{ */ #ifdef MQGMO_VERSION_4 case MQGMO_VERSION_4: - // MQHMSG MsgHandle; + MQSERIES_SETOPT_HMSG(get_msg_opts, MsgHandle); MQSERIES_SETOPT_LONG(get_msg_opts, Reserved2); // no break intentional #endif /* MQGMO_VERSION_4 */ @@ -834,30 +924,70 @@ void _mqseries_set_array_from_mqsd(zval *array, PMQSD sub_desc) /* {{{ */ MQSERIES_UNSUPPRTED_VERSION(MQSD, sub_desc); #ifdef MQSD_VERSION_1 - case MQSD_VERSION_1: - MQSERIES_ADD_ASSOC_LONG(sub_desc, Version); - MQSERIES_ADD_ASSOC_LONG(sub_desc, Options); - MQSERIES_ADD_ASSOC_STRING(sub_desc, ObjectName); - MQSERIES_ADD_ASSOC_STRING(sub_desc, AlternateUserId); - MQSERIES_ADD_ASSOC_RESOURCE(sub_desc, AlternateSecurityId); - MQSERIES_ADD_ASSOC_LONG(sub_desc, SubExpiry); - MQSERIES_ADD_ASSOC_CHARV(sub_desc, ObjectString); - MQSERIES_ADD_ASSOC_CHARV(sub_desc, SubName); - MQSERIES_ADD_ASSOC_CHARV(sub_desc, SubUserData); - MQSERIES_ADD_ASSOC_RESOURCE(sub_desc, SubCorrelId); - MQSERIES_ADD_ASSOC_LONG(sub_desc, PubPriority); - MQSERIES_ADD_ASSOC_RESOURCE(sub_desc, PubAccountingToken); - MQSERIES_ADD_ASSOC_STRING(sub_desc, PubApplIdentityData); - MQSERIES_ADD_ASSOC_CHARV(sub_desc, SelectionString); - MQSERIES_ADD_ASSOC_LONG(sub_desc, SubLevel); - MQSERIES_ADD_ASSOC_CHARV(sub_desc, ResObjectString); + case MQSD_VERSION_1: + MQSERIES_ADD_ASSOC_LONG(sub_desc, Version); + MQSERIES_ADD_ASSOC_LONG(sub_desc, Options); + MQSERIES_ADD_ASSOC_STRING(sub_desc, ObjectName); + MQSERIES_ADD_ASSOC_STRING(sub_desc, AlternateUserId); + MQSERIES_ADD_ASSOC_RESOURCE(sub_desc, AlternateSecurityId); + MQSERIES_ADD_ASSOC_LONG(sub_desc, SubExpiry); + MQSERIES_ADD_ASSOC_CHARV(sub_desc, ObjectString); + MQSERIES_ADD_ASSOC_CHARV(sub_desc, SubName); + MQSERIES_ADD_ASSOC_CHARV(sub_desc, SubUserData); + MQSERIES_ADD_ASSOC_RESOURCE(sub_desc, SubCorrelId); + MQSERIES_ADD_ASSOC_LONG(sub_desc, PubPriority); + MQSERIES_ADD_ASSOC_RESOURCE(sub_desc, PubAccountingToken); + MQSERIES_ADD_ASSOC_STRING(sub_desc, PubApplIdentityData); + MQSERIES_ADD_ASSOC_CHARV(sub_desc, SelectionString); + MQSERIES_ADD_ASSOC_LONG(sub_desc, SubLevel); + MQSERIES_ADD_ASSOC_CHARV(sub_desc, ResObjectString); #endif /* MQSD_VERSION_1 */ } } /* }}} */ -void _mqseries_set_mqsts_from_array(zval *array, PMQSTS status) /* {{{ */ -{ + +void _mqseries_set_array_from_mqpd(zval *array, PMQPD pd ) { + HashTable *ht = Z_ARRVAL_P(array); + zval *tmp; + + switch (pd->Version) { + default: + MQSERIES_UNSUPPRTED_VERSION(MQPD, pd); + +#ifdef MQSD_VERSION_1 + case MQSD_VERSION_1: + MQSERIES_ADD_ASSOC_CHAR(pd, StrucId); + MQSERIES_ADD_ASSOC_LONG(pd, Version); + MQSERIES_ADD_ASSOC_LONG(pd, Options); + MQSERIES_ADD_ASSOC_LONG(pd, Support); + MQSERIES_ADD_ASSOC_LONG(pd, Context); + MQSERIES_ADD_ASSOC_LONG(pd, CopyOptions); +#endif /* MQSD_VERSION_1 */ + } +} + +void _mqseries_set_mqpd_from_array(zval *array, PMQPD pd ) { + HashTable *ht = Z_ARRVAL_P(array); + zval *tmp; + + switch (pd->Version) { + default: + MQSERIES_UNSUPPRTED_VERSION(MQPD, pd); + +#ifdef MQSD_VERSION_1 + case MQSD_VERSION_1: + MQSERIES_SETOPT_LONG(pd, Version); + MQSERIES_SETOPT_LONG(pd, Options); + MQSERIES_SETOPT_LONG(pd, Support); + MQSERIES_SETOPT_LONG(pd, Context); + MQSERIES_SETOPT_LONG(pd, CopyOptions); +#endif /* MQSD_VERSION_1 */ + } +} + + +void _mqseries_set_mqsts_from_array(zval *array, PMQSTS status) { HashTable *ht = Z_ARRVAL_P(array); zval *tmp; diff --git a/mqseries_init_const.h b/mqseries_init_const.h index 5acac13..5e38a2d 100644 --- a/mqseries_init_const.h +++ b/mqseries_init_const.h @@ -1,5 +1,5 @@ -#define REGISTER_MQSERIES_LONG_CONSTANT(n) REGISTER_LONG_CONSTANT("MQSERIES_"#n, n, CONST_PERSISTENT); -#define REGISTER_MQSERIES_STRING_CONSTANT(n) REGISTER_STRING_CONSTANT("MQSERIES_"#n, n, CONST_PERSISTENT); +#define REGISTER_MQSERIES_LONG_CONSTANT(n) REGISTER_LONG_CONSTANT("MQSERIES_"#n, n, CONST_PERSISTENT); +#define REGISTER_MQSERIES_STRING_CONSTANT(n) REGISTER_STRING_CONSTANT("MQSERIES_"#n, n, CONST_PERSISTENT); /* Completion Codes */ REGISTER_MQSERIES_LONG_CONSTANT(MQCC_OK); @@ -1784,9 +1784,9 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQCO_QUIESCE); #endif /* MQCO_QUIESCE*/ - /*********************************************************************/ - /* Values Related to MQGMO Structure */ - /*********************************************************************/ +/*********************************************************************/ +/* Values Related to MQGMO Structure */ +/*********************************************************************/ /* Structure Version Number */ #ifdef MQGMO_VERSION_1 @@ -1909,7 +1909,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQGMO_BROWSE_CO_OP); /* Wait Interval */ REGISTER_MQSERIES_LONG_CONSTANT(MQWI_UNLIMITED); - /* Signal Values */ +/* Signal Values */ #ifdef MQEC_MSG_ARRIVED REGISTER_MQSERIES_LONG_CONSTANT(MQEC_MSG_ARRIVED); #endif /* MQEC_MSG_ARRIVED*/ @@ -1926,7 +1926,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQEC_Q_MGR_QUIESCING); REGISTER_MQSERIES_LONG_CONSTANT(MQEC_CONNECTION_QUIESCING); #endif /* MQEC_CONNECTION_QUIESCING*/ - /* Match Options */ +/* Match Options */ #ifdef MQMO_MATCH_MSG_ID REGISTER_MQSERIES_LONG_CONSTANT(MQMO_MATCH_MSG_ID); #endif /* MQMO_MATCH_MSG_ID*/ @@ -1949,37 +1949,37 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQMO_MATCH_MSG_TOKEN); REGISTER_MQSERIES_LONG_CONSTANT(MQMO_NONE); #endif /* MQMO_NONE*/ - /* Group Status */ +/* Group Status */ // char const //REGISTER_MQSERIES_STRING_CONSTANT(MQGS_NOT_IN_GROUP); //REGISTER_MQSERIES_STRING_CONSTANT(MQGS_MSG_IN_GROUP); //REGISTER_MQSERIES_STRING_CONSTANT(MQGS_LAST_MSG_IN_GROUP); - /* Segment Status */ +/* Segment Status */ //REGISTER_MQSERIES_STRING_CONSTANT(MQSS_NOT_A_SEGMENT); //REGISTER_MQSERIES_STRING_CONSTANT(MQSS_SEGMENT); //REGISTER_MQSERIES_STRING_CONSTANT(MQSS_LAST_SEGMENT); - /* Segmentation */ +/* Segmentation */ //REGISTER_MQSERIES_STRING_CONSTANT(MQSEG_INHIBITED); //REGISTER_MQSERIES_STRING_CONSTANT(MQSEG_ALLOWED); - /* Message Token */ +/* Message Token */ #ifdef MQMTOK_NONE REGISTER_MQSERIES_STRING_CONSTANT(MQMTOK_NONE); #endif /* MQMTOK_NONE */ - /* Returned Length */ +/* Returned Length */ #ifdef MQRL_UNDEFINED REGISTER_MQSERIES_LONG_CONSTANT(MQRL_UNDEFINED); #endif /* MQRL_UNDEFINED */ - /*********************************************************************/ - /* Values Related to MQMD Structure */ - /*********************************************************************/ +/*********************************************************************/ +/* Values Related to MQMD Structure */ +/*********************************************************************/ - /* Structure Version Number */ +/* Structure Version Number */ #ifdef MQMD_VERSION_1 REGISTER_MQSERIES_LONG_CONSTANT(MQMD_VERSION_1); #endif /* MQMD_VERSION_1*/ @@ -1990,7 +1990,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQMD_VERSION_2); REGISTER_MQSERIES_LONG_CONSTANT(MQMD_CURRENT_VERSION); #endif /* MQMD_CURRENT_VERSION*/ - /* Report Options */ +/* Report Options */ #ifdef MQRO_EXCEPTION REGISTER_MQSERIES_LONG_CONSTANT(MQRO_EXCEPTION); #endif /* MQRO_EXCEPTION*/ @@ -2061,7 +2061,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQRO_PASS_DISCARD_AND_EXPIRY); REGISTER_MQSERIES_LONG_CONSTANT(MQRO_NONE); #endif /* MQRO_NONE*/ - /* Report Options Masks */ +/* Report Options Masks */ #ifdef MQRO_REJECT_UNSUP_MASK REGISTER_MQSERIES_LONG_CONSTANT(MQRO_REJECT_UNSUP_MASK); #endif /* MQRO_REJECT_UNSUP_MASK*/ @@ -2109,7 +2109,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQMT_APPL_LAST); REGISTER_MQSERIES_LONG_CONSTANT(MQEI_UNLIMITED); #endif /* MQEI_UNLIMITED*/ - /* Feedback Values */ +/* Feedback Values */ #ifdef MQFB_NONE REGISTER_MQSERIES_LONG_CONSTANT(MQFB_NONE); #endif /* MQFB_NONE*/ @@ -2288,12 +2288,12 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQFB_APPL_FIRST); REGISTER_MQSERIES_LONG_CONSTANT(MQFB_APPL_LAST); #endif /* MQFB_APPL_LAST*/ - /* Encoding */ +/* Encoding */ #ifdef MQENC_NATIVE REGISTER_MQSERIES_LONG_CONSTANT(MQENC_NATIVE); #endif /* MQENC_NATIVE*/ - /* Encoding Masks */ +/* Encoding Masks */ #ifdef MQENC_INTEGER_MASK REGISTER_MQSERIES_LONG_CONSTANT(MQENC_INTEGER_MASK); #endif /* MQENC_INTEGER_MASK*/ @@ -2307,7 +2307,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQENC_FLOAT_MASK); REGISTER_MQSERIES_LONG_CONSTANT(MQENC_RESERVED_MASK); #endif /* MQENC_RESERVED_MASK*/ - /* Encodings for Binary Integers */ +/* Encodings for Binary Integers */ #ifdef MQENC_INTEGER_UNDEFINED REGISTER_MQSERIES_LONG_CONSTANT(MQENC_INTEGER_UNDEFINED); #endif /* MQENC_INTEGER_UNDEFINED*/ @@ -2318,7 +2318,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQENC_INTEGER_NORMAL); REGISTER_MQSERIES_LONG_CONSTANT(MQENC_INTEGER_REVERSED); #endif /* MQENC_INTEGER_REVERSED*/ - /* Encodings for Packed-Decimal Integers */ +/* Encodings for Packed-Decimal Integers */ #ifdef MQENC_DECIMAL_UNDEFINED REGISTER_MQSERIES_LONG_CONSTANT(MQENC_DECIMAL_UNDEFINED); #endif /* MQENC_DECIMAL_UNDEFINED*/ @@ -2329,7 +2329,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQENC_DECIMAL_NORMAL); REGISTER_MQSERIES_LONG_CONSTANT(MQENC_DECIMAL_REVERSED); #endif /* MQENC_DECIMAL_REVERSED*/ - /* Encodings for Floating-Point Numbers */ +/* Encodings for Floating-Point Numbers */ #ifdef MQENC_FLOAT_UNDEFINED REGISTER_MQSERIES_LONG_CONSTANT(MQENC_FLOAT_UNDEFINED); #endif /* MQENC_FLOAT_UNDEFINED*/ @@ -2346,7 +2346,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQENC_FLOAT_S390); REGISTER_MQSERIES_LONG_CONSTANT(MQENC_FLOAT_TNS); #endif /* MQENC_FLOAT_TNS*/ - /* Encodings for Multicast */ +/* Encodings for Multicast */ #ifdef MQENC_NORMAL REGISTER_MQSERIES_LONG_CONSTANT(MQENC_NORMAL); #endif /* MQENC_NORMAL*/ @@ -2363,7 +2363,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQENC_TNS); REGISTER_MQSERIES_LONG_CONSTANT(MQENC_AS_PUBLISHED); #endif /* MQENC_AS_PUBLISHED*/ - /* Coded Character-Set Identifiers */ +/* Coded Character-Set Identifiers */ #ifdef MQCCSI_UNDEFINED REGISTER_MQSERIES_LONG_CONSTANT(MQCCSI_UNDEFINED); #endif /* MQCCSI_UNDEFINED*/ @@ -2386,7 +2386,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQCCSI_APPL); REGISTER_MQSERIES_LONG_CONSTANT(MQCCSI_AS_PUBLISHED); #endif /* MQCCSI_AS_PUBLISHED*/ - /* Formats */ +/* Formats */ #ifdef MQFMT_NONE REGISTER_MQSERIES_STRING_CONSTANT(MQFMT_NONE); #endif /* MQFMT_NONE*/ @@ -2454,7 +2454,7 @@ REGISTER_MQSERIES_STRING_CONSTANT(MQFMT_WORK_INFO_HEADER); REGISTER_MQSERIES_STRING_CONSTANT(MQFMT_XMIT_Q_HEADER); #endif /* MQFMT_XMIT_Q_HEADER*/ - /* Priority */ +/* Priority */ #ifdef MQPRI_PRIORITY_AS_Q_DEF REGISTER_MQSERIES_LONG_CONSTANT(MQPRI_PRIORITY_AS_Q_DEF); #endif /* MQPRI_PRIORITY_AS_Q_DEF*/ @@ -2468,7 +2468,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQPRI_PRIORITY_AS_PUBLISHED); REGISTER_MQSERIES_LONG_CONSTANT(MQPRI_PRIORITY_AS_TOPIC_DEF); #endif /* MQPRI_PRIORITY_AS_TOPIC_DEF*/ - /* Persistence Values */ +/* Persistence Values */ #ifdef MQPER_PERSISTENCE_AS_PARENT REGISTER_MQSERIES_LONG_CONSTANT(MQPER_PERSISTENCE_AS_PARENT); #endif /* MQPER_PERSISTENCE_AS_PARENT*/ @@ -2485,7 +2485,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQPER_PERSISTENCE_AS_Q_DEF); REGISTER_MQSERIES_LONG_CONSTANT(MQPER_PERSISTENCE_AS_TOPIC_DEF); #endif /* MQPER_PERSISTENCE_AS_TOPIC_DEF*/ - /* Put Response Values */ +/* Put Response Values */ #ifdef MQPRT_RESPONSE_AS_PARENT REGISTER_MQSERIES_LONG_CONSTANT(MQPRT_RESPONSE_AS_PARENT); #endif /* MQPRT_RESPONSE_AS_PARENT*/ @@ -2496,12 +2496,12 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQPRT_SYNC_RESPONSE); REGISTER_MQSERIES_LONG_CONSTANT(MQPRT_ASYNC_RESPONSE); #endif /* MQPRT_ASYNC_RESPONSE*/ - /* Message Identifier */ +/* Message Identifier */ #ifdef MQMI_NONE REGISTER_MQSERIES_STRING_CONSTANT(MQMI_NONE); #endif /* MQMI_NONE*/ - /* Correlation Identifier */ +/* Correlation Identifier */ #ifdef MQCI_NONE REGISTER_MQSERIES_STRING_CONSTANT(MQCI_NONE); #endif /* MQCI_NONE*/ @@ -2509,13 +2509,13 @@ REGISTER_MQSERIES_STRING_CONSTANT(MQCI_NONE); REGISTER_MQSERIES_STRING_CONSTANT(MQCI_NEW_SESSION); #endif /* MQCI_NEW_SESSION*/ - /* Accounting Token */ +/* Accounting Token */ #ifdef MQACT_NONE REGISTER_MQSERIES_STRING_CONSTANT(MQACT_NONE); #endif /* MQACT_NONE*/ - /* Accounting Token Type */ -// not supported +/* Accounting Token Type */ +// not supported //REGISTER_MQSERIES_STRING_CONSTANT(MQACTT_UNKNOWN); //REGISTER_MQSERIES_STRING_CONSTANT(MQACTT_CICS_LUOW_ID); //REGISTER_MQSERIES_STRING_CONSTANT(MQACTT_OS2_DEFAULT); @@ -2526,7 +2526,7 @@ REGISTER_MQSERIES_STRING_CONSTANT(MQACT_NONE); //REGISTER_MQSERIES_STRING_CONSTANT(MQACTT_NT_SECURITY_ID); //REGISTER_MQSERIES_STRING_CONSTANT(MQACTT_USER); - /* Put Application Type */ +/* Put Application Type */ #ifdef MQAT_UNKNOWN REGISTER_MQSERIES_LONG_CONSTANT(MQAT_UNKNOWN); #endif /* MQAT_UNKNOWN*/ @@ -2654,12 +2654,12 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQAT_USER_FIRST); REGISTER_MQSERIES_LONG_CONSTANT(MQAT_USER_LAST); #endif /* MQAT_USER_LAST*/ - /* Group Identifier */ +/* Group Identifier */ #ifdef MQGI_NONE REGISTER_MQSERIES_STRING_CONSTANT(MQGI_NONE); #endif /* MQGI_NONE*/ - /* Message Flags */ +/* Message Flags */ #ifdef MQMF_SEGMENTATION_INHIBITED REGISTER_MQSERIES_LONG_CONSTANT(MQMF_SEGMENTATION_INHIBITED); #endif /* MQMF_SEGMENTATION_INHIBITED*/ @@ -2682,7 +2682,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQMF_LAST_SEGMENT); REGISTER_MQSERIES_LONG_CONSTANT(MQMF_NONE); #endif /* MQMF_NONE*/ - /* Message Flags Masks */ +/* Message Flags Masks */ #ifdef MQMF_REJECT_UNSUP_MASK REGISTER_MQSERIES_LONG_CONSTANT(MQMF_REJECT_UNSUP_MASK); #endif /* MQMF_REJECT_UNSUP_MASK*/ @@ -2693,7 +2693,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQMF_ACCEPT_UNSUP_MASK); REGISTER_MQSERIES_LONG_CONSTANT(MQMF_ACCEPT_UNSUP_IF_XMIT_MASK); #endif /* MQMF_ACCEPT_UNSUP_IF_XMIT_MASK*/ - /* Original Length */ +/* Original Length */ #ifdef MQOL_UNDEFINED REGISTER_MQSERIES_LONG_CONSTANT(MQOL_UNDEFINED); #endif /* MQOL_UNDEFINED*/ @@ -2709,7 +2709,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQBO_CURRENT_VERSION); REGISTER_MQSERIES_LONG_CONSTANT(MQBO_NONE); #endif /* MQBO_NONE*/ - /* PMO Structure Identifier */ +/* PMO Structure Identifier */ #ifdef MQPMO_VERSION_1 REGISTER_MQSERIES_LONG_CONSTANT(MQPMO_VERSION_1); #endif /* MQPMO_VERSION_1*/ @@ -2723,7 +2723,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQPMO_VERSION_3); REGISTER_MQSERIES_LONG_CONSTANT(MQPMO_CURRENT_VERSION); #endif /* MQPMO_CURRENT_VERSION*/ - /* Put-Message Options */ +/* Put-Message Options */ #ifdef MQPMO_SYNCPOINT REGISTER_MQSERIES_LONG_CONSTANT(MQPMO_SYNCPOINT); #endif /* MQPMO_SYNCPOINT*/ @@ -3315,7 +3315,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQCA_CLUS_CHL_NAME); REGISTER_MQSERIES_LONG_CONSTANT(MQCA_LAST_USED); #endif /* MQCA_LAST_USED*/ - /* Integer-Attribute Selectors */ +/* Integer-Attribute Selectors */ #ifdef MQIA_ACCOUNTING_CONN_OVERRIDE REGISTER_MQSERIES_LONG_CONSTANT(MQIA_ACCOUNTING_CONN_OVERRIDE); #endif /* MQIA_ACCOUNTING_CONN_OVERRIDE*/ @@ -3986,7 +3986,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQIA_PROT_POLICY_CAPABILITY); REGISTER_MQSERIES_LONG_CONSTANT(MQIA_LAST_USED); #endif /* MQIA_LAST_USED*/ - /* MQOD */ +/* MQOD */ #ifdef MQOD_VERSION_1 REGISTER_MQSERIES_LONG_CONSTANT(MQOD_VERSION_1); #endif /* MQOD_VERSION_1*/ @@ -4003,7 +4003,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQOD_VERSION_4); REGISTER_MQSERIES_LONG_CONSTANT(MQOD_CURRENT_VERSION); #endif /* MQOD_CURRENT_VERSION*/ - /* Subscribe Options */ +/* Subscribe Options */ #ifdef MQSO_NONE REGISTER_MQSERIES_LONG_CONSTANT(MQSO_NONE); #endif /* MQSO_NONE*/ @@ -4074,7 +4074,7 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQSO_NO_READ_AHEAD); REGISTER_MQSERIES_LONG_CONSTANT(MQSO_READ_AHEAD); #endif /* MQSO_READ_AHEAD*/ - /* Stat Options */ +/* Stat Options */ #ifdef MQSTAT_TYPE_ASYNC_ERROR REGISTER_MQSERIES_LONG_CONSTANT(MQSTAT_TYPE_ASYNC_ERROR); #endif /* MQSTAT_TYPE_ASYNC_ERROR*/ @@ -4084,3 +4084,245 @@ REGISTER_MQSERIES_LONG_CONSTANT(MQSTAT_TYPE_RECONNECTION); #ifdef MQSTAT_TYPE_RECONNECTION_ERROR REGISTER_MQSERIES_LONG_CONSTANT(MQSTAT_TYPE_RECONNECTION_ERROR); #endif /* MQSTAT_TYPE_RECONNECTION_ERROR*/ + +// MQCMHO +#ifdef MQCMHO_VERSION_1 +REGISTER_MQSERIES_LONG_CONSTANT(MQCMHO_VERSION_1); +#endif +#ifdef MQCMHO_VALIDATE +REGISTER_MQSERIES_LONG_CONSTANT(MQCMHO_VALIDATE); +#endif +#ifdef MQCMHO_DEFAULT_VALIDATION +REGISTER_MQSERIES_LONG_CONSTANT(MQCMHO_DEFAULT_VALIDATION); +#endif +#ifdef MQCMHO_NO_VALIDATION +REGISTER_MQSERIES_LONG_CONSTANT(MQCMHO_NO_VALIDATION); +#endif +#ifdef MQCMHO_NONE +REGISTER_MQSERIES_LONG_CONSTANT(MQCMHO_NONE); +#endif + + +//MQSMPO +#ifdef MQSMPO_VERSION_1 +REGISTER_MQSERIES_LONG_CONSTANT(MQSMPO_VERSION_1); +#endif +#ifdef MQSMPO_SET_FIRST +REGISTER_MQSERIES_LONG_CONSTANT(MQSMPO_SET_FIRST); +#endif +#ifdef MQSMPO_SET_PROP_UNDER_CURSOR +REGISTER_MQSERIES_LONG_CONSTANT(MQSMPO_SET_PROP_UNDER_CURSOR); +#endif +#ifdef MQSMPO_SET_PROP_AFTER_CURSOR +REGISTER_MQSERIES_LONG_CONSTANT(MQSMPO_SET_PROP_AFTER_CURSOR); +#endif +#ifdef MQSMPO_APPEND_PROPERTY +REGISTER_MQSERIES_LONG_CONSTANT(MQSMPO_APPEND_PROPERTY); +#endif +#ifdef MQSMPO_SET_PROP_BEFORE_CURSOR +REGISTER_MQSERIES_LONG_CONSTANT(MQSMPO_SET_PROP_BEFORE_CURSOR); +#endif +#ifdef MQSMPO_NONE +REGISTER_MQSERIES_LONG_CONSTANT(MQSMPO_NONE); +#endif + +//MQPD + +#ifdef MQPD_VERSION_1 +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_VERSION_1); +#endif + + +/* Property Descriptor Options */ +#ifdef MQPD_NONE +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_NONE); +#endif + +/* Property Support Options */ +#ifdef MQPD_SUPPORT_OPTIONAL +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_SUPPORT_OPTIONAL); +#endif +#ifdef MQPD_SUPPORT_REQUIRED +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_SUPPORT_REQUIRED); +#endif +#ifdef MQPD_SUPPORT_REQUIRED_IF_LOCAL +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_SUPPORT_REQUIRED_IF_LOCAL); +#endif +#ifdef MQPD_REJECT_UNSUP_MASK +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_REJECT_UNSUP_MASK); +#endif +#ifdef MQPD_ACCEPT_UNSUP_IF_XMIT_MASK +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_ACCEPT_UNSUP_IF_XMIT_MASK); +#endif +#ifdef MQPD_ACCEPT_UNSUP_MASK +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_ACCEPT_UNSUP_MASK); +#endif + +/* Property Context */ +#ifdef MQPD_NO_CONTEXT +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_NO_CONTEXT); +#endif +#ifdef MQPD_USER_CONTEXT +REGISTER_MQSERIES_LONG_CONSTANT(MQPD_USER_CONTEXT); +#endif + +/* Property Copy Options */ +#ifdef MQCOPY_NONE +REGISTER_MQSERIES_LONG_CONSTANT(MQCOPY_NONE); +#endif +#ifdef MQCOPY_ALL +REGISTER_MQSERIES_LONG_CONSTANT(MQCOPY_ALL); +#endif +#ifdef MQCOPY_FORWARD +REGISTER_MQSERIES_LONG_CONSTANT(MQCOPY_FORWARD); +#endif +#ifdef MQCOPY_PUBLISH +REGISTER_MQSERIES_LONG_CONSTANT(MQCOPY_PUBLISH); +#endif +#ifdef MQCOPY_REPLY +REGISTER_MQSERIES_LONG_CONSTANT(MQCOPY_REPLY); +#endif +#ifdef MQCOPY_REPORT +REGISTER_MQSERIES_LONG_CONSTANT(MQCOPY_REPORT); +#endif +#ifdef MQCOPY_DEFAULT +REGISTER_MQSERIES_LONG_CONSTANT(MQCOPY_DEFAULT); +#endif + + + + + + +#ifdef MQTYPE_AS_SET +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_AS_SET); +#endif +#ifdef MQTYPE_NULL +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_NULL); +#endif +#ifdef MQTYPE_BOOLEAN +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_BOOLEAN); +#endif +#ifdef MQTYPE_BYTE_STRING +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_BYTE_STRING); +#endif +#ifdef MQTYPE_INT8 +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_INT8); +#endif +#ifdef MQTYPE_INT16 +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_INT16); +#endif +#ifdef MQTYPE_INT32 +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_INT32); +#endif +#ifdef MQTYPE_LONG +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_LONG); +#endif +#ifdef MQTYPE_INT64 +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_INT64); +#endif +#ifdef MQTYPE_FLOAT32 +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_FLOAT32); +#endif +#ifdef MQTYPE_FLOAT64 +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_FLOAT64); +#endif +#ifdef MQTYPE_STRING +REGISTER_MQSERIES_LONG_CONSTANT(MQTYPE_STRING); +#endif + + +// MQDHMO +#ifdef MQDMHO_VERSION_1 +REGISTER_MQSERIES_LONG_CONSTANT(MQDMHO_VERSION_1); +#endif +#ifdef MQDMHO_NONE +REGISTER_MQSERIES_LONG_CONSTANT(MQDMHO_NONE); +#endif + + +//MQDMPO + +#ifdef MQDMPO_VERSION_1 +REGISTER_MQSERIES_LONG_CONSTANT(MQDMPO_VERSION_1); +#endif +#ifdef MQDMPO_DEL_FIRST +REGISTER_MQSERIES_LONG_CONSTANT(MQDMPO_DEL_FIRST); +#endif +#ifdef MQDMPO_DEL_PROP_UNDER_CURSOR +REGISTER_MQSERIES_LONG_CONSTANT(MQDMPO_DEL_PROP_UNDER_CURSOR); +#endif +#ifdef MQDMPO_NONE +REGISTER_MQSERIES_LONG_CONSTANT(MQDMPO_NONE); +#endif + +// MQBMHO +#ifdef MQBMHO_VERSION_1 +REGISTER_MQSERIES_LONG_CONSTANT(MQBMHO_VERSION_1); +#endif +#ifdef MQBMHO_DELETE_PROPERTIES +REGISTER_MQSERIES_LONG_CONSTANT(MQBMHO_DELETE_PROPERTIES); +#endif +#ifdef MQBMHO_NONE +REGISTER_MQSERIES_LONG_CONSTANT(MQBMHO_NONE); +#endif + + +// MQIMPO +#ifdef MQIMPO_VERSION_1 +REGISTER_MQSERIES_LONG_CONSTANT(MQIMPO_VERSION_1); +#endif +#ifdef MQIMPO_CURRENT_VERSION +REGISTER_MQSERIES_LONG_CONSTANT(MQIMPO_CURRENT_VERSION); +#endif +#ifdef MQIMPO_CONVERT_TYPE +REGISTER_MQSERIES_LONG_CONSTANT(MQIMPO_CONVERT_TYPE); +#endif +#ifdef MQIMPO_QUERY_LENGTH +REGISTER_MQSERIES_LONG_CONSTANT(MQIMPO_QUERY_LENGTH); +#endif +#ifdef MQIMPO_INQ_FIRST +REGISTER_MQSERIES_LONG_CONSTANT(MQIMPO_INQ_FIRST); +#endif +#ifdef MQIMPO_INQ_NEXT +REGISTER_MQSERIES_LONG_CONSTANT(MQIMPO_INQ_NEXT); +#endif +#ifdef MQIMPO_INQ_PROP_UNDER_CURSOR +REGISTER_MQSERIES_LONG_CONSTANT(MQIMPO_INQ_PROP_UNDER_CURSOR); +#endif +#ifdef MQIMPO_CONVERT_VALUE +REGISTER_MQSERIES_LONG_CONSTANT(MQIMPO_CONVERT_VALUE); +#endif +#ifdef MQIMPO_NONE +REGISTER_MQSERIES_LONG_CONSTANT(MQIMPO_NONE); +#endif + +//MQMHBO +#ifdef MQMHBO_VERSION_1 +REGISTER_MQSERIES_LONG_CONSTANT(MQMHBO_VERSION_1); +#endif + +#ifdef MQMHBO_PROPERTIES_IN_MQRFH2 +REGISTER_MQSERIES_LONG_CONSTANT(MQMHBO_PROPERTIES_IN_MQRFH2); +#endif +#ifdef MQMHBO_DELETE_PROPERTIES +REGISTER_MQSERIES_LONG_CONSTANT(MQMHBO_DELETE_PROPERTIES); +#endif +#ifdef MQMHBO_NONE +REGISTER_MQSERIES_LONG_CONSTANT(MQMHBO_NONE); +#endif + + + +#ifdef MQACTP_NEW +REGISTER_MQSERIES_LONG_CONSTANT(MQACTP_NEW); +#endif +#ifdef MQACTP_FORWARD +REGISTER_MQSERIES_LONG_CONSTANT(MQACTP_FORWARD); +#endif +#ifdef MQACTP_REPLY +REGISTER_MQSERIES_LONG_CONSTANT(MQACTP_REPLY); +#endif +#ifdef MQACTP_REPORT +REGISTER_MQSERIES_LONG_CONSTANT(MQACTP_REPORT); +#endif diff --git a/php_mqseries.h b/php_mqseries.h index b16b8d1..f1862c4 100644 --- a/php_mqseries.h +++ b/php_mqseries.h @@ -76,13 +76,36 @@ extern int le_mqseries_obj; typedef struct { int id; + int size; PMQBYTE bytes; } mqseries_bytes; extern int le_mqseries_bytes; #define PHP_MQSERIES_BYTES_RES_NAME "mqseries_bytes" + +typedef struct { + int id; + MQHMSG handle; +} mqseries_message; +extern int le_mqseries_message; +#define PHP_MQSERIES_MESSAGE_RES_NAME "mqseries_message" + + /* {{{ Helper */ void _mqseries_set_mqcno_from_array(zval *, PMQCNO, PMQCD, PMQSCO, PMQAIR, PMQCHAR); +void _mqseries_set_mqcmho_from_array(zval *array, PMQCMHO handle); +void _mqseries_set_mqdmpo_from_array(zval *array, PMQDMPO handle); + + +void _mqseries_set_array_from_mqpd(zval *array, PMQPD handle); +void _mqseries_set_mqpd_from_oarray(zval *array, PMQPD handle); + + +void _mqseries_set_mqdmho_from_array(zval *array, PMQDMHO handle); +void _mqseries_set_mqbmho_from_array(zval *array, PMQBMHO handle); +void _mqseries_set_mqmhbo_from_array(zval *array, PMQMHBO handle); +void _mqseries_set_mqsmpo_from_array(zval *array, PMQSMPO handle); +void _mqseries_set_mqimpo_from_array(zval *array, PMQIMPO handle); void _mqseries_set_mqpmo_from_array(zval *, PMQPMO); void _mqseries_set_array_from_mqpmo(zval *, PMQPMO); @@ -101,6 +124,7 @@ void _mqseries_set_mqbo_from_array(zval *, PMQBO); #ifdef HAVE_MQSERIESLIB_V7 void _mqseries_set_mqsd_from_array(zval *, PMQSD); +void _mqseries_set_mqpd_from_array(zval *, PMQPD) void _mqseries_set_array_from_mqsd(zval *, PMQSD); void _mqseries_set_mqsts_from_array(zval *, PMQSTS); @@ -133,16 +157,16 @@ PHP_FUNCTION(mqseries_strerror); PHP_FUNCTION(mqseries_bytes_val); #ifdef HAVE_MQSERIESLIB_V7 -// PHP_FUNCTION(mqseries_bufmh); +PHP_FUNCTION(mqseries_bufmh); // PHP_FUNCTION(mqseries_cb); // PHP_FUNCTION(mqseries_cb_function); -// PHP_FUNCTION(mqseries_crtmh); +PHP_FUNCTION(mqseries_crtmh); // PHP_FUNCTION(mqseries_ctl); -// PHP_FUNCTION(mqseries_dltmh); -// PHP_FUNCTION(mqseries_dltmp); -// PHP_FUNCTION(mqseries_inqmp); -// PHP_FUNCTION(mqseries_mhbuf); -// PHP_FUNCTION(mqseries_setmp); +PHP_FUNCTION(mqseries_dltmh); +PHP_FUNCTION(mqseries_dltmp); +PHP_FUNCTION(mqseries_inqmp); +PHP_FUNCTION(mqseries_mhbuf); +PHP_FUNCTION(mqseries_setmp); PHP_FUNCTION(mqseries_stat); PHP_FUNCTION(mqseries_sub); // PHP_FUNCTION(mqseries_subrq);