php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
str.h File Reference

Go to the source code of this file.

Data Structures

struct  lexbor_str_t
 

Macros

#define lexbor_str_get(str, attr)
 
#define lexbor_str_set(str, attr)
 
#define lexbor_str_len(str)
 
#define lexbor_str(p)
 
#define lexbor_str_check_size_arg_m(str, size, mraw, plus_len, return_fail)
 

Functions

LXB_API lexbor_str_tlexbor_str_create (void)
 
LXB_API lxb_char_tlexbor_str_init (lexbor_str_t *str, lexbor_mraw_t *mraw, size_t size)
 
LXB_API lxb_char_tlexbor_str_init_append (lexbor_str_t *str, lexbor_mraw_t *mraw, const lxb_char_t *data, size_t length)
 
LXB_API void lexbor_str_clean (lexbor_str_t *str)
 
LXB_API void lexbor_str_clean_all (lexbor_str_t *str)
 
LXB_API lexbor_str_tlexbor_str_destroy (lexbor_str_t *str, lexbor_mraw_t *mraw, bool destroy_obj)
 
LXB_API lxb_char_tlexbor_str_realloc (lexbor_str_t *str, lexbor_mraw_t *mraw, size_t new_size)
 
LXB_API lxb_char_tlexbor_str_check_size (lexbor_str_t *str, lexbor_mraw_t *mraw, size_t plus_len)
 
LXB_API lxb_char_tlexbor_str_append (lexbor_str_t *str, lexbor_mraw_t *mraw, const lxb_char_t *data, size_t length)
 
LXB_API lxb_char_tlexbor_str_append_before (lexbor_str_t *str, lexbor_mraw_t *mraw, const lxb_char_t *buff, size_t length)
 
LXB_API lxb_char_tlexbor_str_append_one (lexbor_str_t *str, lexbor_mraw_t *mraw, const lxb_char_t data)
 
LXB_API lxb_char_tlexbor_str_append_lowercase (lexbor_str_t *str, lexbor_mraw_t *mraw, const lxb_char_t *data, size_t length)
 
LXB_API lxb_char_tlexbor_str_append_with_rep_null_chars (lexbor_str_t *str, lexbor_mraw_t *mraw, const lxb_char_t *buff, size_t length)
 
LXB_API lxb_char_tlexbor_str_copy (lexbor_str_t *dest, const lexbor_str_t *target, lexbor_mraw_t *mraw)
 
LXB_API void lexbor_str_stay_only_whitespace (lexbor_str_t *target)
 
LXB_API void lexbor_str_strip_collapse_whitespace (lexbor_str_t *target)
 
LXB_API size_t lexbor_str_crop_whitespace_from_begin (lexbor_str_t *target)
 
LXB_API size_t lexbor_str_whitespace_from_begin (lexbor_str_t *target)
 
LXB_API size_t lexbor_str_whitespace_from_end (lexbor_str_t *target)
 
LXB_API const lxb_char_tlexbor_str_data_ncasecmp_first (const lxb_char_t *first, const lxb_char_t *sec, size_t sec_size)
 
LXB_API bool lexbor_str_data_ncasecmp_end (const lxb_char_t *first, const lxb_char_t *sec, size_t size)
 
LXB_API bool lexbor_str_data_ncasecmp_contain (const lxb_char_t *where, size_t where_size, const lxb_char_t *what, size_t what_size)
 
LXB_API bool lexbor_str_data_ncasecmp (const lxb_char_t *first, const lxb_char_t *sec, size_t size)
 
LXB_API bool lexbor_str_data_nlocmp_right (const lxb_char_t *first, const lxb_char_t *sec, size_t size)
 
LXB_API bool lexbor_str_data_nupcmp_right (const lxb_char_t *first, const lxb_char_t *sec, size_t size)
 
LXB_API bool lexbor_str_data_casecmp (const lxb_char_t *first, const lxb_char_t *sec)
 
LXB_API bool lexbor_str_data_ncmp_end (const lxb_char_t *first, const lxb_char_t *sec, size_t size)
 
LXB_API bool lexbor_str_data_ncmp_contain (const lxb_char_t *where, size_t where_size, const lxb_char_t *what, size_t what_size)
 
