Skip to content

Commit

Permalink
Add SSL-related constants
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdm committed Dec 5, 2013
1 parent db18dba commit d3f7a17
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions mosquitto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,15 +1163,18 @@ PHP_MINIT_FUNCTION(mosquitto)
mosquitto_ce_exception = zend_register_internal_class_ex(&exception_ce,
zend_exception_get_default(TSRMLS_C), "Exception" TSRMLS_CC);

#define REGISTER_MOSQUITTO_LOG_LONG_CONST(const_name, value) \
#define REGISTER_MOSQUITTO_LONG_CONST(const_name, value) \
zend_declare_class_constant_long(mosquitto_ce_client, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); \
REGISTER_LONG_CONSTANT(#value, value, CONST_CS | CONST_PERSISTENT);

REGISTER_MOSQUITTO_LOG_LONG_CONST("LOG_INFO", MOSQ_LOG_INFO);
REGISTER_MOSQUITTO_LOG_LONG_CONST("LOG_NOTICE", MOSQ_LOG_NOTICE);
REGISTER_MOSQUITTO_LOG_LONG_CONST("LOG_WARNING", MOSQ_LOG_WARNING);
REGISTER_MOSQUITTO_LOG_LONG_CONST("LOG_ERR", MOSQ_LOG_ERR);
REGISTER_MOSQUITTO_LOG_LONG_CONST("LOG_DEBUG", MOSQ_LOG_DEBUG);
REGISTER_MOSQUITTO_LONG_CONST("LOG_INFO", MOSQ_LOG_INFO);
REGISTER_MOSQUITTO_LONG_CONST("LOG_NOTICE", MOSQ_LOG_NOTICE);
REGISTER_MOSQUITTO_LONG_CONST("LOG_WARNING", MOSQ_LOG_WARNING);
REGISTER_MOSQUITTO_LONG_CONST("LOG_ERR", MOSQ_LOG_ERR);
REGISTER_MOSQUITTO_LONG_CONST("LOG_DEBUG", MOSQ_LOG_DEBUG);

REGISTER_MOSQUITTO_LONG_CONST("SSL_VERIFY_NONE", 0);
REGISTER_MOSQUITTO_LONG_CONST("SSL_VERIFY_PEER", 1);

mosquitto_lib_init();

Expand Down

0 comments on commit d3f7a17

Please sign in to comment.