diff options
Diffstat (limited to 'ext/mnogosearch/php_mnogo.c')
-rw-r--r-- | ext/mnogosearch/php_mnogo.c | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/ext/mnogosearch/php_mnogo.c b/ext/mnogosearch/php_mnogo.c index 97b2dabeae..24fe5abee0 100644 --- a/ext/mnogosearch/php_mnogo.c +++ b/ext/mnogosearch/php_mnogo.c @@ -72,17 +72,20 @@ static int le_link,le_res; function_entry mnogosearch_functions[] = { PHP_FE(udm_alloc_agent, NULL) PHP_FE(udm_set_agent_param, NULL) + PHP_FE(udm_add_search_limit, NULL) - PHP_FE(udm_free_agent, NULL) - + PHP_FE(udm_clear_search_limits, NULL) + PHP_FE(udm_errno, NULL) PHP_FE(udm_error, NULL) PHP_FE(udm_find, NULL) - PHP_FE(udm_free_res, NULL) - PHP_FE(udm_get_res_field, NULL) PHP_FE(udm_get_res_param, NULL) - + PHP_FE(udm_get_res_field, NULL) + + PHP_FE(udm_free_res, NULL) + PHP_FE(udm_free_agent, NULL) + {NULL, NULL, NULL} }; @@ -435,6 +438,32 @@ DLEXPORT PHP_FUNCTION(udm_add_search_limit) /* }}} */ +/* {{{ proto int udm_clear_search_limits(int agent) + Clear all mnoGoSearch search restrictions */ +DLEXPORT PHP_FUNCTION(udm_clear_search_limits) +{ + pval ** yyagent; + UDM_AGENT * Agent; + switch(ZEND_NUM_ARGS()){ + case 1: { + if (zend_get_parameters_ex(1, &yyagent)==FAILURE) { + RETURN_FALSE; + } + } + break; + default: + WRONG_PARAM_COUNT; + break; + } + ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-Agent", le_link); + + UdmClearLimits(Agent->Conf); + + RETURN_TRUE; +} +/* }}} */ + + /* {{{ proto int udm_find(int agent, string query) Perform search */ DLEXPORT PHP_FUNCTION(udm_find) |