mbstring unused internal functions

php.internals

Legale Legage

7 years ago
Hello. Looking through the source code of the mbstring.c file I found a lot of unused internal functions. It seems that this is just a bunch of old junk. Examples: MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc) MBSTRING_API size_t php_mb_mbchar_bytes(const char *s) MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes) MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t nbytes, const mbfl_encoding *enc)

Christoph Becker

7 years ago
On 24.01.2019 at 12:20, Legale Legage wrote:
> Looking through the source code of the mbstring.c file I found a lot > of unused internal functions. It seems that this is just a bunch of > old junk. > > Examples: > > MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const > mbfl_encoding *enc) > MBSTRING_API size_t php_mb_mbchar_bytes(const char *s) > MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, > size_t nbytes) > MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int > c, size_t nbytes, const mbfl_encoding *enc)
MBSTRING_API means that these functions are exported, and are available for other extensions. As such, they may well be used.
-- Christoph M. Becker

Nikita Popov

7 years ago
On Thu, Jan 24, 2019 at 12:21 PM Legale Legage <legale.legale@gmail.com> wrote:
> Hello. > > Looking through the source code of the mbstring.c file I found a lot > of unused internal functions. It seems that this is just a bunch of > old junk. > > Examples: > > MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const > mbfl_encoding *enc) > MBSTRING_API size_t php_mb_mbchar_bytes(const char *s) > MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, > size_t nbytes) > MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int > c, size_t nbytes, const mbfl_encoding *enc) >
How did you determine that these are unused? I'm seeing uses for all of them in mbstring.c or php_mbregex.c Nikita