1 /* udstr.h: 2 * 3 **************************************************************** 4 * Copyright (C) 2004 Tom Lord 5 * 6 * See the file "COPYING" for further information about 7 * the copyright and warranty status of this work. 8 */ 9 10 #ifndef INCLUDE__STRINGS__UDSTR_H 11 #define INCLUDE__STRINGS__UDSTR_H 12 13 14 #include "hackerlab/strings/ustr.h" 15 16 17 18 19 struct udstr_handle; 20 typedef struct udstr_handle * t_udstr; 21 22 23 24 /* automatically generated __STDC__ prototypes */ 25 extern t_udstr udstr_save (alloc_limits limits, 26 uni_string str, 27 enum uni_encoding_scheme enc); 28 extern t_udstr udstr_save_n (alloc_limits limits, 29 uni_string str, 30 enum uni_encoding_scheme enc, 31 ustr_cv_index_t len); 32 extern t_udstr udstr_save_fw (alloc_limits limits, 33 uni_string str, 34 enum uni_encoding_scheme enc); 35 extern t_udstr udstr_save_fw_n (alloc_limits limits, 36 uni_string str, 37 enum uni_encoding_scheme enc, 38 ustr_cv_index_t len); 39 extern t_udstr udstr_save_generic (alloc_limits limits, 40 enum uni_encoding_scheme dest_enc, 41 ustr_cv_index_t dest_len, 42 uni_string str, 43 enum uni_encoding_scheme enc, 44 ustr_cv_index_t len, 45 ustr_cp_index_t cp_len); 46 extern void udstr_ref (t_udstr d); 47 extern void udstr_unref (t_udstr d); 48 extern ustr_cv_index_t udstr_cv_length (t_udstr dstr); 49 extern ustr_cp_index_t udstr_cp_length (t_udstr dstr); 50 extern enum uni_encoding_scheme udstr_encoding (t_udstr dstr); 51 extern uni_string udstr_str (t_udstr dstr); 52 extern t_unicode udstr_cv_ref (ustr_cv_index_t * pos_after, 53 t_udstr dstr, 54 ustr_cv_index_t pos); 55 extern t_unicode udstr_cp_ref (ustr_cv_index_t * pos_after, 56 t_udstr dstr, 57 ustr_cp_index_t pos); 58 extern t_udstr udstr_cv_set (alloc_limits limits, 59 t_udstr s, 60 ustr_cv_index_t x, 61 t_unicode c); 62 extern t_udstr udstr_cv_set_fw (alloc_limits limits, 63 t_udstr s, 64 ustr_cv_index_t x, 65 t_unicode c); 66 extern t_udstr udstr_cp_set (alloc_limits limits, 67 t_udstr s, 68 ustr_cp_index_t x, 69 t_unicode c); 70 extern t_udstr udstr_cp_set_fw (alloc_limits limits, 71 t_udstr s, 72 ustr_cp_index_t x, 73 t_unicode c); 74 extern t_udstr udstr_fw_x (t_udstr d); 75 extern t_udstr udstr_copy (alloc_limits limits, t_udstr dstr); 76 extern t_udstr udstr_copy_fw (alloc_limits limits, t_udstr dstr); 77 extern t_udstr udstr_cv_substr (alloc_limits limits, 78 t_udstr dstr, 79 ustr_cv_index_t from, 80 ustr_cv_index_t to); 81 extern t_udstr udstr_cv_substr_x (t_udstr dstr, 82 ustr_cv_index_t from, 83 ustr_cv_index_t to); 84 extern t_udstr udstr_cv_substr_fw (alloc_limits limits, 85 t_udstr dstr, 86 ustr_cv_index_t from, 87 ustr_cv_index_t to); 88 extern t_udstr udstr_cv_substr_fw_x (t_udstr dstr, 89 ustr_cv_index_t from, 90 ustr_cv_index_t to); 91 extern t_udstr udstr_cp_substr (alloc_limits limits, 92 t_udstr dstr, 93 ustr_cp_index_t from, 94 ustr_cp_index_t to); 95 extern t_udstr udstr_cp_substr_x (t_udstr dstr, 96 ustr_cp_index_t from, 97 ustr_cp_index_t to); 98 extern t_udstr udstr_cp_substr_fw (alloc_limits limits, 99 t_udstr dstr, 100 ustr_cp_index_t from, 101 ustr_cp_index_t to); 102 extern t_udstr udstr_cp_substr_fw_x (t_udstr dstr, 103 ustr_cp_index_t from, 104 ustr_cp_index_t to); 105 extern t_udstr udstr_append (alloc_limits limits, 106 t_udstr a_dstr, 107 t_udstr b_dstr); 108 extern t_udstr udstr_append_x (t_udstr a_dstr, 109 t_udstr b_dstr); 110 extern t_udstr udstr_append_fw (alloc_limits limits, 111 t_udstr a_dstr, 112 t_udstr b_dstr); 113 extern t_udstr udstr_append_fw_x (t_udstr a_dstr, 114 t_udstr b_dstr); 115 extern t_udstr udstr_cv_delete (alloc_limits limits, 116 t_udstr d, 117 ustr_cv_index_t from, 118 ustr_cv_index_t to); 119 extern t_udstr udstr_cp_delete (alloc_limits limits, 120 t_udstr d, 121 ustr_cp_index_t from, 122 ustr_cp_index_t to); 123 extern t_udstr udstr_cv_delete_x (t_udstr d, 124 ustr_cv_index_t from, 125 ustr_cv_index_t to); 126 extern t_udstr udstr_cp_delete_x (t_udstr d, 127 ustr_cp_index_t from, 128 ustr_cp_index_t to); 129 extern t_udstr udstr_cv_delete_fw (alloc_limits limits, 130 t_udstr d, 131 ustr_cv_index_t from, 132 ustr_cv_index_t to); 133 extern t_udstr udstr_cp_delete_fw (alloc_limits limits, 134 t_udstr d, 135 ustr_cp_index_t from, 136 ustr_cp_index_t to); 137 extern t_udstr udstr_cv_delete_fw_x (t_udstr d, 138 ustr_cv_index_t from, 139 ustr_cv_index_t to); 140 extern t_udstr udstr_cp_delete_fw_x (t_udstr d, 141 ustr_cp_index_t from, 142 ustr_cp_index_t to); 143 extern t_udstr udstr_cv_replace (alloc_limits limits, 144 t_udstr into, 145 ustr_cv_index_t i_from, 146 ustr_cv_index_t i_to, 147 t_udstr from, 148 ustr_cv_index_t f_from, 149 ustr_cv_index_t f_to); 150 extern t_udstr udstr_cp_replace (alloc_limits limits, 151 t_udstr into, 152 ustr_cp_index_t i_from, 153 ustr_cp_index_t i_to, 154 t_udstr from, 155 ustr_cp_index_t f_from, 156 ustr_cp_index_t f_to); 157 extern t_udstr udstr_cv_replace_x (t_udstr into, 158 ustr_cv_index_t i_from, 159 ustr_cv_index_t i_to, 160 t_udstr from, 161 ustr_cv_index_t f_from, 162 ustr_cv_index_t f_to); 163 extern t_udstr udstr_cp_replace_x (t_udstr into, 164 ustr_cp_index_t i_from, 165 ustr_cp_index_t i_to, 166 t_udstr from, 167 ustr_cp_index_t f_from, 168 ustr_cp_index_t f_to); 169 extern t_udstr udstr_cv_replace_fw (alloc_limits limits, 170 t_udstr into, 171 ustr_cv_index_t i_from, 172 ustr_cv_index_t i_to, 173 t_udstr from, 174 ustr_cv_index_t f_from, 175 ustr_cv_index_t f_to); 176 extern t_udstr udstr_cp_replace_fw (alloc_limits limits, 177 t_udstr into, 178 ustr_cp_index_t i_from, 179 ustr_cp_index_t i_to, 180 t_udstr from, 181 ustr_cp_index_t f_from, 182 ustr_cp_index_t f_to); 183 extern t_udstr udstr_cv_replace_fw_x (t_udstr into, 184 ustr_cv_index_t i_from, 185 ustr_cv_index_t i_to, 186 t_udstr from, 187 ustr_cv_index_t f_from, 188 ustr_cv_index_t f_to); 189 extern t_udstr udstr_cp_replace_fw_x (t_udstr into, 190 ustr_cp_index_t i_from, 191 ustr_cp_index_t i_to, 192 t_udstr from, 193 ustr_cp_index_t f_from, 194 ustr_cp_index_t f_to); 195 extern ustr_cv_index_t udstr_cv_normalize (t_udstr dstr, 196 ustr_cv_index_t orig_index); 197 extern ustr_cv_index_t udstr_cv_inc (t_udstr dstr, 198 ustr_cv_index_t orig_index); 199 extern ustr_cv_index_t udstr_cv_dec (t_udstr dstr, 200 ustr_cv_index_t orig_index); 201 extern ustr_cv_index_t udstr_cp_to_cv (t_udstr dstr, 202 ustr_cp_index_t cpi); 203 extern void udstr_cp_to_cv_range (ustr_cv_index_t * from_v, 204 ustr_cv_index_t * to_v, 205 t_udstr d, 206 ustr_cp_index_t from, 207 ustr_cp_index_t to); 208 #endif /* INCLUDE__STRINGS__UDSTR_H */ 209 210 211 /* tag: Tom Lord Fri Jan 2 08:46:35 2004 (udstr.h) 212 */ 213