Go to the documentation of this file.00001 #ifndef _CP_STRING_H
00002 #define _CP_STRING_H
00003
00004
00005
00006
00007
00008
00009
00010 #include "common.h"
00011
00012 __BEGIN_DECLS
00013
00014 #include "config.h"
00015
00016
00017 typedef CPROPS_DLL struct _cp_string
00018 {
00019 int size;
00020 int len;
00021 char *data;
00022 } cp_string;
00023
00024
00025 CPROPS_DLL
00026 cp_string *cp_string_create(char *data, int len);
00027
00028 CPROPS_DLL
00029 cp_string *cp_string_create_empty(int initial_size);
00030
00031 CPROPS_DLL
00032 void cp_string_delete(cp_string *str);
00033
00034
00035
00036
00037
00038 CPROPS_DLL
00039 void cp_string_drop_wrap(cp_string *str);
00040 CPROPS_DLL
00041 void cp_string_drop_content(char *content);
00042
00043
00044 CPROPS_DLL
00045 void cp_string_destroy(cp_string *str);
00046
00047 CPROPS_DLL
00048 void cp_string_clear(cp_string *str);
00049
00050 CPROPS_DLL
00051 void cp_string_reset(cp_string *str);
00052
00053 CPROPS_DLL
00054 cp_string *cp_string_cstrcpy(cp_string *str, char *cstr);
00055
00056 CPROPS_DLL
00057 cp_string *cp_string_cpy(cp_string *dst, cp_string *src);
00058
00059 CPROPS_DLL
00060 cp_string *cp_string_dup(cp_string *src);
00061
00062 CPROPS_DLL
00063 cp_string *cp_string_cstrdup(char *src);
00064
00065 CPROPS_DLL
00066 cp_string *cp_string_cat(cp_string *str, cp_string *appendum);
00067
00068 CPROPS_DLL
00069 cp_string *cp_string_cat_bin(cp_string *str, void *bin, int len);
00070
00071 CPROPS_DLL
00072 cp_string *cp_string_cstrcat(cp_string *str, char *cstr);
00073
00074 CPROPS_DLL
00075 cp_string *cp_string_append_char(cp_string *str, char ch);
00076
00077 CPROPS_DLL
00078 int cp_string_cmp(cp_string *s1, cp_string *s2);
00079
00080 CPROPS_DLL
00081 char *cp_string_tocstr(cp_string *str);
00082
00083 CPROPS_DLL
00084 int cp_string_len(cp_string *s);
00085
00086 CPROPS_DLL
00087 char *cp_string_data(cp_string *s);
00088
00089
00090 CPROPS_DLL
00091 cp_string *cp_string_read(int fd, int len);
00092
00093 CPROPS_DLL
00094 int cp_string_write(cp_string *str, int fd);
00095
00096 CPROPS_DLL
00097 cp_string *cp_string_read_file(char *filename);
00098
00099 CPROPS_DLL
00100 int cp_string_write_file(cp_string *str, char *filename);
00101
00102
00103 CPROPS_DLL
00104 void cp_string_flip(cp_string *str);
00105
00106 CPROPS_DLL
00107 cp_string *cp_string_filter(cp_string *str, char *letters);
00108
00109
00110 CPROPS_DLL
00111 void cp_string_dump(cp_string *str);
00112
00113 __END_DECLS
00114
00115
00116
00117 #endif
00118