PHP_FE(enchant_broker_init, NULL)
PHP_FE(enchant_broker_free, NULL)
PHP_FE(enchant_broker_get_error, NULL)
+ PHP_FE(enchant_broker_list_dicts, NULL)
PHP_FE(enchant_broker_request_dict, NULL)
PHP_FE(enchant_broker_request_pwl_dict, NULL)
PHP_FE(enchant_broker_free_dict, NULL)
}
/* }}} */
+static void php_enchant_list_dicts_fn( const char * const lang_tag,
+ const char * const provider_name, const char * const provider_desc,
+ const char * const provider_file, void * ud) /* {{{ */
+{
+ zval *zdesc = (zval *) ud;
+ zval *tmp_array;
+
+ MAKE_STD_ZVAL(tmp_array);
+ array_init(tmp_array);
+ add_assoc_string(tmp_array, "lang_tag", (char *)lang_tag, 1);
+ add_assoc_string(tmp_array, "provider_name", (char *)provider_name, 1);
+ add_assoc_string(tmp_array, "provider_desc", (char *)provider_desc, 1);
+ add_assoc_string(tmp_array, "provider_file", (char *)provider_file, 1);
+
+ if (Z_TYPE_P(zdesc) != IS_ARRAY) {
+ array_init(zdesc);
+ }
+ add_next_index_zval(zdesc, tmp_array);
+
+}
+/* }}} */
+
static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */
{
if (rsrc->ptr) {
}
/* }}} */
+/* {{{ proto string enchant_broker_list_dicts(resource broker)
+ Returns the last error of the broker */
+PHP_FUNCTION(enchant_broker_list_dicts)
+{
+ zval *broker;
+ enchant_broker *pbroker;
+ EnchantDictDescribeFn describetozval = php_enchant_list_dicts_fn;
+
+ char *msg;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ PHP_ENCHANT_GET_BROKER;
+
+ enchant_broker_list_dicts(pbroker->pbroker, php_enchant_list_dicts_fn, (void *)return_value);
+}
+/* }}} */
+
/* {{{ proto resource enchant_broker_request_dict(resource broker, string tag)
create a new dictionary using tag, the non-empty language tag you wish to request
a dictionary for ("en_US", "de_DE", ...) */
- aspell/pspell (intended to replace ispell)
- hspell (hebrew)
- ispell
-- myspell (OpenOffice project, mozilla)
+- myspell/hunspell (OpenOffice project, mozilla)
- uspell (primarily Yiddish, Hebrew, and Eastern European languages)
A plugin system allows to add custom spell support.
see www.abisource.com/enchant/
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
- <notes>- fix compilation warnings
+ <notes>- add enchant_broker_list_dicts to get a list of available dictionnaries
+- fix compilation warnings
- add examples
- add tests</notes>
<contents>