Commit Graph

282 Commits

Author SHA1 Message Date
Marcus Boerger
aa4cd53b7b - Consistency: macros shall be uppercased (as requested by Andrei) 2007-01-11 22:55:33 +00:00
Marcus Boerger
6a6d9da6ea - Add zstrlen() helper 2007-01-11 21:32:57 +00:00
Andrei Zmievski
1037e06dc8 Remove const warnings. (Andrey) 2007-01-10 16:47:41 +00:00
Sara Golemon
7dcebde684 Add add_property_zstr(l)(_ex)() 2007-01-07 06:16:57 +00:00
Sebastian Bergmann
3717df72ae Bump year. 2007-01-01 09:29:37 +00:00
Antony Dovgal
6cbc9b0043 fix typo 2006-12-23 14:12:38 +00:00
Hannes Magnusson
460360ae53 MFB:
- Fixed incorrect function names on FreeBSD where inet_pton() was named
        __inet_pton() and inet_ntop() was named __inet_ntop()
- Fixed bug #39685 (iconv() - undefined function)
- Fixed bug #38852 (XML-RPC Breaks iconv)
2006-12-20 10:38:24 +00:00
Andrei Zmievski
e722dce575 - Marcus was too quick. Let's put type before zstr in the macros.
- Also mark get_include_path() and restore_include_path() with U.
2006-12-19 21:38:59 +00:00
Marcus Boerger
98dce57dd5 - Fix ZVAL_ZSTRL 2006-12-19 21:13:21 +00:00
Hannes Magnusson
950ab95207 Fix ZTS build 2006-12-16 18:31:23 +00:00
Andrei Zmievski
b78a38a2ae Make all macros (RETURN_*, RETVAL_*, ZVAL_*, add_*) that convert binary
strings to Unicode actually issues errors on failure. I'm surprised we
haven't done this already.
2006-12-15 22:35:23 +00:00
Andrei Zmievski
1ef43a02ee Guard against ambiguous 'else' clauses. 2006-12-07 18:19:21 +00:00
Dmitry Stogov
57d22421db Unicode support.
Now the real UG(unicode) value is available during MINIT calls.
2006-11-17 10:48:53 +00:00
Antony Dovgal
8043daedbb fix typo (patch by Mike Wallner) 2006-11-15 22:50:19 +00:00
Andrei Zmievski
75c272440e Turn doc comments into zstr strings with corresponding adjustments. 2006-10-27 21:22:05 +00:00
Antony Dovgal
d5fbdc689a fix add_u_assoc_null() macro 2006-10-24 12:46:33 +00:00
Andrei Zmievski
ac73b4a6e5 Fix potential (and real) leaks due to bad macro writing. Grrr. 2006-10-19 20:54:48 +00:00
Andrei Zmievski
9d4d53515d Fix possible double macro expansion. 2006-10-19 18:27:35 +00:00
Andrei Zmievski
1e1f3efb02 Fix thread safety. 2006-10-17 22:15:19 +00:00
Andrei Zmievski
2602e49e65 Implement add_utf8_property_* API. 2006-10-17 17:56:42 +00:00
Andrei Zmievski
97d0372249 Extend zend_fcall_info_args functions. (Patch from Mike Wallner) 2006-10-11 18:37:31 +00:00
Andrei Zmievski
d86524570f Hash functions for UTF-8 keys. 2006-10-07 17:34:19 +00:00
Dmitry Stogov
128548a5c0 Disabled autoconversion of hash keys (from string to unicode) for PHP arrays 2006-09-19 10:38:31 +00:00
Andrei Zmievski
81b83f327b More work on Unicode support in PCRE. When UG(unicode) is on, all
strings passed to PCRE have to be IS_UNICODE or IS_STRING in UTF-8
encoding. Failure to do so will result in unpredictable results.
2006-09-18 17:59:10 +00:00
Andrei Zmievski
21bc25e025 Add a couple more UTF-8 functions. 2006-09-11 16:32:02 +00:00
Andrei Zmievski
11ca9006a2 Add APIs for UTF-8 strings (common with XML, PCRE, etc) 2006-08-28 17:14:49 +00:00
Andrei Zmievski
dd2e2abc9c Fix some API definitions. 2006-08-25 20:47:23 +00:00
Andrei Zmievski
2701f53af6 add_next_index_zstr[l]() 2006-08-14 21:05:22 +00:00
Antony Dovgal
f5715ee86f implement zend_unicode_to_string() and zend_string_to_unicode()
part #1 (of 2)
2006-08-08 16:58:06 +00:00
Andrei Zmievski
dda059708f Add add_assoc_zstr_ex() and related. 2006-08-04 21:05:59 +00:00
Andrei Zmievski
cb15b7d5ae Add macros to be able to initialize/return values based on zstr. 2006-08-04 18:08:31 +00:00
Marcus Boerger
8619c361cc - Add new unicode functions: add_u_assoc_*[_ex]() which allow to add values
using a unicode key.
2006-07-20 21:16:08 +00:00
Andrei Zmievski
e9a9a26e7e Rewrite array_map() to use params API with fci cache and mark it with U. 2006-07-20 20:54:23 +00:00
Dmitry Stogov
6687f0377b New memory manager 2006-07-18 09:08:06 +00:00
Andrei Zmievski
fdf280b41b - Upgrade usort() to support Unicode (including valid Unicode callbacks).
- Make usort() use 'f' specifier for function call info/cache.
2006-07-17 20:52:12 +00:00
Dmitry Stogov
2cbde06400 Added automatic module globals management. 2006-06-13 13:11:42 +00:00
Marcus Boerger
5925a26275 - Take care of refcounting in zend_fcall_info_*() functions
- Add docu
# I know it is unpopular to add docu here but i think we should add more
2006-05-27 19:40:06 +00:00
Marcus Boerger
9114bc25c3 - Ease writing functions that deal with php function 'pointers' 2006-05-25 22:20:13 +00:00
Antony Dovgal
34126e4a64 MFB: fix error messages when converting objects to other types 2006-05-25 10:34:01 +00:00
Marcus Boerger
6c0c9f098f - Methods have flags 2006-05-09 22:12:50 +00:00
Marcus Boerger
0638c67dab - MFB: WS 2006-05-09 21:26:39 +00:00
Andrei Zmievski
534cad7064 Add a global ASCII connverter, macros to return single codepoints
(UCHAR32), and zend_unicode_to_ascii() function.
2006-05-04 21:22:17 +00:00
Sara Golemon
5f5faedf18 Overload 'duplicate' arg as applied to:
add_((next_)?index|assoc)_(ascii|rt)_stringl?(_ex)?
and
(ZVAL|RETVAL|RETURN)_(ASCII|RT|U)_STRINGL?

