pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:638:    *!    *! Convert a string or character to lower case.    *!    *! @returns    *! Returns a copy of the string @[s] with all upper case characters    *! converted to lower case, or the character @[c] converted to lower    *! case.    *!    *! @note    *! Assumes the string or character to be coded according to -  *! ISO-10646 (aka Unicode). If they are not, @[Locale.Charset.decoder] -  *! can do the initial conversion for you. +  *! ISO-10646 (aka Unicode). If they are not, @[Charset.decoder] can +  *! do the initial conversion for you.    *!    *! @note    *! Prior to Pike 7.5 this function only accepted strings.    *!    *! @seealso -  *! @[upper_case()], @[Locale.Charset.decoder] +  *! @[upper_case()], @[Charset.decoder]    */   PMOD_EXPORT void f_lower_case(INT32 args)   {    ptrdiff_t i;    struct pike_string *orig;    struct pike_string *ret;       check_all_args("lower_case", args, BIT_STRING|BIT_INT, 0);       if (TYPEOF(Pike_sp[-args]) == T_INT) {
pike.git/src/builtin_functions.c:715:    *!    *! Convert a string or character to upper case.    *!    *! @returns    *! Returns a copy of the string @[s] with all lower case characters    *! converted to upper case, or the character @[c] converted to upper    *! case.    *!    *! @note    *! Assumes the string or character to be coded according to -  *! ISO-10646 (aka Unicode). If they are not, @[Locale.Charset.decoder] -  *! can do the initial conversion for you. +  *! ISO-10646 (aka Unicode). If they are not, @[Charset.decoder] can +  *! do the initial conversion for you.    *!    *! @note    *! Prior to Pike 7.5 this function only accepted strings.    *!    *! @seealso -  *! @[lower_case()], @[Locale.Charset.decoder] +  *! @[lower_case()], @[Charset.decoder]    */   PMOD_EXPORT void f_upper_case(INT32 args)   {    ptrdiff_t i;    struct pike_string *orig;    struct pike_string *ret;    check_all_args("upper_case", args, BIT_STRING|BIT_INT, 0);       if (TYPEOF(Pike_sp[-args]) == T_INT) {    /* NOTE: Performs the case change in place. */
pike.git/src/builtin_functions.c:1651:    *! Converts a string into an UTF16 compliant byte-stream.    *!    *! @note    *! Throws an error if characters not legal in an UTF16 stream are    *! encountered. Valid characters are in the range 0x00000 - 0x10ffff,    *! except for characters 0xfffe and 0xffff.    *!    *! Characters in range 0x010000 - 0x10ffff are encoded using surrogates.    *!    *! @seealso -  *! @[Locale.Charset.decoder()], @[string_to_utf8()], @[unicode_to_string()], +  *! @[Charset.decoder()], @[string_to_utf8()], @[unicode_to_string()],    *! @[utf8_to_string()]    */   PMOD_EXPORT void f_string_to_unicode(INT32 args)   {    struct pike_string *in;    struct pike_string *out = NULL;    ptrdiff_t len;    ptrdiff_t i;       get_all_args("string_to_unicode", args, "%W", &in);
pike.git/src/builtin_functions.c:1787:   }      /*! @decl string unicode_to_string(string(0..255) s)    *!    *! Converts an UTF16 byte-stream into a string.    *!    *! @note    *! This function did not decode surrogates in Pike 7.2 and earlier.    *!    *! @seealso -  *! @[Locale.Charset.decoder()], @[string_to_unicode()], @[string_to_utf8()], +  *! @[Charset.decoder()], @[string_to_unicode()], @[string_to_utf8()],    *! @[utf8_to_string()]    */   PMOD_EXPORT void f_unicode_to_string(INT32 args)   {    struct pike_string *in;    struct pike_string *out = NULL;    ptrdiff_t len, i, num_surrogates = 0;    int swab=0;    p_wchar1 surr1, surr2, surrmask, *str0;   
pike.git/src/builtin_functions.c:1953:    *! @note    *! Throws an error if characters not valid in an UTF-8 stream are    *! encountered. Valid characters are in the ranges    *! @expr{0x00000000-0x0000d7ff@} and @expr{0x0000e000-0x0010ffff@}.    *!    *! If @[extended] is 1 then characters outside the valid ranges are    *! accepted too and encoded using the same algorithm. Such encoded    *! characters are however not UTF-8 compliant.    *!    *! @seealso -  *! @[Locale.Charset.encoder()], @[string_to_unicode()], +  *! @[Charset.encoder()], @[string_to_unicode()],    *! @[unicode_to_string()], @[utf8_to_string()]    */   PMOD_EXPORT void f_string_to_utf8(INT32 args)   {    ptrdiff_t len;    struct pike_string *in;    struct pike_string *out;    ptrdiff_t i,j;    INT_TYPE extended = 0;    PCHARP src;
pike.git/src/builtin_functions.c:2108:    *! @endint    *!    *! @note    *! Throws an error if the stream is not a legal UTF-8 byte-stream.    *!    *! @note    *! In conformance with RFC 3629 and Unicode 3.1 and later,    *! non-shortest forms are not decoded. An error is thrown instead.    *!    *! @seealso -  *! @[Locale.Charset.encoder()], @[string_to_unicode()], @[string_to_utf8()], +  *! @[Charset.encoder()], @[string_to_unicode()], @[string_to_utf8()],    *! @[unicode_to_string()]    */   PMOD_EXPORT void f_utf8_to_string(INT32 args)   {    struct pike_string *in;    struct pike_string *out;    ptrdiff_t len = 0;    int shift = 0;    ptrdiff_t i,j=0;    INT_TYPE extended = 0;