Diff for /embedaddon/php/ext/enchant/enchant.c between versions 1.1.1.1 and 1.1.1.5

version 1.1.1.1, 2012/02/21 23:47:54 version 1.1.1.5, 2014/06/15 20:03:42
Line 2 Line 2
   +----------------------------------------------------------------------+    +----------------------------------------------------------------------+
   | PHP Version 5                                                        |    | PHP Version 5                                                        |
   +----------------------------------------------------------------------+    +----------------------------------------------------------------------+
  | Copyright (c) 1997-2012 The PHP Group                                |  | Copyright (c) 1997-2014 The PHP Group                                |
   +----------------------------------------------------------------------+    +----------------------------------------------------------------------+
   | This source file is subject to version 3.0 of the PHP license,       |    | This source file is subject to version 3.0 of the PHP license,       |
   | that is bundled with this package in the file LICENSE, and is        |    | that is bundled with this package in the file LICENSE, and is        |
Line 23 Line 23
 #include "config.h"  #include "config.h"
 #endif  #endif
   
 #include <enchant.h>  
 #include "php.h"  #include "php.h"
 #include "php_ini.h"  #include "php_ini.h"
 #include "ext/standard/info.h"  #include "ext/standard/info.h"
   #include <enchant.h>
 #include "php_enchant.h"  #include "php_enchant.h"
   
 typedef EnchantBroker * EnchantBrokerPtr;  typedef EnchantBroker * EnchantBrokerPtr;
Line 124  ZEND_END_ARG_INFO() Line 124  ZEND_END_ARG_INFO()
  *   *
  * Every user visible function must have an entry in enchant_functions[].   * Every user visible function must have an entry in enchant_functions[].
  */   */
function_entry enchant_functions[] = {zend_function_entry enchant_functions[] = {
         PHP_FE(enchant_broker_init,                     arginfo_enchant_broker_init)          PHP_FE(enchant_broker_init,                     arginfo_enchant_broker_init)
         PHP_FE(enchant_broker_free,                     arginfo_enchant_broker_free)          PHP_FE(enchant_broker_free,                     arginfo_enchant_broker_free)
         PHP_FE(enchant_broker_get_error,                arginfo_enchant_broker_free)          PHP_FE(enchant_broker_get_error,                arginfo_enchant_broker_free)
Line 244  static void php_enchant_broker_free(zend_rsrc_list_ent Line 244  static void php_enchant_broker_free(zend_rsrc_list_ent
                         if (broker->pbroker) {                          if (broker->pbroker) {
                                 if (broker->dictcnt && broker->dict) {                                  if (broker->dictcnt && broker->dict) {
                                         if (broker->dict) {                                          if (broker->dict) {
                                                int total, tofree;                                                int total;
                                                tofree = total = broker->dictcnt-1;                                                total = broker->dictcnt-1;
                                                 do {                                                  do {
                                                         zend_list_delete(broker->dict[total]->rsrc_id);                                                          zend_list_delete(broker->dict[total]->rsrc_id);
                                                         efree(broker->dict[total]);                                                          efree(broker->dict[total]);
Line 326  PHP_MINFO_FUNCTION(enchant) Line 326  PHP_MINFO_FUNCTION(enchant)
 #elif defined(HAVE_ENCHANT_BROKER_SET_PARAM)  #elif defined(HAVE_ENCHANT_BROKER_SET_PARAM)
         php_info_print_table_row(2, "Libenchant Version", "1.5.0 or later");          php_info_print_table_row(2, "Libenchant Version", "1.5.0 or later");
 #endif  #endif
        php_info_print_table_row(2, "Revision", "$Revision$");        php_info_print_table_row(2, "Revision", "$Id$");
         php_info_print_table_end();          php_info_print_table_end();
   
         php_info_print_table_start();          php_info_print_table_start();
Line 357  PHP_FUNCTION(enchant_broker_init) Line 357  PHP_FUNCTION(enchant_broker_init)
         enchant_broker *broker;          enchant_broker *broker;
         EnchantBroker *pbroker;          EnchantBroker *pbroker;
   
        if (ZEND_NUM_ARGS()) {        if (zend_parse_parameters_none() == FAILURE) {
                ZEND_WRONG_PARAM_COUNT();                return;
         }          }
   
         pbroker = enchant_broker_init();          pbroker = enchant_broker_init();
Line 542  PHP_FUNCTION(enchant_broker_request_dict) Line 542  PHP_FUNCTION(enchant_broker_request_dict)
         }          }
   
         PHP_ENCHANT_GET_BROKER;          PHP_ENCHANT_GET_BROKER;
           
           if (taglen == 0) {
                   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tag cannot be empty");
                   RETURN_FALSE;
           }
   
         d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);          d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
         if (d) {          if (d) {
Line 586  PHP_FUNCTION(enchant_broker_request_pwl_dict) Line 591  PHP_FUNCTION(enchant_broker_request_pwl_dict)
         int pwllen;          int pwllen;
         int pos;          int pos;
   
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &pwl, &pwllen) == FAILURE) {        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &broker, &pwl, &pwllen) == FAILURE) {
                 RETURN_FALSE;                  RETURN_FALSE;
         }          }
   
         if (strlen(pwl) != pwllen) {  
                 RETURN_FALSE;  
         }  
   
 #if PHP_API_VERSION < 20100412  #if PHP_API_VERSION < 20100412
         if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl TSRMLS_CC)) {          if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl TSRMLS_CC)) {
 #else  #else
Line 650  PHP_FUNCTION(enchant_broker_free_dict) Line 651  PHP_FUNCTION(enchant_broker_free_dict)
 /* }}} */  /* }}} */
   
 /* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag)  /* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag)
   Wether a dictionary exists or not. Using non-empty tag */   Whether a dictionary exists or not. Using non-empty tag */
 PHP_FUNCTION(enchant_broker_dict_exists)  PHP_FUNCTION(enchant_broker_dict_exists)
 {  {
         zval *broker;          zval *broker;
Line 673  PHP_FUNCTION(enchant_broker_dict_exists) Line 674  PHP_FUNCTION(enchant_broker_dict_exists)
         described/referred to by 'tag'. The ordering is a comma delimited          described/referred to by 'tag'. The ordering is a comma delimited
         list of provider names. As a special exception, the "*" tag can          list of provider names. As a special exception, the "*" tag can
         be used as a language tag to declare a default ordering for any          be used as a language tag to declare a default ordering for any
        language that does not explictly declare an ordering. */        language that does not explicitly declare an ordering. */
   
 PHP_FUNCTION(enchant_broker_set_ordering)  PHP_FUNCTION(enchant_broker_set_ordering)
 {  {
Line 729  PHP_FUNCTION(enchant_dict_quick_check) Line 730  PHP_FUNCTION(enchant_dict_quick_check)
   
         if (sugg) {          if (sugg) {
                 zval_dtor(sugg);                  zval_dtor(sugg);
                   array_init(sugg);
         }          }
   
         PHP_ENCHANT_GET_DICT;          PHP_ENCHANT_GET_DICT;
Line 741  PHP_FUNCTION(enchant_dict_quick_check) Line 743  PHP_FUNCTION(enchant_dict_quick_check)
                 if (!sugg && ZEND_NUM_ARGS() == 2) {                  if (!sugg && ZEND_NUM_ARGS() == 2) {
                         RETURN_FALSE;                          RETURN_FALSE;
                 }                  }
   
                 array_init(sugg);  
   
                 suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st);                  suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st);
                 memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg));                  memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg));

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>