LXB_API bool lexbor_str_data_ncmp (const lxb_char_t *first, const lxb_char_t *sec, size_t size)
 
LXB_API bool lexbor_str_data_cmp (const lxb_char_t *first, const lxb_char_t *sec)
 
LXB_API bool lexbor_str_data_cmp_ws (const lxb_char_t *first, const lxb_char_t *sec)
 
LXB_API void lexbor_str_data_to_lowercase (lxb_char_t *to, const lxb_char_t *from, size_t len)
 
LXB_API void lexbor_str_data_to_uppercase (lxb_char_t *to, const lxb_char_t *from, size_t len)
 
LXB_API const lxb_char_tlexbor_str_data_find_lowercase (const lxb_char_t *data, size_t len)
 
LXB_API const lxb_char_tlexbor_str_data_find_uppercase (const lxb_char_t *data, size_t len)
 
lxb_inline lxb_char_tlexbor_str_data (lexbor_str_t *str)
 
lxb_inline size_t lexbor_str_length (lexbor_str_t *str)
 
lxb_inline size_t lexbor_str_size (lexbor_str_t *str)
 
lxb_inline void lexbor_str_data_set (lexbor_str_t *str, lxb_char_t *data)
 
lxb_inline lxb_char_tlexbor_str_length_set (lexbor_str_t *str, lexbor_mraw_t *mraw, size_t length)
 
LXB_API lxb_char_tlexbor_str_data_noi (lexbor_str_t *str)
 
LXB_API size_t lexbor_str_length_noi (lexbor_str_t *str)
 
LXB_API size_t lexbor_str_size_noi (lexbor_str_t *str)
 
LXB_API void lexbor_str_data_set_noi (lexbor_str_t *str, lxb_char_t *data)
 
LXB_API lxb_char_tlexbor_str_length_set_noi (lexbor_str_t *str, lexbor_mraw_t *mraw, size_t length)
 

Macro Definition Documentation

◆ lexbor_str

#define lexbor_str ( p)
Value:
{.data = (lxb_char_t *) (p), sizeof(p) - 1}
p
Definition session.c:1105
unsigned char lxb_char_t
Definition types.h:27

Definition at line 22 of file str.h.

◆ lexbor_str_check_size_arg_m

#define lexbor_str_check_size_arg_m ( str,
size,
mraw,
plus_len,
return_fail )
Value:
do { \
void *tmp; \
\
if (str->length > (SIZE_MAX - (plus_len))) \
return (return_fail); \
\
if ((str->length + (plus_len)) > (size)) { \
tmp = lexbor_mraw_realloc(mraw, str->data, \
(str->length + plus_len)); \
\
if (tmp == NULL) { \
return (return_fail); \
} \
\
str->data = (lxb_char_t *) tmp; \
} \
} \
while (0)
new_type size
Definition ffi.c:4365
#define SIZE_MAX
Definition funcs.c:51
#define NULL
Definition gdcache.h:45
void * lexbor_mraw_realloc(lexbor_mraw_t *mraw, void *data, size_t new_size)
Definition mraw.c:315

Definition at line 25 of file str.h.

◆ lexbor_str_get

#define lexbor_str_get ( str,
attr )
Value:
str->attr

Definition at line 19 of file str.h.

◆ lexbor_str_len

#define lexbor_str_len ( str)
Value:
lexbor_str_get(str, length)
#define lexbor_str_get(str, attr)
Definition str.h:19

Definition at line 21 of file str.h.

◆ lexbor_str_set

#define lexbor_str_set ( str,
attr )
Value:
new_type attr
Definition ffi.c:4364

Definition at line 20 of file str.h.

Function Documentation

◆ lexbor_str_append()

LXB_API lxb_char_t * lexbor_str_append ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
const lxb_char_t * data,
size_t length )

Definition at line 131 of file str.c.

◆ lexbor_str_append_before()

LXB_API lxb_char_t * lexbor_str_append_before ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
const lxb_char_t * buff,
size_t length )

Definition at line 149 of file str.c.

◆ lexbor_str_append_lowercase()

