Skip to content

Commit a77c0a1

Browse files
author
Brad House
committed
more syncing with libmcve-3.0
1 parent 885d807 commit a77c0a1

File tree

2 files changed

+95
-1
lines changed

2 files changed

+95
-1
lines changed

ext/mcve/mcve.c

+90
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function_entry php_mcve_functions[] = {
4848
PHP_FE(mcve_setip, NULL)
4949
PHP_FE(mcve_setssl, NULL)
5050
PHP_FE(mcve_settimeout, NULL)
51+
PHP_FE(mcve_setblocking, NULL)
5152
PHP_FE(mcve_verifyconnection, NULL)
5253
PHP_FE(mcve_verifysslcert, NULL)
5354
PHP_FE(mcve_maxconntimeout, NULL)
@@ -97,6 +98,10 @@ function_entry php_mcve_functions[] = {
9798
PHP_FE(mcve_ub, NULL)
9899
PHP_FE(mcve_chkpwd, NULL)
99100
PHP_FE(mcve_bt, NULL)
101+
PHP_FE(mcve_uwait, NULL)
102+
PHP_FE(mcve_text_code, NULL)
103+
PHP_FE(mcve_text_avs, NULL)
104+
PHP_FE(mcve_text_cv, NULL)
100105
/* Administrator Functions */
101106
PHP_FE(mcve_chngpwd, NULL)
102107
PHP_FE(mcve_listusers, NULL)
@@ -2077,6 +2082,91 @@ PHP_FUNCTION(mcve_edituser)
20772082
}
20782083
/* }}} */
20792084

2085+
2086+
/* {{{ proto int mcve_uwait(long microsecs)
2087+
Wait x microsecs */
2088+
PHP_FUNCTION(mcve_uwait)
2089+
{
2090+
long retval;
2091+
zval **arg;
2092+
2093+
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
2094+
WRONG_PARAM_COUNT;
2095+
2096+
convert_to_long_ex(arg);
2097+
2098+
retval = MCVE_uwait(Z_LVAL_PP(arg));
2099+
2100+
RETURN_LONG(retval);
2101+
}
2102+
/* }}} */
2103+
2104+
/* {{{ proto string mcve_text_code(string code)
2105+
Get a textual representation of the return_code */
2106+
PHP_FUNCTION(mcve_text_code)
2107+
{
2108+
char *retval;
2109+
zval **arg;
2110+
2111+
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
2112+
WRONG_PARAM_COUNT;
2113+
2114+
convert_to_long_ex(arg);
2115+
2116+
retval = MCVE_TEXT_AVS(Z_LVAL_PP(arg));
2117+
2118+
if (retval == NULL) {
2119+
RETVAL_STRING("",1);
2120+
} else {
2121+
RETVAL_STRING(retval, 1);
2122+
}
2123+
}
2124+
/* }}} */
2125+
2126+
/* {{{ proto string mcve_text_avs(string code)
2127+
Get a textual representation of the return_avs */
2128+
PHP_FUNCTION(mcve_text_avs)
2129+
{
2130+
char *retval;
2131+
zval **arg;
2132+
2133+
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
2134+
WRONG_PARAM_COUNT;
2135+
2136+
convert_to_long_ex(arg);
2137+
2138+
retval = MCVE_TEXT_AVS(Z_LVAL_PP(arg));
2139+
2140+
if (retval == NULL) {
2141+
RETVAL_STRING("",1);
2142+
} else {
2143+
RETVAL_STRING(retval, 1);
2144+
}
2145+
}
2146+
/* }}} */
2147+
2148+
/* {{{ proto string mcve_text_cv(int code)
2149+
Get a textual representation of the return_cv */
2150+
PHP_FUNCTION(mcve_text_cv)
2151+
{
2152+
char *retval;
2153+
zval **arg;
2154+
2155+
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
2156+
WRONG_PARAM_COUNT;
2157+
2158+
convert_to_long_ex(arg);
2159+
2160+
retval = MCVE_TEXT_CV(Z_LVAL_PP(arg));
2161+
2162+
if (retval == NULL) {
2163+
RETVAL_STRING("",1);
2164+
} else {
2165+
RETVAL_STRING(retval, 1);
2166+
}
2167+
}
2168+
/* }}} */
2169+
20802170
/* END OF MCVE PHP EXTENSION */
20812171

20822172
/*

ext/mcve/php_mcve.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ PHP_FUNCTION(mcve_destroyconn);
3131
PHP_FUNCTION(mcve_setdropfile);
3232
PHP_FUNCTION(mcve_setip);
3333
PHP_FUNCTION(mcve_setssl);
34+
PHP_FUNCTION(mcve_setblocking);
3435
PHP_FUNCTION(mcve_settimeout);
3536
PHP_FUNCTION(mcve_verifyconnection);
3637
PHP_FUNCTION(mcve_verifysslcert);
@@ -81,7 +82,10 @@ PHP_FUNCTION(mcve_ub);
8182
PHP_FUNCTION(mcve_gl);
8283
PHP_FUNCTION(mcve_chkpwd);
8384
PHP_FUNCTION(mcve_bt);
84-
85+
PHP_FUNCTION(mcve_uwait);
86+
PHP_FUNCTION(mcve_text_code);
87+
PHP_FUNCTION(mcve_text_avs);
88+
PHP_FUNCTION(mcve_text_cv);
8589
PHP_FUNCTION(mcve_chngpwd);
8690
PHP_FUNCTION(mcve_listusers);
8791
PHP_FUNCTION(mcve_adduser);

0 commit comments

Comments
 (0)