Cp_string


Files

file  str.c
__BEGIN_DECLS typedef CPROPS_DLL
struct _cp_string 
cp_string

Defines

#define CHUNK   0x1000
#define LINELEN   81
#define CHARS_PER_LINE   16

Functions

cp_stringcp_string_create (char *data, int len)
cp_stringcp_string_create_empty (int initial_size)
void cp_string_delete (cp_string *str)
void cp_string_drop_wrap (cp_string *str)
void cp_string_drop_content (char *str)
void cp_string_destroy (cp_string *str)
void cp_string_clear (cp_string *str)
void cp_string_reset (cp_string *str)
cp_stringcp_string_cstrcpy (cp_string *str, char *cstr)
cp_stringcp_string_cpy (cp_string *dst, cp_string *src)
cp_stringcp_string_dup (cp_string *src)
cp_stringcp_string_cstrdup (char *src)
cp_stringcp_string_cat (cp_string *str, cp_string *appendum)
cp_stringcp_string_cstrcat (cp_string *str, char *cstr)
cp_stringcp_string_append_char (cp_string *str, char ch)
cp_stringcp_string_cat_bin (cp_string *str, void *bin, int len)
int cp_string_cmp (cp_string *s1, cp_string *s2)
char * cp_string_tocstr (cp_string *str)
int cp_string_len (cp_string *s)
char * cp_string_data (cp_string *s)
cp_stringcp_string_read (int fd, int len)
int cp_string_write (cp_string *str, int fd)
cp_stringcp_string_read_file (char *filename)
int cp_string_write_file (cp_string *str, char *filename)
void cp_string_dump (cp_string *str)
void cp_string_flip (cp_string *str)
cp_stringcp_string_filter (cp_string *str, char *letters)

Function Documentation

cp_string* cp_string_append_char ( cp_string str,
char  ch 
)

append a character to a string

Definition at line 235 of file str.c.

cp_string* cp_string_cat ( cp_string str,
cp_string appendum 
)

concatenate cp_strings

Definition at line 201 of file str.c.

cp_string* cp_string_cat_bin ( cp_string str,
void *  bin,
int  len 
)

append data from a buffer

Definition at line 248 of file str.c.

Referenced by cp_client_read_string(), and cp_string_read().

void cp_string_clear ( cp_string str  ) 

sets string to 0

Definition at line 103 of file str.c.

References cp_string.

int cp_string_cmp ( cp_string s1,
cp_string s2 
)

compare cp_strings

Definition at line 263 of file str.c.

cp_string* cp_string_cpy ( cp_string dst,
cp_string src 
)

copies the content of a cp_string

Definition at line 145 of file str.c.

cp_string* cp_string_create ( char *  data,
int  len 
)

allocate a new cp_string

Definition at line 26 of file str.c.

References cp_error(), CP_INVALID_VALUE, CP_MEMORY_ALLOCATION_FAILURE, and cp_string.

Referenced by cp_db_connection_unescape_binary(), cp_string_read(), and cp_url_descriptor_parse().

cp_string* cp_string_create_empty ( int  initial_size  ) 

allocate an empty cp_string with a given buffer size

Definition at line 58 of file str.c.

References cp_string.

cp_string* cp_string_cstrcat ( cp_string str,
char *  cstr 
)

append data from a null terminated c string

Definition at line 217 of file str.c.

cp_string* cp_string_cstrcpy ( cp_string str,
char *  cstr 
)

copies the content of a null terminated c string

Definition at line 123 of file str.c.

cp_string* cp_string_cstrdup ( char *  src  ) 

creates a cp_string with src as its content

Definition at line 181 of file str.c.

References cp_string.

char* cp_string_data ( cp_string s  ) 

return the internal buffer

Definition at line 301 of file str.c.

void cp_string_delete ( cp_string str  ) 

deallocate a cp_string

Definition at line 77 of file str.c.

Referenced by cp_http_response_delete(), and cp_string_destroy().

void cp_string_destroy ( cp_string str  ) 

synonym for cp_string_delete

Definition at line 98 of file str.c.

References cp_string_delete().

Referenced by cp_http_transfer_descriptor_destroy(), cp_httpclient_fetch(), and cp_result_set_release_row().

void cp_string_dump ( cp_string str  ) 

dump a cp_string to stdout

Definition at line 414 of file str.c.

References CHARS_PER_LINE, and LINELEN.

cp_string* cp_string_dup ( cp_string src  ) 

creates a copy of src string. internal buffer is duplicated.

Definition at line 161 of file str.c.

References cp_string.

cp_string* cp_string_filter ( cp_string str,
char *  letters 
)

remove all occurrences of letters from str

Definition at line 494 of file str.c.

void cp_string_flip ( cp_string str  ) 

flip the contents of a cp_string

Definition at line 475 of file str.c.

int cp_string_len ( cp_string s  ) 

return the length of the internal buffer

Definition at line 296 of file str.c.

Referenced by cp_client_write_string().

cp_string* cp_string_read ( int  fd,
int  len 
)

read len bytes from an open file descriptor (blocking)

Definition at line 307 of file str.c.

References CHUNK, cp_string, cp_string_cat_bin(), and cp_string_create().

Referenced by cp_string_read_file().

cp_string* cp_string_read_file ( char *  filename  ) 

read the contents of a file into a cp_string

Definition at line 369 of file str.c.

References cp_string, and cp_string_read().

void cp_string_reset ( cp_string str  ) 

releases existing string and sets string to empty string

Definition at line 109 of file str.c.

char* cp_string_tocstr ( cp_string str  ) 

return a pointer to the internal buffer

Definition at line 282 of file str.c.

Referenced by cp_client_write_string(), and cp_url_descriptor_parse().

int cp_string_write ( cp_string str,
int  fd 
)

write the content of a cp_string to a file descriptor (blocking)

Definition at line 339 of file str.c.

Referenced by cp_string_write_file().

int cp_string_write_file ( cp_string str,
char *  filename 
)

write the contents of a cp_string to a file

Definition at line 381 of file str.c.

References cp_string_write().


Variable Documentation

__BEGIN_DECLS typedef CPROPS_DLL struct _cp_string cp_string

cp_string definition

Referenced by cp_db_connection_execute_statement(), cp_db_connection_execute_statement_args(), cp_httpclient_fetch(), cp_string_clear(), cp_string_create(), cp_string_create_empty(), cp_string_cstrdup(), cp_string_dup(), cp_string_read(), cp_string_read_file(), and cp_url_descriptor_parse().


Generated on Mon Dec 5 23:00:23 2011 for cprops by  doxygen 1.4.7