LXB_API lxb_char_t * lexbor_str_append_lowercase ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
const lxb_char_t * data,
size_t length )

Definition at line 183 of file str.c.

◆ lexbor_str_append_one()

LXB_API lxb_char_t * lexbor_str_append_one ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
const lxb_char_t data )

Definition at line 169 of file str.c.

◆ lexbor_str_append_with_rep_null_chars()

LXB_API lxb_char_t * lexbor_str_append_with_rep_null_chars ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
const lxb_char_t * buff,
size_t length )

Definition at line 205 of file str.c.

◆ lexbor_str_check_size()

LXB_API lxb_char_t * lexbor_str_check_size ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
size_t plus_len )

Definition at line 107 of file str.c.

◆ lexbor_str_clean()

LXB_API void lexbor_str_clean ( lexbor_str_t * str)

Definition at line 64 of file str.c.

◆ lexbor_str_clean_all()

LXB_API void lexbor_str_clean_all ( lexbor_str_t * str)

Definition at line 70 of file str.c.

◆ lexbor_str_copy()

LXB_API lxb_char_t * lexbor_str_copy ( lexbor_str_t * dest,
const lexbor_str_t * target,
lexbor_mraw_t * mraw )

Definition at line 247 of file str.c.

◆ lexbor_str_create()

LXB_API lexbor_str_t * lexbor_str_create ( void )

Definition at line 16 of file str.c.

◆ lexbor_str_crop_whitespace_from_begin()

LXB_API size_t lexbor_str_crop_whitespace_from_begin ( lexbor_str_t * target)

Definition at line 328 of file str.c.

◆ lexbor_str_data()

lxb_inline lxb_char_t * lexbor_str_data ( lexbor_str_t * str)

Definition at line 187 of file str.h.

◆ lexbor_str_data_casecmp()

LXB_API bool lexbor_str_data_casecmp ( const lxb_char_t * first,
const lxb_char_t * sec )

Definition at line 476 of file str.c.

◆ lexbor_str_data_cmp()

LXB_API bool lexbor_str_data_cmp ( const lxb_char_t * first,
const lxb_char_t * sec )

Definition at line 530 of file str.c.

◆ lexbor_str_data_cmp_ws()

LXB_API bool lexbor_str_data_cmp_ws ( const lxb_char_t * first,
const lxb_char_t * sec )

Definition at line 547 of file str.c.

◆ lexbor_str_data_find_lowercase()

LXB_API const lxb_char_t * lexbor_str_data_find_lowercase ( const lxb_char_t * data,
size_t len )

Definition at line 584 of file str.c.

◆ lexbor_str_data_find_uppercase()

LXB_API const lxb_char_t * lexbor_str_data_find_uppercase ( const lxb_char_t * data,
size_t len )

Definition at line 598 of file str.c.

◆ lexbor_str_data_ncasecmp()

LXB_API bool lexbor_str_data_ncasecmp ( const lxb_char_t * first,
const lxb_char_t * sec,
size_t size )

Definition at line 435 of file str.c.

◆ lexbor_str_data_ncasecmp_contain()

LXB_API bool lexbor_str_data_ncasecmp_contain ( const lxb_char_t * where,
size_t where_size,
const lxb_char_t * what,
size_t what_size )

Definition at line 422 of file str.c.

◆ lexbor_str_data_ncasecmp_end()

LXB_API bool lexbor_str_data_ncasecmp_end ( const lxb_char_t * first,
const lxb_char_t * sec,
size_t size )

Definition at line 405 of file str.c.

◆ lexbor_str_data_ncasecmp_first()

LXB_API const lxb_char_t * lexbor_str_data_ncasecmp_first ( const lxb_char_t * first,
const lxb_char_t * sec,
size_t sec_size )

Definition at line 384 of file str.c.

◆ lexbor_str_data_ncmp()

LXB_API bool lexbor_str_data_ncmp ( const lxb_char_t * first,
const lxb_char_t * sec,
size_t size )

Definition at line 523 of file str.c.

◆ lexbor_str_data_ncmp_contain()

LXB_API bool lexbor_str_data_ncmp_contain ( const lxb_char_t * where,
size_t where_size,
const lxb_char_t * what,
size_t what_size )

