return object;
}
+/* {{{ proto Collator collator_create(string collator_name) U
+Create a new collator object */
PHP_METHOD(collator, __construct)
{
zif_collator_create(INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
+/* }}} */
+/* {{{ proto Collator collator_create(string collator_name) U
+Create a new collator object */
PHP_FUNCTION(collator_create)
{
UErrorCode status = U_ZERO_ERROR;
}
collator_set_wrapper(object, zend_collator_create(ucoll) TSRMLS_CC);
}
+/* }}} */
+/* {{{ proto int collator_compare(Collator coll, string elementA, string elementB) U
+Use a collator object to compare two elements */
PHP_FUNCTION(collator_compare)
{
zval *object;
collatorobj = (php_collator_obj *) zend_object_store_get_object(object TSRMLS_CC);
RETURN_LONG(ucol_strcoll(collatorobj->zcoll->coll, string1, string1_len, string2, string2_len));
}
+/* }}} */
+/* {{{ proto array collator_sort(Collator coll, array initialarray) U
+Sort an array using a collator */
PHP_FUNCTION(collator_sort)
{
zval *object;
}
UG(default_collator) = orig_collator;
}
+/* }}} */
+/* {{{ proto void collator_set_strength(Collator coll, int strength) U
+Set the strength on a collator object */
PHP_FUNCTION(collator_set_strength)
{
zval *object;
collatorobj = (php_collator_obj *) zend_object_store_get_object(object TSRMLS_CC);
ucol_setStrength(collatorobj->zcoll->coll, strength);
}
+/* }}} */
+/* {{{ proto int collator_get_strength(Collator coll) U
+Returns the current collator strength */
PHP_FUNCTION(collator_get_strength)
{
zval *object;
collatorobj = (php_collator_obj *) zend_object_store_get_object(object TSRMLS_CC);
RETURN_LONG(ucol_getStrength(collatorobj->zcoll->coll));
}
+/* }}} */
+/* {{{ proto bool collator_set_attribute(Collator coll, int attribute, int value) U
+Set a collator attribute */
PHP_FUNCTION(collator_set_attribute)
{
zval *object;
ucol_setAttribute(collatorobj->zcoll->coll, attribute, value, &error);
RETURN_BOOL(error == U_ZERO_ERROR ? 1 : 0);
}
+/* }}} */
+
+/* {{{ proto int collator_get_attribute(Collator coll, int attribute) U
+Read an attribute from a collator */
PHP_FUNCTION(collator_get_attribute)
{
zval *object;
}
RETURN_LONG(value);
}
+/* }}} */
/* {{{ proto Collator collator_get_default(void) U
Returns default collator */
/* {{{ C/POSIX migration functions */
+/* {{{ proto bool char_is_lower(string text) U
+Determines if text is lowercase */
PHP_FUNCTION(char_is_lower)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_islower);
}
+/* }}} */
+/* {{{ proto bool char_is_upper(string text) U
+Determines if text is uppercase */
PHP_FUNCTION(char_is_upper)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isupper);
}
+/* }}} */
+/* {{{ proto bool char_is_digit(string text) U
+Determines if text is all digits */
PHP_FUNCTION(char_is_digit)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isdigit);
}
+/* }}} */
+/* {{{ proto bool char_is_alpha(string text) U
+Determines if text is alpha */
PHP_FUNCTION(char_is_alpha)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isalpha);
}
+/* }}} */
+/* {{{ proto bool char_is_alnum(string text) U
+Determines if text is alpha/numeric */
PHP_FUNCTION(char_is_alnum)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isalnum);
}
+/* }}} */
+/* {{{ proto bool char_is_xdigit(string text) U
+Determines if text is hexits */
PHP_FUNCTION(char_is_xdigit)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isxdigit);
}
+/* }}} */
+/* {{{ proto bool char_is_punct(string text) U
+Determines if text is punctuation */
PHP_FUNCTION(char_is_punct)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_ispunct);
}
+/* }}} */
+/* {{{ proto bool char_is_graph(string text) U
+Determines if text is graphemes */
PHP_FUNCTION(char_is_graph)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isgraph);
}
+/* }}} */
+/* {{{ proto bool char_is_blank(string text) U
+Determines if text is blank */
PHP_FUNCTION(char_is_blank)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isblank);
}
+/* }}} */
+/* {{{ proto bool char_is_space(string text) U
+Determines if text is space(s) */
PHP_FUNCTION(char_is_space)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isspace);
}
+/* }}} */
+/* {{{ proto bool char_is_cntrl(string text) U
+Determines if text is control characters */
PHP_FUNCTION(char_is_cntrl)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_iscntrl);
}
+/* }}} */
+/* {{{ proto bool char_is_print(string text) U
+Determines if text is printable */
PHP_FUNCTION(char_is_print)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isprint);
}
+/* }}} */
/* }}} */
/* {{{ Additional binary property functions */
+/* {{{ proto bool char_is_defined(string text) U
+Determines if text is defined (valid unicode points) */
PHP_FUNCTION(char_is_defined)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isdefined);
}
+/* }}} */
+/* {{{ proto bool char_is_id_start(string text) U
+Determines if the specified character is permissible as the first character in an identifier according to Unicode */
PHP_FUNCTION(char_is_id_start)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isIDStart);
}
+/* }}} */
+/* {{{ proto bool char_is_id_part(string text) U
+etermines if the specified characters are permissible in an identifier according to Java */
PHP_FUNCTION(char_is_id_part)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isIDPart);
}
+/* }}} */
+/* {{{ proto bool char_is_id_ignorable(string text) U
+Determines if the specified characters should be regarded as an ignorable character in an identifier, according to Java */
PHP_FUNCTION(char_is_id_ignorable)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isIDIgnorable);
}
+/* }}} */
+/* {{{ proto bool char_is_iso_control(string text) U
+Determines whether the specified code points are ISO control codes */
PHP_FUNCTION(char_is_iso_control)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isISOControl);
}
+/* }}} */
+/* {{{ proto bool char_is_mirrored(string text) U
+Determines whether the code points have the Bidi_Mirrored property */
PHP_FUNCTION(char_is_mirrored)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isMirrored);
}
+/* }}} */
+/* {{{ proto bool char_is_base(string text) U
+Determines if text consists of base characters */
PHP_FUNCTION(char_is_base)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isbase);
}
+/* }}} */
+/* {{{ proto bool char_is_whitespace(string text) U
+Determines if text is whitespace */
PHP_FUNCTION(char_is_whitespace)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isUWhiteSpace);
}
+/* }}} */
+/* {{{ proto bool char_is_alphabetic(string text) U
+Determines if text is alphabetic */
PHP_FUNCTION(char_is_alphabetic)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isUAlphabetic);
}
+/* }}} */
+/* {{{ proto bool char_is_uppercase(string text) U
+Determines if text is uppercase */
PHP_FUNCTION(char_is_uppercase)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isUUppercase);
}
+/* }}} */
+/* {{{ proto bool char_is_lowercase (string text) U
+Determines if text is lowercase */
PHP_FUNCTION(char_is_lowercase)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_isULowercase);
}
+/* }}} */
+/* {{{ proto bool char_is_titlecase(string text) U
+Determines whether the specified code points are titlecase letters */
PHP_FUNCTION(char_is_titlecase)
{
check_property_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, u_istitle);
}
-
+/* }}} */
/* }}} */
/* {{{ Single character properties */
+/* {{{ poto float char_get_numeric_value(char text) U
+Get the numeric value for a Unicode code point as defined in the Unicode Character Database */
PHP_FUNCTION(char_get_numeric_value)
{
UChar *str;
RETURN_DOUBLE(u_getNumericValue(ch));
}
+/* }}} */
+/* {{{ proto int char_get_combining_class(char text) U
+Returns the combining class of the first code point in text */
PHP_FUNCTION(char_get_combining_class)
{
UChar *str;
RETURN_LONG((long)u_getCombiningClass(ch));
}
+/* }}} */
+/* {{{ proto int char_get_digit_value(char text[, int radix]) U
+Returns the decimal digit value of a decimal digit character (optionally in a specific radix). */
PHP_FUNCTION(char_get_digit_value)
{
UChar *str;
RETURN_LONG(u_charDigitValue(ch));
}
}
+/* }}} */
+/* {{{ proto char char_get_mirrored(char c) U
+Maps the specified character to a "mirror-image" character */
PHP_FUNCTION(char_get_mirrored)
{
UChar *str;
RETURN_UCHAR32(u_charMirror(ch));
}
+/* }}} */
+/* {{{ proto int char_get_direction(char c) U
+Returns the bidirectional category value for the code point, which is used in the Unicode bidirectional algorithm (UAX #9 http://www.unicode.org/reports/tr9/) */
PHP_FUNCTION(char_get_direction)
{
UChar *str;
RETURN_LONG((long)u_charDirection(ch));
}
+/* }}} */
+/* {{{ proto string char_get_age(char c) U
+Get the "age" of the code point */
PHP_FUNCTION(char_get_age)
{
UChar *str;
RETURN_ASCII_STRING(buf, ZSTR_DUPLICATE);
}
+/* }}} */
+/* {{{ proto int char_get_type(char c) U
+Returns the general category value for the code point */
PHP_FUNCTION(char_get_type)
{
UChar *str;
RETURN_LONG(u_charType(ch));
}
+/* }}} */
+/* {{{ proto bool char_is_valid(char c) U
+Determines if c is a valid Unicode point */
PHP_FUNCTION(char_is_valid)
{
UChar *str;
RETURN_BOOL(U_IS_UNICODE_CHAR(ch));
}
+/* }}} */
+/* {{{ proto char char_from_digit(int digit[, int radix = 10]) U
+Get the character associated with a digit */
PHP_FUNCTION(char_from_digit)
{
int digit;
RETURN_UCHAR32(ch);
}
+/* }}} */
+/* {{{ proto char char_from_name(string charname[, bool extended = false]) U
+Translate a human readable character name into a codepoint */
PHP_FUNCTION(char_from_name)
{
void *name;
RETURN_FALSE;
}
}
+/* }}} */
+/* {{{ proto string char_get_name(char c[, bool extended = false]) U
+Get the human readable name associated with a character */
PHP_FUNCTION(char_get_name)
{
UChar *str;
RETURN_ASCII_STRINGL(buf, buf_len, ZSTR_AUTOFREE);
}
+/* }}} */
/* }}} */
/* {{{ Other property functions */
+/* {{{ proto bool char_has_binary_property(string text, int property) U
+Determines if the characters in text all have the binary property specified */
PHP_FUNCTION(char_has_binary_property)
{
UChar *str = NULL;
RETURN_BOOL(result);
}
+/* }}} */
+/* {{{ proto int char_get_property_value(char c, int property) U
+Get the value of a property associated with a character */
PHP_FUNCTION(char_get_property_value)
{
UChar *str;
RETURN_LONG(u_getIntPropertyValue(ch, (UProperty)prop));
}
}
+/* }}} */
+/* {{{ proto int char_get_property_min_value(int property) U
+Get the minimum value associated with a property */
PHP_FUNCTION(char_get_property_min_value)
{
long prop;
RETURN_LONG(u_getIntPropertyMinValue((UProperty)prop));
}
+/* }}} */
+/* {{{ proto int char_get_property_max_value(int property) U
+Get the maximum value associated with a property */
PHP_FUNCTION(char_get_property_max_value)
{
long prop;
RETURN_LONG(u_getIntPropertyMaxValue((UProperty)prop));
}
+/* }}} */
+/* {{{ proto string char_get_property_name(int property) U
+Get the name associated with a property */
PHP_FUNCTION(char_get_property_name)
{
long prop;
RETURN_FALSE;
}
}
+/* }}} */
+/* {{{ proto int char_get_property_min_value(string property_name) U
+Get ID of a given property name */
PHP_FUNCTION(char_get_property_from_name)
{
void *name;
RETURN_LONG(prop);
}
+/* }}} */
+/* {{{ proto string char_get_property_value_name(int property, int value[, int name_choice]) U
+Get the name of a property value */
PHP_FUNCTION(char_get_property_value_name)
{
long prop;
RETURN_FALSE;
}
}
+/* }}} */
+/* {{{ proto int char_get_property_value_from_name(int property, string value_name) U
+Get the value ID associated with a property's value name */
PHP_FUNCTION(char_get_property_value_from_name)
{
long prop;
RETURN_LONG(value);
}
+/* }}} */
/* }}} */
return result;
}
+/* {{{ proto bool char_enum_names(callback Callback, int start, int limit[, int extended = false]) U
+Enumerate all assigned Unicode characters between the start and limit code points (start inclusive, limit exclusive)
+and call a function for each, passing the code point value and the character name. */
PHP_FUNCTION(char_enum_names)
{
zval *callback;
RETURN_FALSE;
}
}
+/* }}} */
+/* {{{ proto bool char_enum_types(callback Callback) U
+Enumerate the character types calling Callback for each type range */
PHP_FUNCTION(char_enum_types)
{
zval *callback;
RETURN_TRUE;
}
+/* }}} */
+
/* }}} */