CAFE
Computational Analysis of gene Family Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utils_string.h
Go to the documentation of this file.
1 #ifndef __UTILS_STRING_H__
2 #define __UTILS_STRING_H__
3 
4 #define STRING_STEP_SIZE 2048
5 #define STRING_BUF_SIZE 131072
6 
7 #include "utils.h"
8 
9 typedef struct
10 {
11  char* buf;
12  size_t length;
13  size_t alloc_size;
14 }String;
15 typedef String* pString;
16 
17 extern pString string_new_step(size_t step);
18 extern pString string_new();
19 extern pString string_new_with_string(const char* newstr );
20 extern void string_free(pString pstr);
21 extern void string_free_without_data(pString pstr);
22 extern void string_reset(pString pstr);
23 extern void string_add(pString pstr, const char* add);
24 extern void string_fadd(pString pstr, const char* msg, ...);
25 extern void string_trim(pString pstr);
26 extern char* string_get(pString pstr);
27 
28 extern char* string_pchar_chomp(char* pstr);
29 extern int string_pchar_cmp_ignore_case(char* cmp1, char* cmp2);
30 extern pArrayList string_pchar_split(char* buf, char delim);
31 extern pArrayList string_pchar_space_split(char* buf);
32 extern void string_pchar_join_double(char* rtn, const char* sp, int argc, double* values);
33 extern void string_pchar_join(char* buf, char* stuff, int num, char** list);
34 extern pString string_join(const char* stuff, int num, char** list);
35 
36 #endif
pString string_new()
Definition: utils_string.c:16
char * string_get(pString pstr)
Definition: utils_string.c:97
size_t alloc_size
Definition: utils_string.h:13
void string_free_without_data(pString pstr)
Definition: utils_string.c:39
pArrayList string_pchar_space_split(char *buf)
Definition: utils_string.c:195
Definition: utils_string.h:9
void string_fadd(pString pstr, const char *msg,...)
Definition: utils_string.c:68
char * buf
Definition: utils_string.h:11
size_t length
Definition: utils_string.h:12
pString string_new_step(size_t step)
Definition: utils_string.c:6
void string_reset(pString pstr)
Definition: utils_string.c:45
void string_pchar_join_double(char *rtn, const char *sp, int argc, double *values)
Definition: utils_string.c:227
char * string_pchar_chomp(char *pstr)
Definition: utils_string.c:112
void string_add(pString pstr, const char *add)
Definition: utils_string.c:51
pString string_new_with_string(const char *newstr)
Definition: utils_string.c:21
int string_pchar_cmp_ignore_case(char *cmp1, char *cmp2)
Definition: utils_string.c:136
pString string_join(const char *stuff, int num, char **list)
Definition: utils_string.c:250
Definition: utils.h:12
void string_trim(pString pstr)
Definition: utils_string.c:79
pArrayList string_pchar_split(char *buf, char delim)
Definition: utils_string.c:158
void string_pchar_join(char *buf, char *stuff, int num, char **list)
Definition: utils_string.c:239
String * pString
Definition: utils_string.h:15
void string_free(pString pstr)
Definition: utils_string.c:31