Definition at line 510 of file str.c.

◆ lexbor_str_data_ncmp_end()

LXB_API bool lexbor_str_data_ncmp_end ( const lxb_char_t * first,
const lxb_char_t * sec,
size_t size )

Definition at line 495 of file str.c.

◆ lexbor_str_data_nlocmp_right()

LXB_API bool lexbor_str_data_nlocmp_right ( const lxb_char_t * first,
const lxb_char_t * sec,
size_t size )

Definition at line 450 of file str.c.

◆ lexbor_str_data_noi()

LXB_API lxb_char_t * lexbor_str_data_noi ( lexbor_str_t * str)

Definition at line 615 of file str.c.

◆ lexbor_str_data_nupcmp_right()

LXB_API bool lexbor_str_data_nupcmp_right ( const lxb_char_t * first,
const lxb_char_t * sec,
size_t size )

Definition at line 463 of file str.c.

◆ lexbor_str_data_set()

lxb_inline void lexbor_str_data_set ( lexbor_str_t * str,
lxb_char_t * data )

Definition at line 205 of file str.h.

◆ lexbor_str_data_set_noi()

LXB_API void lexbor_str_data_set_noi ( lexbor_str_t * str,
lxb_char_t * data )

Definition at line 633 of file str.c.

◆ lexbor_str_data_to_lowercase()

LXB_API void lexbor_str_data_to_lowercase ( lxb_char_t * to,
const lxb_char_t * from,
size_t len )

Definition at line 564 of file str.c.

◆ lexbor_str_data_to_uppercase()

LXB_API void lexbor_str_data_to_uppercase ( lxb_char_t * to,
const lxb_char_t * from,
size_t len )

Definition at line 574 of file str.c.

◆ lexbor_str_destroy()

LXB_API lexbor_str_t * lexbor_str_destroy ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
bool destroy_obj )

Definition at line 76 of file str.c.

◆ lexbor_str_init()

LXB_API lxb_char_t * lexbor_str_init ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
size_t size )

Definition at line 22 of file str.c.

◆ lexbor_str_init_append()

LXB_API lxb_char_t * lexbor_str_init_append ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
const lxb_char_t * data,
size_t length )

Definition at line 39 of file str.c.

◆ lexbor_str_length()

lxb_inline size_t lexbor_str_length ( lexbor_str_t * str)

Definition at line 193 of file str.h.

◆ lexbor_str_length_noi()

LXB_API size_t lexbor_str_length_noi ( lexbor_str_t * str)

Definition at line 621 of file str.c.

◆ lexbor_str_length_set()

lxb_inline lxb_char_t * lexbor_str_length_set ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
size_t length )

Definition at line 211 of file str.h.

◆ lexbor_str_length_set_noi()

LXB_API lxb_char_t * lexbor_str_length_set_noi ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
size_t length )

Definition at line 639 of file str.c.

◆ lexbor_str_realloc()

LXB_API lxb_char_t * lexbor_str_realloc ( lexbor_str_t * str,
lexbor_mraw_t * mraw,
size_t new_size )

Definition at line 94 of file str.c.

◆ lexbor_str_size()

lxb_inline size_t lexbor_str_size ( lexbor_str_t * str)

Definition at line 199 of file str.h.

◆ lexbor_str_size_noi()

LXB_API size_t lexbor_str_size_noi ( lexbor_str_t * str)

Definition at line 627 of file str.c.

◆ lexbor_str_stay_only_whitespace()

LXB_API void lexbor_str_stay_only_whitespace ( lexbor_str_t * target)

Definition at line 266 of file str.c.

◆ lexbor_str_strip_collapse_whitespace()

LXB_API void lexbor_str_strip_collapse_whitespace ( lexbor_str_t * target)

Definition at line 282 of file str.c.

◆ lexbor_str_whitespace_from_begin()

LXB_API size_t lexbor_str_whitespace_from_begin ( lexbor_str_t * target)

Definition at line 348 of file str.c.

◆ lexbor_str_whitespace_from_end()

LXB_API size_t lexbor_str_whitespace_from_end ( lexbor_str_t * target)

Definition at line 363 of file str.c.