pollita Wed Sep 20 23:44:23 2006 UTC Modified files: /php-src/ext/unicode collator.c property.c transform.c unicode.c Log: Backfill protos for ext/unicode functions
http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/collator.c?r1=1.7&r2=1.8&diff_format=u Index: php-src/ext/unicode/collator.c diff -u php-src/ext/unicode/collator.c:1.7 php-src/ext/unicode/collator.c:1.8 --- php-src/ext/unicode/collator.c:1.7 Fri Apr 21 21:10:01 2006 +++ php-src/ext/unicode/collator.c Wed Sep 20 23:44:23 2006 @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: collator.c,v 1.7 2006/04/21 21:10:01 andrei Exp $ */ +/* $Id: collator.c,v 1.8 2006/09/20 23:44:23 pollita Exp $ */ #include "php.h" #include "ext/standard/php_array.h" @@ -163,11 +163,16 @@ 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; @@ -191,7 +196,10 @@ } 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; @@ -205,7 +213,10 @@ 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; @@ -230,7 +241,10 @@ } 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; @@ -243,7 +257,10 @@ 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; @@ -255,7 +272,10 @@ 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; @@ -271,7 +291,11 @@ 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; @@ -290,6 +314,7 @@ } RETURN_LONG(value); } +/* }}} */ /* {{{ proto Collator collator_get_default(void) U Returns default collator */ http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/property.c?r1=1.14&r2=1.15&diff_format=u Index: php-src/ext/unicode/property.c diff -u php-src/ext/unicode/property.c:1.14 php-src/ext/unicode/property.c:1.15 --- php-src/ext/unicode/property.c:1.14 Tue May 9 18:21:27 2006 +++ php-src/ext/unicode/property.c Wed Sep 20 23:44:23 2006 @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: property.c,v 1.14 2006/05/09 18:21:27 andrei Exp $ */ +/* $Id: property.c,v 1.15 2006/09/20 23:44:23 pollita Exp $ */ #include "php_unicode.h" @@ -53,135 +53,208 @@ /* {{{ 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; @@ -200,7 +273,10 @@ 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; @@ -219,7 +295,10 @@ 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; @@ -247,7 +326,10 @@ 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; @@ -266,7 +348,10 @@ 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; @@ -285,7 +370,10 @@ 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; @@ -309,7 +397,10 @@ 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; @@ -328,7 +419,10 @@ 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; @@ -347,7 +441,10 @@ 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; @@ -372,7 +469,10 @@ 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; @@ -414,7 +514,10 @@ 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; @@ -454,11 +557,14 @@ 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; @@ -486,7 +592,10 @@ 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; @@ -511,7 +620,10 @@ 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; @@ -522,7 +634,10 @@ 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; @@ -533,7 +648,10 @@ 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; @@ -555,7 +673,10 @@ 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; @@ -585,7 +706,10 @@ 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; @@ -608,7 +732,10 @@ 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; @@ -639,6 +766,7 @@ RETURN_LONG(value); } +/* }}} */ /* }}} */ @@ -724,6 +852,9 @@ 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; @@ -783,7 +914,10 @@ 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; @@ -829,6 +963,8 @@ RETURN_TRUE; } +/* }}} */ + /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/transform.c?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/unicode/transform.c diff -u php-src/ext/unicode/transform.c:1.4 php-src/ext/unicode/transform.c:1.5 --- php-src/ext/unicode/transform.c:1.4 Thu Jul 13 12:15:01 2006 +++ php-src/ext/unicode/transform.c Wed Sep 20 23:44:23 2006 @@ -14,10 +14,12 @@ +----------------------------------------------------------------------+ */ -/* $Id: transform.c,v 1.4 2006/07/13 12:15:01 tony2001 Exp $ */ +/* $Id: transform.c,v 1.5 2006/09/20 23:44:23 pollita Exp $ */ #include "php_unicode.h" +/* {{{ proto string str_transliterate(string str, string from, string to[, string variant]) U +Transliterate a string using the alphabet provided */ PHP_FUNCTION(str_transliterate) { UChar *str, *from, *to, *variant = NULL; @@ -81,6 +83,7 @@ RETURN_UNICODEL(result, result_len, 0); } +/* }}} */ /* * Local variables: http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/unicode.c?r1=1.40&r2=1.41&diff_format=u Index: php-src/ext/unicode/unicode.c diff -u php-src/ext/unicode/unicode.c:1.40 php-src/ext/unicode/unicode.c:1.41 --- php-src/ext/unicode/unicode.c:1.40 Tue Aug 8 16:59:11 2006 +++ php-src/ext/unicode/unicode.c Wed Sep 20 23:44:23 2006 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: unicode.c,v 1.40 2006/08/08 16:59:11 tony2001 Exp $ */ +/* $Id: unicode.c,v 1.41 2006/09/20 23:44:23 pollita Exp $ */ #include "php_unicode.h" #include "zend_unicode.h" @@ -232,6 +232,8 @@ } /* }}} */ +/* {{{ proto callback unicode_set_error_handler(callback new_callback) U +Set (or clear) the unicode conversion error handler */ PHP_FUNCTION(unicode_set_error_handler) { zval *error_handler; @@ -274,7 +276,11 @@ RETURN_NULL(); } } +/* }}} */ +/* {{{ proto bool unicode_restore_error_handler(void) U +Restores the active error handler to the one which was previously active +(Before the last unicode_set_error_handler() call) */ PHP_FUNCTION(unicode_restore_error_handler) { if (UG(conv_error_handler)) { @@ -291,6 +297,7 @@ } RETURN_TRUE; } +/* }}} */ /* {{{ unicode_functions[] */ zend_function_entry unicode_functions[] = {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php