aboutsummaryrefslogtreecommitdiff
path: root/09-september/tomcat/util/str.h
blob: d8182e1c2c4461a26a4a4ed5149a4c41c3206df4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef STR_H
#define STR_H

#include <stdbool.h>

typedef struct _String
{
    char *data;
    unsigned int length;
    unsigned int allocated_length;
} String;

extern String *string_create( const char *init );
extern String *string_create_by_size( unsigned int reserved_size);

extern void string_assign( String *string_, const char *val );

extern void string_append( String *string_, const char *val );
extern void string_append_char( String *string_, char c );

extern void string_insert( String *string_, int index, const char *val);
extern void string_insert_char( String *string_, int index, char val);

extern void string_free( String *string_ );

extern unsigned int string_hash( String *string_ );
extern bool string_equal( String *a, String *b );

#endif // STR_H