summaryrefslogtreecommitdiff
path: root/ext/pspell
diff options
context:
space:
mode:
authorJeroen van Wolffelaar <jeroen@php.net>2001-09-25 21:58:48 +0000
committerJeroen van Wolffelaar <jeroen@php.net>2001-09-25 21:58:48 +0000
commitc03328857394bef36ffa9678d33079ad96e4a4e4 (patch)
treec0fb250db3b1bb996fc305bf56c2b74eb6d00935 /ext/pspell
parent158d34c9a57816326e141e88e1409d9f377dc2ea (diff)
downloadphp-git-c03328857394bef36ffa9678d33079ad96e4a4e4.tar.gz
Back-substitute for Z_* macro's. If it breaks some extension (the script isn't optimal, it parses for example var->zval.value incorrect) please let me know.
Diffstat (limited to 'ext/pspell')
-rw-r--r--ext/pspell/pspell.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c
index fe1c7028aa..d4131c49e0 100644
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -126,26 +126,26 @@ PHP_FUNCTION(pspell_new)
config = new_pspell_config();
convert_to_string_ex(language);
- pspell_config_replace(config, "language-tag", (*language)->value.str.val);
+ pspell_config_replace(config, "language-tag", Z_STRVAL_PP(language));
if(argc > 1){
convert_to_string_ex(spelling);
- if((*spelling)->value.str.len > 0){
- pspell_config_replace(config, "spelling", (*spelling)->value.str.val);
+ if(Z_STRLEN_PP(spelling) > 0){
+ pspell_config_replace(config, "spelling", Z_STRVAL_PP(spelling));
}
}
if(argc > 2){
convert_to_string_ex(jargon);
- if((*jargon)->value.str.len > 0){
- pspell_config_replace(config, "jargon", (*jargon)->value.str.val);
+ if(Z_STRLEN_PP(jargon) > 0){
+ pspell_config_replace(config, "jargon", Z_STRVAL_PP(jargon));
}
}
if(argc > 3){
convert_to_string_ex(encoding);
- if((*encoding)->value.str.len > 0){
- pspell_config_replace(config, "encoding", (*encoding)->value.str.val);
+ if(Z_STRLEN_PP(encoding) > 0){
+ pspell_config_replace(config, "encoding", Z_STRVAL_PP(encoding));
}
}
@@ -204,30 +204,30 @@ PHP_FUNCTION(pspell_new_personal)
config = new_pspell_config();
convert_to_string_ex(personal);
- pspell_config_replace(config, "personal", (*personal)->value.str.val);
+ pspell_config_replace(config, "personal", Z_STRVAL_PP(personal));
pspell_config_replace(config, "save-repl", "false");
convert_to_string_ex(language);
- pspell_config_replace(config, "language-tag", (*language)->value.str.val);
+ pspell_config_replace(config, "language-tag", Z_STRVAL_PP(language));
if(argc > 2){
convert_to_string_ex(spelling);
- if((*spelling)->value.str.len > 0){
- pspell_config_replace(config, "spelling", (*spelling)->value.str.val);
+ if(Z_STRLEN_PP(spelling) > 0){
+ pspell_config_replace(config, "spelling", Z_STRVAL_PP(spelling));
}
}
if(argc > 3){
convert_to_string_ex(jargon);
- if((*jargon)->value.str.len > 0){
- pspell_config_replace(config, "jargon", (*jargon)->value.str.val);
+ if(Z_STRLEN_PP(jargon) > 0){
+ pspell_config_replace(config, "jargon", Z_STRVAL_PP(jargon));
}
}
if(argc > 4){
convert_to_string_ex(encoding);
- if((*encoding)->value.str.len > 0){
- pspell_config_replace(config, "encoding", (*encoding)->value.str.val);
+ if(Z_STRLEN_PP(encoding) > 0){
+ pspell_config_replace(config, "encoding", Z_STRVAL_PP(encoding));
}
}
@@ -285,7 +285,7 @@ PHP_FUNCTION(pspell_new_config)
}
convert_to_long_ex(conf);
- config = (PspellConfig *) zend_list_find((*conf)->value.lval, &type);
+ config = (PspellConfig *) zend_list_find(Z_LVAL_PP(conf), &type);
ret = new_pspell_manager(config);
if(pspell_error_number(ret) != 0){
@@ -315,13 +315,13 @@ PHP_FUNCTION(pspell_check)
convert_to_long_ex(scin);
convert_to_string_ex(word);
- manager = (PspellManager *) zend_list_find((*scin)->value.lval, &type);
+ manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",(*scin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
- if(pspell_manager_check(manager, (*word)->value.str.val)){
+ if(pspell_manager_check(manager, Z_STRVAL_PP(word))){
RETURN_TRUE;
}else{
RETURN_FALSE;
@@ -347,9 +347,9 @@ PHP_FUNCTION(pspell_suggest)
convert_to_long_ex(scin);
convert_to_string_ex(word);
- manager = (PspellManager *) zend_list_find((*scin)->value.lval, &type);
+ manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",(*scin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@@ -357,7 +357,7 @@ PHP_FUNCTION(pspell_suggest)
RETURN_FALSE;
}
- wl = pspell_manager_suggest(manager, (*word)->value.str.val);
+ wl = pspell_manager_suggest(manager, Z_STRVAL_PP(word));
if(wl){
PspellStringEmulation *els = pspell_word_list_elements(wl);
while((sug = pspell_string_emulation_next(els)) != 0){
@@ -388,13 +388,13 @@ PHP_FUNCTION(pspell_store_replacement)
convert_to_long_ex(scin);
convert_to_string_ex(miss);
convert_to_string_ex(corr);
- manager = (PspellManager *) zend_list_find((*scin)->value.lval, &type);
+ manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",(*scin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
- pspell_manager_store_replacement(manager, (*miss)->value.str.val, (*corr)->value.str.val);
+ pspell_manager_store_replacement(manager, Z_STRVAL_PP(miss), Z_STRVAL_PP(corr));
if(pspell_manager_error_number(manager) == 0){
RETURN_TRUE;
}else{
@@ -420,18 +420,18 @@ PHP_FUNCTION(pspell_add_to_personal)
convert_to_long_ex(scin);
convert_to_string_ex(word);
- manager = (PspellManager *) zend_list_find((*scin)->value.lval, &type);
+ manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",(*scin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
/*If the word is empty, we have to return; otherwise we'll segfault! ouch!*/
- if((*word)->value.str.len == 0){
+ if(Z_STRLEN_PP(word) == 0){
RETURN_FALSE;
}
- pspell_manager_add_to_personal(manager, (*word)->value.str.val);
+ pspell_manager_add_to_personal(manager, Z_STRVAL_PP(word));
if(pspell_manager_error_number(manager) == 0){
RETURN_TRUE;
}else{
@@ -457,18 +457,18 @@ PHP_FUNCTION(pspell_add_to_session)
convert_to_long_ex(scin);
convert_to_string_ex(word);
- manager = (PspellManager *) zend_list_find((*scin)->value.lval, &type);
+ manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",(*scin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
/*If the word is empty, we have to return; otherwise we'll segfault! ouch!*/
- if((*word)->value.str.len == 0){
+ if(Z_STRLEN_PP(word) == 0){
RETURN_FALSE;
}
- pspell_manager_add_to_session(manager, (*word)->value.str.val);
+ pspell_manager_add_to_session(manager, Z_STRVAL_PP(word));
if(pspell_manager_error_number(manager) == 0){
RETURN_TRUE;
}else{
@@ -493,9 +493,9 @@ PHP_FUNCTION(pspell_clear_session)
}
convert_to_long_ex(scin);
- manager = (PspellManager *) zend_list_find((*scin)->value.lval, &type);
+ manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",(*scin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@@ -524,9 +524,9 @@ PHP_FUNCTION(pspell_save_wordlist)
}
convert_to_long_ex(scin);
- manager = (PspellManager *) zend_list_find((*scin)->value.lval, &type);
+ manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
- php_error(E_WARNING, "%d is not an PSPELL result index",(*scin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@@ -559,26 +559,26 @@ PHP_FUNCTION(pspell_config_create)
config = new_pspell_config();
convert_to_string_ex(language);
- pspell_config_replace(config, "language-tag", (*language)->value.str.val);
+ pspell_config_replace(config, "language-tag", Z_STRVAL_PP(language));
if(argc > 1){
convert_to_string_ex(spelling);
- if((*spelling)->value.str.len > 0){
- pspell_config_replace(config, "spelling", (*spelling)->value.str.val);
+ if(Z_STRLEN_PP(spelling) > 0){
+ pspell_config_replace(config, "spelling", Z_STRVAL_PP(spelling));
}
}
if(argc > 2){
convert_to_string_ex(jargon);
- if((*jargon)->value.str.len > 0){
- pspell_config_replace(config, "jargon", (*jargon)->value.str.val);
+ if(Z_STRLEN_PP(jargon) > 0){
+ pspell_config_replace(config, "jargon", Z_STRVAL_PP(jargon));
}
}
if(argc > 3){
convert_to_string_ex(encoding);
- if((*encoding)->value.str.len > 0){
- pspell_config_replace(config, "encoding", (*encoding)->value.str.val);
+ if(Z_STRLEN_PP(encoding) > 0){
+ pspell_config_replace(config, "encoding", Z_STRVAL_PP(encoding));
}
}
@@ -607,14 +607,14 @@ PHP_FUNCTION(pspell_config_runtogether)
}
convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find((*sccin)->value.lval, &type);
+ config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",(*sccin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
convert_to_boolean_ex(runtogether);
- pspell_config_replace(config, "run-together", (*runtogether)->value.lval ? "true" : "false");
+ pspell_config_replace(config, "run-together", Z_LVAL_PP(runtogether) ? "true" : "false");
RETURN_TRUE;
}
@@ -636,20 +636,20 @@ PHP_FUNCTION(pspell_config_mode)
}
convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find((*sccin)->value.lval, &type);
+ config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",(*sccin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
convert_to_long_ex(mode);
/* First check what mode we want (how many suggestions) */
- if((*mode)->value.lval == PSPELL_FAST){
+ if(Z_LVAL_PP(mode) == PSPELL_FAST){
pspell_config_replace(config, "sug-mode", "fast");
- }else if((*mode)->value.lval == PSPELL_NORMAL){
+ }else if(Z_LVAL_PP(mode) == PSPELL_NORMAL){
pspell_config_replace(config, "sug-mode", "normal");
- }else if((*mode)->value.lval == PSPELL_BAD_SPELLERS){
+ }else if(Z_LVAL_PP(mode) == PSPELL_BAD_SPELLERS){
pspell_config_replace(config, "sug-mode", "bad-spellers");
}
@@ -678,9 +678,9 @@ PHP_FUNCTION(pspell_config_ignore)
}
convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find((*sccin)->value.lval, &type);
+ config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",(*sccin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@@ -724,14 +724,14 @@ PHP_FUNCTION(pspell_config_personal)
}
convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find((*sccin)->value.lval, &type);
+ config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",(*sccin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
convert_to_string_ex(personal);
- pspell_config_replace(config, "personal", (*personal)->value.str.val);
+ pspell_config_replace(config, "personal", Z_STRVAL_PP(personal));
RETURN_TRUE;
}
@@ -753,16 +753,16 @@ PHP_FUNCTION(pspell_config_repl)
}
convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find((*sccin)->value.lval, &type);
+ config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",(*sccin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
pspell_config_replace(config, "save-repl", "true");
convert_to_string_ex(repl);
- pspell_config_replace(config, "repl", (*repl)->value.str.val);
+ pspell_config_replace(config, "repl", Z_STRVAL_PP(repl));
RETURN_TRUE;
}
@@ -784,14 +784,14 @@ PHP_FUNCTION(pspell_config_save_repl)
}
convert_to_long_ex(sccin);
- config = (PspellConfig *) zend_list_find((*sccin)->value.lval, &type);
+ config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
- php_error(E_WARNING, "%d is not an PSPELL config index",(*sccin)->value.lval);
+ php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
convert_to_boolean_ex(save);
- pspell_config_replace(config, "save-repl", (*save)->value.lval ? "true" : "false");
+ pspell_config_replace(config, "save-repl", Z_LVAL_PP(save) ? "true" : "false");
RETURN_TRUE;
}