summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-06-30 13:59:27 +0300
committerDmitry Stogov <dmitry@zend.com>2015-06-30 13:59:27 +0300
commit7aa7627172c11979ec45c2db85f99182812ee59d (patch)
tree90762a1d26b47213a9edd7016a9c45110156e24e /ext
parentd554d64f649a915b4ecb3a1de409cfc8ff0e9133 (diff)
downloadphp-git-7aa7627172c11979ec45c2db85f99182812ee59d.tar.gz
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
Diffstat (limited to 'ext')
-rw-r--r--ext/dba/dba.c14
-rw-r--r--ext/imap/php_imap.c142
-rw-r--r--ext/interbase/ibase_events.c2
-rw-r--r--ext/ldap/ldap.c16
-rw-r--r--ext/mysqli/mysqli_api.c10
-rw-r--r--ext/odbc/php_odbc.c28
-rw-r--r--ext/pdo_firebird/firebird_statement.c12
7 files changed, 112 insertions, 112 deletions
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index eb9edbb741..5b73c7d3fb 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -480,15 +480,15 @@ ZEND_INI_MH(OnUpdateDefaultHandler)
{
dba_handler *hptr;
- if (!new_value->len) {
+ if (!ZSTR_LEN(new_value)) {
DBA_G(default_hptr) = NULL;
return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
- for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value->val); hptr++);
+ for (hptr = handler; hptr->name && strcasecmp(hptr->name, ZSTR_VAL(new_value)); hptr++);
if (!hptr->name) {
- php_error_docref(NULL, E_WARNING, "No such handler: %s", new_value->val);
+ php_error_docref(NULL, E_WARNING, "No such handler: %s", ZSTR_VAL(new_value));
return FAILURE;
}
DBA_G(default_hptr) = hptr;
@@ -547,7 +547,7 @@ PHP_MINFO_FUNCTION(dba)
php_info_print_table_row(2, "DBA support", "enabled");
if (handlers.s) {
smart_str_0(&handlers);
- php_info_print_table_row(2, "Supported handlers", handlers.s->val);
+ php_info_print_table_row(2, "Supported handlers", ZSTR_VAL(handlers.s));
smart_str_free(&handlers);
} else {
php_info_print_table_row(2, "Supported handlers", "none");
@@ -862,7 +862,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
lock_file_mode = "a+b";
} else {
if (opened_path) {
- info->lock.name = pestrndup(opened_path->val, opened_path->len, persistent);
+ info->lock.name = pestrndup(ZSTR_VAL(opened_path), ZSTR_LEN(opened_path), persistent);
zend_string_release(opened_path);
}
}
@@ -873,10 +873,10 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (lock_dbf) {
/* replace the path info with the real path of the opened file */
pefree(info->path, persistent);
- info->path = pestrndup(opened_path->val, opened_path->len, persistent);
+ info->path = pestrndup(ZSTR_VAL(opened_path), ZSTR_LEN(opened_path), persistent);
}
/* now store the name of the lock */
- info->lock.name = pestrndup(opened_path->val, opened_path->len, persistent);
+ info->lock.name = pestrndup(ZSTR_VAL(opened_path), ZSTR_LEN(opened_path), persistent);
zend_string_release(opened_path);
}
}
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 55b1bac904..841143f5b3 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -1215,12 +1215,12 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
/* local filename, need to perform open_basedir check */
- if (mailbox->val[0] != '{' && php_check_open_basedir(mailbox->val)) {
+ if (ZSTR_VAL(mailbox)[0] != '{' && php_check_open_basedir(ZSTR_VAL(mailbox))) {
RETURN_FALSE;
}
- IMAPG(imap_user) = estrndup(user->val, user->len);
- IMAPG(imap_password) = estrndup(passwd->val, passwd->len);
+ IMAPG(imap_user) = estrndup(ZSTR_VAL(user), ZSTR_LEN(user));
+ IMAPG(imap_password) = estrndup(ZSTR_VAL(passwd), ZSTR_LEN(passwd));
#ifdef SET_MAXLOGINTRIALS
if (argc >= 5) {
@@ -1232,10 +1232,10 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
#endif
- imap_stream = mail_open(NIL, mailbox->val, flags);
+ imap_stream = mail_open(NIL, ZSTR_VAL(mailbox), flags);
if (imap_stream == NIL) {
- php_error_docref(NULL, E_WARNING, "Couldn't open stream %s", mailbox->val);
+ php_error_docref(NULL, E_WARNING, "Couldn't open stream %s", ZSTR_VAL(mailbox));
efree(IMAPG(imap_user)); IMAPG(imap_user) = 0;
efree(IMAPG(imap_password)); IMAPG(imap_password) = 0;
RETURN_FALSE;
@@ -1290,11 +1290,11 @@ PHP_FUNCTION(imap_reopen)
}
#endif
/* local filename, need to perform open_basedir check */
- if (mailbox->val[0] != '{' && php_check_open_basedir(mailbox->val)) {
+ if (ZSTR_VAL(mailbox)[0] != '{' && php_check_open_basedir(ZSTR_VAL(mailbox))) {
RETURN_FALSE;
}
- imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, mailbox->val, flags);
+ imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, ZSTR_VAL(mailbox), flags);
if (imap_le_struct->imap_stream == NIL) {
zend_list_delete(Z_RES_P(streamind));
php_error_docref(NULL, E_WARNING, "Couldn't re-open stream");
@@ -1333,7 +1333,7 @@ PHP_FUNCTION(imap_append)
}
zend_string_free(regex);
- php_pcre_match_impl(pce, internal_date->val, internal_date->len, return_value, subpats, global,
+ php_pcre_match_impl(pce, ZSTR_VAL(internal_date), ZSTR_LEN(internal_date), return_value, subpats, global,
0, regex_flags, start_offset);
if (!Z_LVAL_P(return_value)) {
@@ -1347,9 +1347,9 @@ PHP_FUNCTION(imap_append)
RETURN_FALSE;
}
- INIT (&st, mail_string, (void *) message->val, message->len);
+ INIT (&st, mail_string, (void *) ZSTR_VAL(message), ZSTR_LEN(message));
- if (mail_append_full(imap_le_struct->imap_stream, folder->val, (flags ? flags->val : NIL), (internal_date ? internal_date->val : NIL), &st)) {
+ if (mail_append_full(imap_le_struct->imap_stream, ZSTR_VAL(folder), (flags ? ZSTR_VAL(flags) : NIL), (internal_date ? ZSTR_VAL(internal_date) : NIL), &st)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1436,7 +1436,7 @@ PHP_FUNCTION(imap_get_quota)
/* set the callback for the GET_QUOTA function */
mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
- if (!imap_getquota(imap_le_struct->imap_stream, qroot->val)) {
+ if (!imap_getquota(imap_le_struct->imap_stream, ZSTR_VAL(qroot))) {
php_error_docref(NULL, E_WARNING, "c-client imap_getquota failed");
zval_dtor(return_value);
RETURN_FALSE;
@@ -1465,7 +1465,7 @@ PHP_FUNCTION(imap_get_quotaroot)
/* set the callback for the GET_QUOTAROOT function */
mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
- if (!imap_getquotaroot(imap_le_struct->imap_stream, mbox->val)) {
+ if (!imap_getquotaroot(imap_le_struct->imap_stream, ZSTR_VAL(mbox))) {
php_error_docref(NULL, E_WARNING, "c-client imap_getquotaroot failed");
zval_dtor(return_value);
RETURN_FALSE;
@@ -1495,7 +1495,7 @@ PHP_FUNCTION(imap_set_quota)
limits.text.size = mailbox_size;
limits.next = NIL;
- RETURN_BOOL(imap_setquota(imap_le_struct->imap_stream, qroot->val, &limits));
+ RETURN_BOOL(imap_setquota(imap_le_struct->imap_stream, ZSTR_VAL(qroot), &limits));
}
/* }}} */
@@ -1515,7 +1515,7 @@ PHP_FUNCTION(imap_setacl)
RETURN_FALSE;
}
- RETURN_BOOL(imap_setacl(imap_le_struct->imap_stream, mailbox->val, id->val, rights->val));
+ RETURN_BOOL(imap_setacl(imap_le_struct->imap_stream, ZSTR_VAL(mailbox), ZSTR_VAL(id), ZSTR_VAL(rights)));
}
/* }}} */
@@ -1542,7 +1542,7 @@ PHP_FUNCTION(imap_getacl)
/* set the callback for the GET_ACL function */
mail_parameters(NIL, SET_ACL, (void *) mail_getacl);
- if (!imap_getacl(imap_le_struct->imap_stream, mailbox->val)) {
+ if (!imap_getacl(imap_le_struct->imap_stream, ZSTR_VAL(mailbox))) {
php_error(E_WARNING, "c-client imap_getacl failed");
zval_dtor(return_value);
RETURN_FALSE;
@@ -1757,7 +1757,7 @@ PHP_FUNCTION(imap_mail_copy)
RETURN_FALSE;
}
- if (mail_copy_full(imap_le_struct->imap_stream, seq->val, folder->val, (argc == 4 ? options : NIL)) == T) {
+ if (mail_copy_full(imap_le_struct->imap_stream, ZSTR_VAL(seq), ZSTR_VAL(folder), (argc == 4 ? options : NIL)) == T) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1783,7 +1783,7 @@ PHP_FUNCTION(imap_mail_move)
RETURN_FALSE;
}
- if (mail_copy_full(imap_le_struct->imap_stream, seq->val, folder->val, (argc == 4 ? (options | CP_MOVE) : CP_MOVE)) == T) {
+ if (mail_copy_full(imap_le_struct->imap_stream, ZSTR_VAL(seq), ZSTR_VAL(folder), (argc == 4 ? (options | CP_MOVE) : CP_MOVE)) == T) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1807,7 +1807,7 @@ PHP_FUNCTION(imap_createmailbox)
RETURN_FALSE;
}
- if (mail_create(imap_le_struct->imap_stream, folder->val) == T) {
+ if (mail_create(imap_le_struct->imap_stream, ZSTR_VAL(folder)) == T) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1831,7 +1831,7 @@ PHP_FUNCTION(imap_renamemailbox)
RETURN_FALSE;
}
- if (mail_rename(imap_le_struct->imap_stream, old_mailbox->val, new_mailbox->val) == T) {
+ if (mail_rename(imap_le_struct->imap_stream, ZSTR_VAL(old_mailbox), ZSTR_VAL(new_mailbox)) == T) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1855,7 +1855,7 @@ PHP_FUNCTION(imap_deletemailbox)
RETURN_FALSE;
}
- if (mail_delete(imap_le_struct->imap_stream, folder->val) == T) {
+ if (mail_delete(imap_le_struct->imap_stream, ZSTR_VAL(folder)) == T) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1884,7 +1884,7 @@ PHP_FUNCTION(imap_list)
IMAPG(folderlist_style) = FLIST_ARRAY;
IMAPG(imap_folders) = IMAPG(imap_folders_tail) = NIL;
- mail_list(imap_le_struct->imap_stream, ref->val, pat->val);
+ mail_list(imap_le_struct->imap_stream, ZSTR_VAL(ref), ZSTR_VAL(pat));
if (IMAPG(imap_folders) == NIL) {
RETURN_FALSE;
}
@@ -1924,7 +1924,7 @@ PHP_FUNCTION(imap_list_full)
IMAPG(folderlist_style) = FLIST_OBJECT;
IMAPG(imap_folder_objects) = IMAPG(imap_folder_objects_tail) = NIL;
- mail_list(imap_le_struct->imap_stream, ref->val, pat->val);
+ mail_list(imap_le_struct->imap_stream, ZSTR_VAL(ref), ZSTR_VAL(pat));
if (IMAPG(imap_folder_objects) == NIL) {
RETURN_FALSE;
}
@@ -1970,7 +1970,7 @@ PHP_FUNCTION(imap_listscan)
}
IMAPG(imap_folders) = NIL;
- mail_scan(imap_le_struct->imap_stream, ref->val, pat->val, content->val);
+ mail_scan(imap_le_struct->imap_stream, ZSTR_VAL(ref), ZSTR_VAL(pat), ZSTR_VAL(content));
if (IMAPG(imap_folders) == NIL) {
RETURN_FALSE;
}
@@ -2167,9 +2167,9 @@ PHP_FUNCTION(imap_rfc822_parse_headers)
}
if (argc == 2) {
- rfc822_parse_msg(&en, NULL, headers->val, headers->len, NULL, defaulthost->val, NIL);
+ rfc822_parse_msg(&en, NULL, ZSTR_VAL(headers), ZSTR_LEN(headers), NULL, ZSTR_VAL(defaulthost), NIL);
} else {
- rfc822_parse_msg(&en, NULL, headers->val, headers->len, NULL, "UNKNOWN", NIL);
+ rfc822_parse_msg(&en, NULL, ZSTR_VAL(headers), ZSTR_LEN(headers), NULL, "UNKNOWN", NIL);
}
/* call a function to parse all the text, so that we can use the
@@ -2201,7 +2201,7 @@ PHP_FUNCTION(imap_lsub)
IMAPG(folderlist_style) = FLIST_ARRAY;
IMAPG(imap_sfolders) = NIL;
- mail_lsub(imap_le_struct->imap_stream, ref->val, pat->val);
+ mail_lsub(imap_le_struct->imap_stream, ZSTR_VAL(ref), ZSTR_VAL(pat));
if (IMAPG(imap_sfolders) == NIL) {
RETURN_FALSE;
}
@@ -2240,7 +2240,7 @@ PHP_FUNCTION(imap_lsub_full)
IMAPG(folderlist_style) = FLIST_OBJECT;
IMAPG(imap_sfolder_objects) = IMAPG(imap_sfolder_objects_tail) = NIL;
- mail_lsub(imap_le_struct->imap_stream, ref->val, pat->val);
+ mail_lsub(imap_le_struct->imap_stream, ZSTR_VAL(ref), ZSTR_VAL(pat));
if (IMAPG(imap_sfolder_objects) == NIL) {
RETURN_FALSE;
}
@@ -2284,7 +2284,7 @@ PHP_FUNCTION(imap_subscribe)
RETURN_FALSE;
}
- if (mail_subscribe(imap_le_struct->imap_stream, folder->val) == T) {
+ if (mail_subscribe(imap_le_struct->imap_stream, ZSTR_VAL(folder)) == T) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -2308,7 +2308,7 @@ PHP_FUNCTION(imap_unsubscribe)
RETURN_FALSE;
}
- if (mail_unsubscribe(imap_le_struct->imap_stream, folder->val) == T) {
+ if (mail_unsubscribe(imap_le_struct->imap_stream, ZSTR_VAL(folder)) == T) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -2396,7 +2396,7 @@ PHP_FUNCTION(imap_fetchbody)
PHP_IMAP_CHECK_MSGNO(msgno);
}
- body = mail_fetchbody_full(imap_le_struct->imap_stream, msgno, sec->val, &len, (argc == 4 ? flags : NIL));
+ body = mail_fetchbody_full(imap_le_struct->imap_stream, msgno, ZSTR_VAL(sec), &len, (argc == 4 ? flags : NIL));
if (!body) {
php_error_docref(NULL, E_WARNING, "No body information available");
@@ -2438,7 +2438,7 @@ PHP_FUNCTION(imap_fetchmime)
PHP_IMAP_CHECK_MSGNO(msgno);
}
- body = mail_fetch_mime(imap_le_struct->imap_stream, msgno, sec->val, &len, (argc == 4 ? flags : NIL));
+ body = mail_fetch_mime(imap_le_struct->imap_stream, msgno, ZSTR_VAL(sec), &len, (argc == 4 ? flags : NIL));
if (!body) {
php_error_docref(NULL, E_WARNING, "No body MIME information available");
@@ -2492,7 +2492,7 @@ PHP_FUNCTION(imap_savebody)
IMAPG(gets_stream) = writer;
mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
- mail_fetchbody_full(imap_ptr->imap_stream, msgno, section?section->val:"", NULL, flags);
+ mail_fetchbody_full(imap_ptr->imap_stream, msgno, section?ZSTR_VAL(section):"", NULL, flags);
mail_parameters(NIL, SET_GETS, (void *) NULL);
IMAPG(gets_stream) = NULL;
@@ -2516,7 +2516,7 @@ PHP_FUNCTION(imap_base64)
return;
}
- decode = (char *) rfc822_base64((unsigned char *) text->val, text->len, &newlength);
+ decode = (char *) rfc822_base64((unsigned char *) ZSTR_VAL(text), ZSTR_LEN(text), &newlength);
if (decode == NULL) {
RETURN_FALSE;
@@ -2539,7 +2539,7 @@ PHP_FUNCTION(imap_qprint)
return;
}
- decode = (char *) rfc822_qprint((unsigned char *) text->val, text->len, &newlength);
+ decode = (char *) rfc822_qprint((unsigned char *) ZSTR_VAL(text), ZSTR_LEN(text), &newlength);
if (decode == NULL) {
RETURN_FALSE;
@@ -2562,7 +2562,7 @@ PHP_FUNCTION(imap_8bit)
return;
}
- decode = (char *) rfc822_8bit((unsigned char *) text->val, text->len, &newlength);
+ decode = (char *) rfc822_8bit((unsigned char *) ZSTR_VAL(text), ZSTR_LEN(text), &newlength);
if (decode == NULL) {
RETURN_FALSE;
@@ -2585,7 +2585,7 @@ PHP_FUNCTION(imap_binary)
return;
}
- decode = (char*)rfc822_binary(text->val, text->len, &newlength);
+ decode = (char*)rfc822_binary(ZSTR_VAL(text), ZSTR_LEN(text), &newlength);
if (decode == NULL) {
RETURN_FALSE;
@@ -2660,15 +2660,15 @@ PHP_FUNCTION(imap_rfc822_write_address)
addr=mail_newaddr();
if (mailbox) {
- addr->mailbox = cpystr(mailbox->val);
+ addr->mailbox = cpystr(ZSTR_VAL(mailbox));
}
if (host) {
- addr->host = cpystr(host->val);
+ addr->host = cpystr(ZSTR_VAL(host));
}
if (personal) {
- addr->personal = cpystr(personal->val);
+ addr->personal = cpystr(ZSTR_VAL(personal));
}
addr->next=NIL;
@@ -2701,8 +2701,8 @@ PHP_FUNCTION(imap_rfc822_parse_adrlist)
env = mail_newenvelope();
/* rfc822_parse_adrlist() modifies passed string. Copy it. */
- str_copy = estrndup(str->val, str->len);
- rfc822_parse_adrlist(&env->to, str_copy, defaulthost->val);
+ str_copy = estrndup(ZSTR_VAL(str), ZSTR_LEN(str));
+ rfc822_parse_adrlist(&env->to, str_copy, ZSTR_VAL(defaulthost));
efree(str_copy);
array_init(return_value);
@@ -2746,7 +2746,7 @@ PHP_FUNCTION(imap_utf8)
dest.data = NULL;
dest.size = 0;
- cpytxt(&src, str->val, str->len);
+ cpytxt(&src, ZSTR_VAL(str), ZSTR_LEN(str));
#ifndef HAVE_NEW_MIME2TEXT
utf8_mime2text(&src, &dest);
@@ -2805,8 +2805,8 @@ PHP_FUNCTION(imap_utf7_decode)
return;
}
- in = (const unsigned char *) arg->val;
- inlen = arg->len;
+ in = (const unsigned char *) ZSTR_VAL(arg);
+ inlen = ZSTR_LEN(arg);
/* validate and compute length of output string */
outlen = 0;
@@ -2944,8 +2944,8 @@ PHP_FUNCTION(imap_utf7_encode)
return;
}
- in = (const unsigned char *) arg->val;
- inlen = arg->len;
+ in = (const unsigned char *) ZSTR_VAL(arg);
+ inlen = ZSTR_LEN(arg);
/* compute the length of the result string */
outlen = 0;
@@ -2982,7 +2982,7 @@ PHP_FUNCTION(imap_utf7_encode)
out = zend_string_alloc(outlen, 0);
/* encode input string */
- outp = (unsigned char*)out->val;
+ outp = (unsigned char*)ZSTR_VAL(out);
state = ST_NORMAL;
endp = (inp = in) + inlen;
while (inp < endp || state != ST_NORMAL) {
@@ -3048,14 +3048,14 @@ static void php_imap_mutf7(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
return;
}
- if (in->len < 1) {
+ if (ZSTR_LEN(in) < 1) {
RETURN_EMPTY_STRING();
}
if (mode == 0) {
- out = utf8_to_mutf7((unsigned char *) in->val);
+ out = utf8_to_mutf7((unsigned char *) ZSTR_VAL(in));
} else {
- out = utf8_from_mutf7((unsigned char *) in->val);
+ out = utf8_from_mutf7((unsigned char *) ZSTR_VAL(in));
}
if (out == NIL) {
@@ -3100,7 +3100,7 @@ PHP_FUNCTION(imap_setflag_full)
RETURN_FALSE;
}
- mail_setflag_full(imap_le_struct->imap_stream, sequence->val, flag->val, (flags ? flags : NIL));
+ mail_setflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), ZSTR_VAL(flag), (flags ? flags : NIL));
RETURN_TRUE;
}
/* }}} */
@@ -3123,7 +3123,7 @@ PHP_FUNCTION(imap_clearflag_full)
RETURN_FALSE;
}
- mail_clearflag_full(imap_le_struct->imap_stream, sequence->val, flag->val, (argc == 4 ? flags : NIL));
+ mail_clearflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), ZSTR_VAL(flag), (argc == 4 ? flags : NIL));
RETURN_TRUE;
}
/* }}} */
@@ -3161,7 +3161,7 @@ PHP_FUNCTION(imap_sort)
}
}
if (argc >= 5) {
- search_criteria = estrndup(criteria->val, criteria->len);
+ search_criteria = estrndup(ZSTR_VAL(criteria), ZSTR_LEN(criteria));
spg = mail_criteria(search_criteria);
efree(search_criteria);
} else {
@@ -3173,7 +3173,7 @@ PHP_FUNCTION(imap_sort)
mypgm->function = (short) pgm;
mypgm->next = NIL;
- slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? charset->val : NIL), spg, mypgm, (argc >= 4 ? flags : NIL));
+ slst = mail_sort(imap_le_struct->imap_stream, (argc == 6 ? ZSTR_VAL(charset) : NIL), spg, mypgm, (argc >= 4 ? flags : NIL));
if (spg && !(flags & SE_FREE)) {
mail_free_searchpgm(&spg);
@@ -3292,7 +3292,7 @@ PHP_FUNCTION(imap_status)
object_init(return_value);
- if (mail_status(imap_le_struct->imap_stream, mbx->val, flags)) {
+ if (mail_status(imap_le_struct->imap_stream, ZSTR_VAL(mbx), flags)) {
add_property_long(return_value, "flags", IMAPG(status_flags));
if (IMAPG(status_flags) & SA_MESSAGES) {
add_property_long(return_value, "messages", IMAPG(status_messages));
@@ -3342,7 +3342,7 @@ PHP_FUNCTION(imap_bodystruct)
object_init(return_value);
- body=mail_body(imap_le_struct->imap_stream, msg, (unsigned char*)section->val);
+ body=mail_body(imap_le_struct->imap_stream, msg, (unsigned char*)ZSTR_VAL(section));
if (body == NULL) {
zval_dtor(return_value);
RETURN_FALSE;
@@ -3456,8 +3456,8 @@ PHP_FUNCTION(imap_fetch_overview)
array_init(return_value);
status = (flags & FT_UID)
- ? mail_uid_sequence(imap_le_struct->imap_stream, (unsigned char*)sequence->val)
- : mail_sequence(imap_le_struct->imap_stream, (unsigned char*)sequence->val);
+ ? mail_uid_sequence(imap_le_struct->imap_stream, (unsigned char*)ZSTR_VAL(sequence))
+ : mail_sequence(imap_le_struct->imap_stream, (unsigned char*)ZSTR_VAL(sequence));
if (status) {
MESSAGECACHE *elt;
@@ -3634,7 +3634,7 @@ PHP_FUNCTION(imap_mail_compose)
disp_param = tmp_param = NULL;
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
disp_param = mail_newbody_parameter();
- disp_param->attribute = cpystr(key->val);
+ disp_param->attribute = cpystr(ZSTR_VAL(key));
convert_to_string_ex(disp_data);
disp_param->value = (char *) fs_get(Z_STRLEN_P(disp_data) + 1);
memcpy(disp_param->value, Z_STRVAL_P(disp_data), Z_STRLEN_P(disp_data) + 1);
@@ -3666,7 +3666,7 @@ PHP_FUNCTION(imap_mail_compose)
disp_param = tmp_param = NULL;
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
disp_param = mail_newbody_parameter();
- disp_param->attribute = cpystr(key->val);
+ disp_param->attribute = cpystr(ZSTR_VAL(key));
convert_to_string_ex(disp_data);
disp_param->value = (char *) fs_get(Z_STRLEN_P(disp_data) + 1);
memcpy(disp_param->value, Z_STRVAL_P(disp_data), Z_STRLEN_P(disp_data) + 1);
@@ -3738,7 +3738,7 @@ PHP_FUNCTION(imap_mail_compose)
disp_param = tmp_param = NULL;
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
disp_param = mail_newbody_parameter();
- disp_param->attribute = cpystr(key->val);
+ disp_param->attribute = cpystr(ZSTR_VAL(key));
convert_to_string_ex(disp_data);
disp_param->value = (char *)fs_get(Z_STRLEN_P(disp_data) + 1);
memcpy(disp_param->value, Z_STRVAL_P(disp_data), Z_STRLEN_P(disp_data) + 1);
@@ -3770,7 +3770,7 @@ PHP_FUNCTION(imap_mail_compose)
disp_param = tmp_param = NULL;
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pvalue), key, disp_data) {
disp_param = mail_newbody_parameter();
- disp_param->attribute = cpystr(key->val);
+ disp_param->attribute = cpystr(ZSTR_VAL(key));
convert_to_string_ex(disp_data);
disp_param->value = (char *) fs_get(Z_STRLEN_P(disp_data) + 1);
memcpy(disp_param->value, Z_STRVAL_P(disp_data), Z_STRLEN_P(disp_data) + 1);
@@ -4096,26 +4096,26 @@ PHP_FUNCTION(imap_mail)
}
/* To: */
- if (!to->len) {
+ if (!ZSTR_LEN(to)) {
php_error_docref(NULL, E_WARNING, "No to field in mail command");
RETURN_FALSE;
}
/* Subject: */
- if (!subject->len) {
+ if (!ZSTR_LEN(subject)) {
php_error_docref(NULL, E_WARNING, "No subject field in mail command");
RETURN_FALSE;
}
/* message body */
- if (!message->len) {
+ if (!ZSTR_LEN(message)) {
/* this is not really an error, so it is allowed. */
php_error_docref(NULL, E_WARNING, "No message string in mail command");
message = NULL;
}
- if (_php_imap_mail(to->val, subject->val, message->val, headers?headers->val:NULL, cc?cc->val:NULL,
- bcc?bcc->val:NULL, rpath?rpath->val:NULL)) {
+ if (_php_imap_mail(ZSTR_VAL(to), ZSTR_VAL(subject), ZSTR_VAL(message), headers?ZSTR_VAL(headers):NULL, cc?ZSTR_VAL(cc):NULL,
+ bcc?ZSTR_VAL(bcc):NULL, rpath?ZSTR_VAL(rpath):NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -4144,12 +4144,12 @@ PHP_FUNCTION(imap_search)
RETURN_FALSE;
}
- search_criteria = estrndup(criteria->val, criteria->len);
+ search_criteria = estrndup(ZSTR_VAL(criteria), ZSTR_LEN(criteria));
IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
pgm = mail_criteria(search_criteria);
- mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? charset->val : NIL), pgm, flags);
+ mail_search_full(imap_le_struct->imap_stream, (argc == 4 ? ZSTR_VAL(charset) : NIL), pgm, flags);
if (pgm && !(flags & SE_FREE)) {
mail_free_searchpgm(&pgm);
@@ -4268,8 +4268,8 @@ PHP_FUNCTION(imap_mime_header_decode)
array_init(return_value);
- string = str->val;
- end = str->len;
+ string = ZSTR_VAL(str);
+ end = ZSTR_LEN(str);
charset = (char *) safe_emalloc((end + 1), 2, 0);
text = &charset[end + 1];
diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c
index a454b2d011..6918886060 100644
--- a/ext/interbase/ibase_events.c
+++ b/ext/interbase/ibase_events.c
@@ -318,7 +318,7 @@ PHP_FUNCTION(ibase_set_event_handler)
/* get the callback */
if (!zend_is_callable(cb_arg, 0, &cb_name)) {
- _php_ibase_module_error("Callback argument %s is not a callable function", cb_name->val);
+ _php_ibase_module_error("Callback argument %s is not a callable function", ZSTR_VAL(cb_name));
zend_string_release(cb_name);
RETURN_FALSE;
}
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 401842e431..a4fb0678fb 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -1412,7 +1412,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
ldap_mods[i]->mod_type = NULL;
if (zend_hash_get_current_key(Z_ARRVAL_P(entry), &attribute, &index) == HASH_KEY_IS_STRING) {
- ldap_mods[i]->mod_type = estrndup(attribute->val, attribute->len);
+ ldap_mods[i]->mod_type = estrndup(ZSTR_VAL(attribute), ZSTR_LEN(attribute));
} else {
php_error_docref(NULL, E_WARNING, "Unknown attribute in the data");
/* Free allocated memory */
@@ -1696,9 +1696,9 @@ PHP_FUNCTION(ldap_modify_batch)
/* is this a valid entry? */
if (
- !_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_ATTRIB) &&
- !_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_MODTYPE) &&
- !_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_VALUES)
+ !_ldap_str_equal_to_const(ZSTR_VAL(modkey), ZSTR_LEN(modkey), LDAP_MODIFY_BATCH_ATTRIB) &&
+ !_ldap_str_equal_to_const(ZSTR_VAL(modkey), ZSTR_LEN(modkey), LDAP_MODIFY_BATCH_MODTYPE) &&
+ !_ldap_str_equal_to_const(ZSTR_VAL(modkey), ZSTR_LEN(modkey), LDAP_MODIFY_BATCH_VALUES)
) {
php_error_docref(NULL, E_WARNING, "The only allowed keys in entries of the modifications array are '" LDAP_MODIFY_BATCH_ATTRIB "', '" LDAP_MODIFY_BATCH_MODTYPE "' and '" LDAP_MODIFY_BATCH_VALUES "'");
RETURN_FALSE;
@@ -1708,7 +1708,7 @@ PHP_FUNCTION(ldap_modify_batch)
modinfo = fetched;
/* does the value type match the key? */
- if (_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_ATTRIB)) {
+ if (_ldap_str_equal_to_const(ZSTR_VAL(modkey), ZSTR_LEN(modkey), LDAP_MODIFY_BATCH_ATTRIB)) {
if (Z_TYPE_P(modinfo) != IS_STRING) {
php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must be a string");
RETURN_FALSE;
@@ -1719,7 +1719,7 @@ PHP_FUNCTION(ldap_modify_batch)
RETURN_FALSE;
}
}
- else if (_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_MODTYPE)) {
+ else if (_ldap_str_equal_to_const(ZSTR_VAL(modkey), ZSTR_LEN(modkey), LDAP_MODIFY_BATCH_MODTYPE)) {
if (Z_TYPE_P(modinfo) != IS_LONG) {
php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_MODTYPE "' value must be a long");
RETURN_FALSE;
@@ -1751,7 +1751,7 @@ PHP_FUNCTION(ldap_modify_batch)
}
}
}
- else if (_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_VALUES)) {
+ else if (_ldap_str_equal_to_const(ZSTR_VAL(modkey), ZSTR_LEN(modkey), LDAP_MODIFY_BATCH_VALUES)) {
if (Z_TYPE_P(modinfo) != IS_ARRAY) {
php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' value must be an array");
RETURN_FALSE;
@@ -2614,7 +2614,7 @@ PHP_FUNCTION(ldap_set_rebind_proc)
/* callable? */
if (!zend_is_callable(callback, 0, &callback_name)) {
- php_error_docref(NULL, E_WARNING, "Two arguments expected for '%s' to be a valid callback", callback_name->val);
+ php_error_docref(NULL, E_WARNING, "Two arguments expected for '%s' to be a valid callback", ZSTR_VAL(callback_name));
zend_string_release(callback_name);
RETURN_FALSE;
}
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 365e37cc20..95bcd9978c 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -41,24 +41,24 @@
static void mysqli_tx_cor_options_to_string(const MYSQL * const conn, smart_str * str, const uint32_t mode)
{
if (mode & TRANS_COR_AND_CHAIN && !(mode & TRANS_COR_AND_NO_CHAIN)) {
- if (str->s && str->s->len) {
+ if (str->s && ZSTR_LEN(str->s)) {
smart_str_appendl(str, " ", sizeof(" ") - 1);
}
smart_str_appendl(str, "AND CHAIN", sizeof("AND CHAIN") - 1);
} else if (mode & TRANS_COR_AND_NO_CHAIN && !(mode & TRANS_COR_AND_CHAIN)) {
- if (str->s && str->s->len) {
+ if (str->s && ZSTR_LEN(str->s)) {
smart_str_appendl(str, " ", sizeof(" ") - 1);
}
smart_str_appendl(str, "AND NO CHAIN", sizeof("AND NO CHAIN") - 1);
}
if (mode & TRANS_COR_RELEASE && !(mode & TRANS_COR_NO_RELEASE)) {
- if (str->s && str->s->len) {
+ if (str->s && ZSTR_LEN(str->s)) {
smart_str_appendl(str, " ", sizeof(" ") - 1);
}
smart_str_appendl(str, "RELEASE", sizeof("RELEASE") - 1);
} else if (mode & TRANS_COR_NO_RELEASE && !(mode & TRANS_COR_RELEASE)) {
- if (str->s && str->s->len) {
+ if (str->s && ZSTR_LEN(str->s)) {
smart_str_appendl(str, " ", sizeof(" ") - 1);
}
smart_str_appendl(str, "NO RELEASE", sizeof("NO RELEASE") - 1);
@@ -122,7 +122,7 @@ static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, zend_bool commit, co
size_t query_len;
query_len = spprintf(&query, 0,
- (commit? "COMMIT%s %s":"ROLLBACK%s %s"), name_esc? name_esc:"", tmp_str.s? tmp_str.s->val:"");
+ (commit? "COMMIT%s %s":"ROLLBACK%s %s"), name_esc? name_esc:"", tmp_str.s? ZSTR_VAL(tmp_str.s):"");
smart_str_free(&tmp_str);
if (name_esc) {
efree(name_esc);
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index eac443660a..49432b67cd 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -526,9 +526,9 @@ static PHP_INI_DISP(display_link_nums)
char *value;
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value->val;
+ value = ZSTR_VAL(ini_entry->orig_value);
} else if (ini_entry->value) {
- value = ini_entry->value->val;
+ value = ZSTR_VAL(ini_entry->value);
} else {
value = NULL;
}
@@ -550,9 +550,9 @@ static PHP_INI_DISP(display_defPW)
char *value;
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value->val;
+ value = ZSTR_VAL(ini_entry->orig_value);
} else if (ini_entry->value) {
- value = ini_entry->value->val;
+ value = ZSTR_VAL(ini_entry->value);
} else {
value = NULL;
}
@@ -580,9 +580,9 @@ static PHP_INI_DISP(display_binmode)
char *value;
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value->val;
+ value = ZSTR_VAL(ini_entry->orig_value);
} else if (ini_entry->value) {
- value = ini_entry->value->val;
+ value = ZSTR_VAL(ini_entry->value);
} else {
value = NULL;
}
@@ -610,9 +610,9 @@ static PHP_INI_DISP(display_lrl)
char *value;
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value->val;
+ value = ZSTR_VAL(ini_entry->orig_value);
} else if (ini_entry->value) {
- value = ini_entry->value->val;
+ value = ZSTR_VAL(ini_entry->value);
} else {
value = NULL;
}
@@ -635,9 +635,9 @@ static PHP_INI_DISP(display_cursortype)
char *value;
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = ini_entry->orig_value->val;
+ value = ZSTR_VAL(ini_entry->orig_value);
} else if (ini_entry->value) {
- value = ini_entry->value->val;
+ value = ZSTR_VAL(ini_entry->value);
} else {
value = NULL;
}
@@ -3046,16 +3046,16 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
}
ptr = zend_string_alloc(len + 1, 0);
if (mode == 0) {
- strlcpy(ptr->val, conn->laststate, len+1);
+ strlcpy(ZSTR_VAL(ptr), conn->laststate, len+1);
} else {
- strlcpy(ptr->val, conn->lasterrormsg, len+1);
+ strlcpy(ZSTR_VAL(ptr), conn->lasterrormsg, len+1);
}
} else {
ptr = zend_string_alloc(len, 0);
if (mode == 0) {
- strlcpy(ptr->val, ODBCG(laststate), len+1);
+ strlcpy(ZSTR_VAL(ptr), ODBCG(laststate), len+1);
} else {
- strlcpy(ptr->val, ODBCG(lasterrormsg), len+1);
+ strlcpy(ZSTR_VAL(ptr), ODBCG(lasterrormsg), len+1);
}
}
RETVAL_STR(ptr);
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index 337ce3fb66..1e0151dc9d 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -198,7 +198,7 @@ static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
col->precision = -var->sqlscale;
col->maxlen = var->sqllen;
col->name = zend_string_alloc(colname_len, 0);
- cp = col->name->val;
+ cp = ZSTR_VAL(col->name);
if (colname_len > var->aliasname_length) {
memmove(cp, var->relname, var->relname_length);
cp += var->relname_length;
@@ -475,10 +475,10 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
for (i = 0; i < sqlda->sqld; ++i) {
XSQLVAR *var = &sqlda->sqlvar[i];
- if ((var->aliasname_length && !strncasecmp(param->name->val, var->aliasname,
- min(param->name->len, var->aliasname_length)))
- || (var->sqlname_length && !strncasecmp(param->name->val, var->sqlname,
- min(param->name->len, var->sqlname_length)))) {
+ if ((var->aliasname_length && !strncasecmp(ZSTR_VAL(param->name), var->aliasname,
+ min(ZSTR_LEN(param->name), var->aliasname_length)))
+ || (var->sqlname_length && !strncasecmp(ZSTR_VAL(param->name), var->sqlname,
+ min(ZSTR_LEN(param->name), var->sqlname_length)))) {
param->paramno = i;
break;
}
@@ -631,7 +631,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
}
case PDO_PARAM_EVT_NORMALIZE:
if (!param->is_param) {
- char *s = param->name->val;
+ char *s = ZSTR_VAL(param->name);
while (*s != '\0') {
*s = toupper(*s);
s++;