@@ -141,42 +141,43 @@ END_EXTERN_C()
141141
142142/*---*/ 
143143
144- static  zend_always_inline  zend_ulong  zend_string_hash_val (zend_string  * s )
144+ BEGIN_EXTERN_C ()
145+ ZEND_API  zend_always_inline  zend_ulong  zend_string_hash_val (zend_string  * s )
145146{
146147	return  ZSTR_H (s ) ? ZSTR_H (s ) : zend_string_hash_func (s );
147148}
148149
149- static  zend_always_inline  void  zend_string_forget_hash_val (zend_string  * s )
150+ ZEND_API  zend_always_inline  void  zend_string_forget_hash_val (zend_string  * s )
150151{
151152	ZSTR_H (s ) =  0 ;
152153	GC_DEL_FLAGS (s , IS_STR_VALID_UTF8 );
153154}
154155
155- static  zend_always_inline  uint32_t  zend_string_refcount (const  zend_string  * s )
156+ ZEND_API  zend_always_inline  uint32_t  zend_string_refcount (const  zend_string  * s )
156157{
157158	if  (!ZSTR_IS_INTERNED (s )) {
158159		return  GC_REFCOUNT (s );
159160	}
160161	return  1 ;
161162}
162163
163- static  zend_always_inline  uint32_t  zend_string_addref (zend_string  * s )
164+ ZEND_API  zend_always_inline  uint32_t  zend_string_addref (zend_string  * s )
164165{
165166	if  (!ZSTR_IS_INTERNED (s )) {
166167		return  GC_ADDREF (s );
167168	}
168169	return  1 ;
169170}
170171
171- static  zend_always_inline  uint32_t  zend_string_delref (zend_string  * s )
172+ ZEND_API  zend_always_inline  uint32_t  zend_string_delref (zend_string  * s )
172173{
173174	if  (!ZSTR_IS_INTERNED (s )) {
174175		return  GC_DELREF (s );
175176	}
176177	return  1 ;
177178}
178179
179- static  zend_always_inline  zend_string  * zend_string_alloc (size_t  len , bool  persistent )
180+ ZEND_API  zend_always_inline  zend_string  * zend_string_alloc (size_t  len , bool  persistent )
180181{
181182	zend_string  * ret  =  (zend_string  * )pemalloc (ZEND_MM_ALIGNED_SIZE (_ZSTR_STRUCT_SIZE (len )), persistent );
182183
@@ -187,6 +188,16 @@ static zend_always_inline zend_string *zend_string_alloc(size_t len, bool persis
187188	return  ret ;
188189}
189190
191+ ZEND_API  zend_always_inline  zend_string  * zend_string_init (const  char  * str , size_t  len , bool  persistent )
192+ {
193+ 	zend_string  * ret  =  zend_string_alloc (len , persistent );
194+ 
195+ 	memcpy (ZSTR_VAL (ret ), str , len );
196+ 	ZSTR_VAL (ret )[len ] =  '\0' ;
197+ 	return  ret ;
198+ }
199+ END_EXTERN_C ()
200+ 
190201static  zend_always_inline  zend_string  * zend_string_safe_alloc (size_t  n , size_t  m , size_t  l , bool  persistent )
191202{
192203	zend_string  * ret  =  (zend_string  * )safe_pemalloc (n , m , ZEND_MM_ALIGNED_SIZE (_ZSTR_STRUCT_SIZE (l )), persistent );
@@ -198,15 +209,6 @@ static zend_always_inline zend_string *zend_string_safe_alloc(size_t n, size_t m
198209	return  ret ;
199210}
200211
201- static  zend_always_inline  zend_string  * zend_string_init (const  char  * str , size_t  len , bool  persistent )
202- {
203- 	zend_string  * ret  =  zend_string_alloc (len , persistent );
204- 
205- 	memcpy (ZSTR_VAL (ret ), str , len );
206- 	ZSTR_VAL (ret )[len ] =  '\0' ;
207- 	return  ret ;
208- }
209- 
210212static  zend_always_inline  zend_string  * zend_string_init_fast (const  char  * str , size_t  len )
211213{
212214	if  (len  >  1 ) {
@@ -218,15 +220,16 @@ static zend_always_inline zend_string *zend_string_init_fast(const char *str, si
218220	}
219221}
220222
221- static  zend_always_inline  zend_string  * zend_string_copy (zend_string  * s )
223+ BEGIN_EXTERN_C ()
224+ ZEND_API  inline  zend_string  * zend_string_copy (zend_string  * s )
222225{
223226	if  (!ZSTR_IS_INTERNED (s )) {
224227		GC_ADDREF (s );
225228	}
226229	return  s ;
227230}
228231
229- static  zend_always_inline  zend_string  * zend_string_dup (zend_string  * s , bool  persistent )
232+ ZEND_API  zend_always_inline  zend_string  * zend_string_dup (zend_string  * s , bool  persistent )
230233{
231234	if  (ZSTR_IS_INTERNED (s )) {
232235		return  s ;
@@ -235,7 +238,7 @@ static zend_always_inline zend_string *zend_string_dup(zend_string *s, bool pers
235238	}
236239}
237240
238- static  zend_always_inline  zend_string  * zend_string_separate (zend_string  * s , bool  persistent )
241+ ZEND_API  zend_always_inline  zend_string  * zend_string_separate (zend_string  * s , bool  persistent )
239242{
240243	if  (ZSTR_IS_INTERNED (s ) ||  GC_REFCOUNT (s ) >  1 ) {
241244		if  (!ZSTR_IS_INTERNED (s )) {
@@ -248,7 +251,7 @@ static zend_always_inline zend_string *zend_string_separate(zend_string *s, bool
248251	return  s ;
249252}
250253
251- static  zend_always_inline  zend_string  * zend_string_realloc (zend_string  * s , size_t  len , bool  persistent )
254+ ZEND_API  zend_always_inline  zend_string  * zend_string_realloc (zend_string  * s , size_t  len , bool  persistent )
252255{
253256	zend_string  * ret ;
254257
@@ -267,6 +270,7 @@ static zend_always_inline zend_string *zend_string_realloc(zend_string *s, size_
267270	}
268271	return  ret ;
269272}
273+ END_EXTERN_C ()
270274
271275static  zend_always_inline  zend_string  * zend_string_extend (zend_string  * s , size_t  len , bool  persistent )
272276{
@@ -370,31 +374,31 @@ static zend_always_inline void zend_string_release_ex(zend_string *s, bool persi
370374	}
371375}
372376
373- static  zend_always_inline  bool  zend_string_equals_cstr (const  zend_string  * s1 , const  char  * s2 , size_t  s2_length )
377+ BEGIN_EXTERN_C ()
378+ ZEND_API  zend_always_inline  bool  zend_string_equals_cstr (const  zend_string  * s1 , const  char  * s2 , size_t  s2_length )
374379{
375380	return  ZSTR_LEN (s1 ) ==  s2_length  &&  !memcmp (ZSTR_VAL (s1 ), s2 , s2_length );
376381}
377382
378383#if  defined(__GNUC__ ) &&  (defined(__i386__ ) ||  (defined(__x86_64__ ) &&  !defined(__ILP32__ )))
379- BEGIN_EXTERN_C ()
380384ZEND_API  bool  ZEND_FASTCALL  zend_string_equal_val (const  zend_string  * s1 , const  zend_string  * s2 );
381- END_EXTERN_C ()
382385#else 
383- static  zend_always_inline  bool  zend_string_equal_val (const  zend_string  * s1 , const  zend_string  * s2 )
386+ ZEND_API  zend_always_inline  bool  zend_string_equal_val (const  zend_string  * s1 , const  zend_string  * s2 )
384387{
385388	return  !memcmp (ZSTR_VAL (s1 ), ZSTR_VAL (s2 ), ZSTR_LEN (s1 ));
386389}
387390#endif 
388391
389- static  zend_always_inline  bool  zend_string_equal_content (const  zend_string  * s1 , const  zend_string  * s2 )
392+ ZEND_API  zend_always_inline  bool  zend_string_equal_content (const  zend_string  * s1 , const  zend_string  * s2 )
390393{
391394	return  ZSTR_LEN (s1 ) ==  ZSTR_LEN (s2 ) &&  zend_string_equal_val (s1 , s2 );
392395}
393396
394- static  zend_always_inline  bool  zend_string_equals (const  zend_string  * s1 , const  zend_string  * s2 )
397+ ZEND_API  zend_always_inline  bool  zend_string_equals (const  zend_string  * s1 , const  zend_string  * s2 )
395398{
396399	return  s1  ==  s2  ||  zend_string_equal_content (s1 , s2 );
397400}
401+ END_EXTERN_C ()
398402
399403#define  zend_string_equals_ci (s1 , s2 ) \
400404	(ZSTR_LEN(s1) == ZSTR_LEN(s2) && !zend_binary_strcasecmp(ZSTR_VAL(s1), ZSTR_LEN(s1), ZSTR_VAL(s2), ZSTR_LEN(s2)))
0 commit comments