#define ZSTR_DUPLICATE (1<<0)
#define ZSTR_AUTOFREE (1<<1)

Duplicate keeps traditional value of '1', additional bit '2' tells
unicode mode conversion to automatically free the original string
in order to avoid leaks due to conversion on a value otherwise being
"given" to the engine.

/* Uses s as-is for non-unicode, or frees s after converting to unicode */
{
  char *s = estrdup("Hello");
  ZVAL_RT_STRING(pzv, s, ZSTR_AUTOFREE);
}

/* Duplicates for non-unicode, or converts (but doesn't free original) */
{
  char *s = "Hello";
  ZVAL_RT_STRING(pzv, s, ZSTR_DUPLICATE);
}

/* Uses as-is for non-unicode, or converts (but doesn't free original) */
{
  char *s = "Hello";
  zval zv;
  ZVAL_RT_STRING(&zv, s, 0);

  /* use zv for some temporary purpose */

  /* It's now necessary to manually free this generated value */
  if (UG(unicode)) {
    zval_dtor(&zv);
  }
}
2006-04-06 18:02:39 +00:00
Dmitry Stogov
f0b9848949 Added RETVAL_EMPTRY_TEXT() and RETURN_EMPTY_TEXT() macroses 2006-03-10 16:35:21 +00:00
Marcus Boerger
fd2b76d505 - Add missing function for completeness 2006-03-05 16:09:45 +00:00
Johannes Schlüter
5575afef48 - Separate ZEND_METHOD from ZEND_FUNCTION 2006-03-04 14:37:50 +00:00
Dmitry Stogov
e3b7f3fd0d Unicode support: MS Visual C compatibility 2006-02-26 11:57:14 +00:00
Marcus Boerger
8a4c8e8d47 - Add macros to mark functions/alias functions as deprecated
(mentioned by Sara and obviously neccessary)
- Fix function/method flag error detection logic
2006-02-24 13:29:54 +00:00
Dmitry Stogov
26ddcdb55d Unicode support 2006-02-22 11:37:11 +00:00
Dmitry Stogov
0f1209ab3d Portable unicode string API:
- use the same type (int) for zval.value.usr.len and zval.value.str.len
  - use union "zstr" as char*/UChar* mixture instead of void*
  - Z_UNISTR() and Z_UNILEN() no longer check for Z_TYPE()
  - nuke int32_t from ZE (not finisned)
2006-02-21 20:12:43 +00:00