lc_mc_search 179 lib/search.h void mc_search_free (mc_search_t * lc_mc_search); lc_mc_search 191 lib/search.h char *mc_search_prepare_replace_str2 (mc_search_t * lc_mc_search, const char *replace_str); lc_mc_search 193 lib/search.h gboolean mc_search_is_fixed_search_str (const mc_search_t * lc_mc_search); lc_mc_search 202 lib/search.h int mc_search_getstart_result_by_num (mc_search_t * lc_mc_search, int lc_index); lc_mc_search 203 lib/search.h int mc_search_getend_result_by_num (mc_search_t * lc_mc_search, int lc_index); lc_mc_search 206 lib/search.h void mc_search_set_error (mc_search_t * lc_mc_search, mc_search_error_t code, const gchar * format, ...) lc_mc_search 169 lib/search/glob.c mc_search__cond_struct_new_init_glob (const char *charset, mc_search_t *lc_mc_search, lc_mc_search 177 lib/search/glob.c if (lc_mc_search->is_entire_line) lc_mc_search 184 lib/search/glob.c mc_search__cond_struct_new_init_regex (charset, lc_mc_search, mc_search_cond); lc_mc_search 190 lib/search/glob.c mc_search__run_glob (mc_search_t *lc_mc_search, const void *user_data, lc_mc_search 193 lib/search/glob.c return mc_search__run_regex (lc_mc_search, user_data, start_search, end_search, found_len); lc_mc_search 199 lib/search/glob.c mc_search_glob_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str) lc_mc_search 204 lib/search/glob.c res = mc_search_regex_prepare_replace_str (lc_mc_search, repl); lc_mc_search 138 lib/search/hex.c mc_search__cond_struct_new_init_hex (const char *charset, mc_search_t *lc_mc_search, lc_mc_search 186 lib/search/hex.c mc_search__cond_struct_new_init_regex (charset, lc_mc_search, mc_search_cond); lc_mc_search 209 lib/search/hex.c lc_mc_search->error = MC_SEARCH_E_INPUT; lc_mc_search 210 lib/search/hex.c lc_mc_search->error_str = lc_mc_search 218 lib/search/hex.c mc_search__run_hex (mc_search_t *lc_mc_search, const void *user_data, lc_mc_search 221 lib/search/hex.c return mc_search__run_regex (lc_mc_search, user_data, start_search, end_search, found_len); lc_mc_search 227 lib/search/hex.c mc_search_hex_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str) lc_mc_search 229 lib/search/hex.c (void) lc_mc_search; lc_mc_search 54 lib/search/internal.h void mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_search, lc_mc_search 56 lib/search/internal.h gboolean mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data, lc_mc_search 58 lib/search/internal.h GString *mc_search_regex_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str); lc_mc_search 62 lib/search/internal.h void mc_search__cond_struct_new_init_normal (const char *charset, mc_search_t * lc_mc_search, lc_mc_search 64 lib/search/internal.h gboolean mc_search__run_normal (mc_search_t * lc_mc_search, const void *user_data, lc_mc_search 66 lib/search/internal.h GString *mc_search_normal_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str); lc_mc_search 70 lib/search/internal.h void mc_search__cond_struct_new_init_glob (const char *charset, mc_search_t * lc_mc_search, lc_mc_search 72 lib/search/internal.h gboolean mc_search__run_glob (mc_search_t * lc_mc_search, const void *user_data, lc_mc_search 74 lib/search/internal.h GString *mc_search_glob_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str); lc_mc_search 78 lib/search/internal.h void mc_search__cond_struct_new_init_hex (const char *charset, mc_search_t * lc_mc_search, lc_mc_search 80 lib/search/internal.h gboolean mc_search__run_hex (mc_search_t * lc_mc_search, const void *user_data, lc_mc_search 82 lib/search/internal.h GString *mc_search_hex_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str); lc_mc_search 86 lib/search/normal.c mc_search__cond_struct_new_init_normal (const char *charset, mc_search_t *lc_mc_search, lc_mc_search 90 lib/search/normal.c mc_search__cond_struct_new_init_regex (charset, lc_mc_search, mc_search_cond); lc_mc_search 96 lib/search/normal.c mc_search__run_normal (mc_search_t *lc_mc_search, const void *user_data, lc_mc_search 99 lib/search/normal.c return mc_search__run_regex (lc_mc_search, user_data, start_search, end_search, found_len); lc_mc_search 104 lib/search/normal.c mc_search_normal_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str) lc_mc_search 106 lib/search/normal.c (void) lc_mc_search; lc_mc_search 320 lib/search/regex.c mc_search__regex_found_cond_one (mc_search_t *lc_mc_search, mc_search_regex_t *regex, lc_mc_search 328 lib/search/regex.c &lc_mc_search->regex_match_info, &mcerror)) lc_mc_search 330 lib/search/regex.c g_match_info_free (lc_mc_search->regex_match_info); lc_mc_search 331 lib/search/regex.c lc_mc_search->regex_match_info = NULL; lc_mc_search 334 lib/search/regex.c lc_mc_search->error = MC_SEARCH_E_REGEX; lc_mc_search 335 lib/search/regex.c g_free (lc_mc_search->error_str); lc_mc_search 336 lib/search/regex.c lc_mc_search->error_str = lc_mc_search 343 lib/search/regex.c lc_mc_search->num_results = g_match_info_get_match_count (lc_mc_search->regex_match_info); lc_mc_search 346 lib/search/regex.c lc_mc_search->num_results = lc_mc_search 349 lib/search/regex.c lc_mc_search->regex_match_info, NULL); lc_mc_search 351 lib/search/regex.c pcre_exec (regex, lc_mc_search->regex_match_info, search_str->str, search_str->len, 0, 0, lc_mc_search 352 lib/search/regex.c lc_mc_search->iovector, MC_SEARCH__NUM_REPLACE_ARGS); lc_mc_search 354 lib/search/regex.c if (lc_mc_search->num_results < 0) lc_mc_search 366 lib/search/regex.c mc_search__regex_found_cond (mc_search_t *lc_mc_search, GString *search_str) lc_mc_search 370 lib/search/regex.c for (loop1 = 0; loop1 < lc_mc_search->prepared.conditions->len; loop1++) lc_mc_search 376 lib/search/regex.c (mc_search_cond_t *) g_ptr_array_index (lc_mc_search->prepared.conditions, loop1); lc_mc_search 382 lib/search/regex.c mc_search__regex_found_cond_one (lc_mc_search, mc_search_cond->regex_handle, lc_mc_search 436 lib/search/regex.c mc_search_regex__get_token_by_num (const mc_search_t *lc_mc_search, gsize lc_index) lc_mc_search 441 lib/search/regex.c g_match_info_fetch_pos (lc_mc_search->regex_match_info, lc_index, &fnd_start, &fnd_end); lc_mc_search 443 lib/search/regex.c fnd_start = lc_mc_search->iovector[lc_index * 2 + 0]; lc_mc_search 444 lib/search/regex.c fnd_end = lc_mc_search->iovector[lc_index * 2 + 1]; lc_mc_search 450 lib/search/regex.c return g_strndup (lc_mc_search->regex_buffer->str + fnd_start, fnd_end - fnd_start); lc_mc_search 790 lib/search/regex.c mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t *lc_mc_search, lc_mc_search 793 lib/search/regex.c if (lc_mc_search->whole_words && !lc_mc_search->is_entire_line) lc_mc_search 809 lib/search/regex.c if (!lc_mc_search->is_case_sensitive) lc_mc_search 816 lib/search/regex.c if (!lc_mc_search->is_case_sensitive) lc_mc_search 831 lib/search/regex.c lc_mc_search->error = MC_SEARCH_E_REGEX_COMPILE; lc_mc_search 832 lib/search/regex.c g_free (lc_mc_search->error_str); lc_mc_search 833 lib/search/regex.c lc_mc_search->error_str = lc_mc_search 855 lib/search/regex.c if (!lc_mc_search->is_case_sensitive) lc_mc_search 859 lib/search/regex.c if (!lc_mc_search->is_case_sensitive) lc_mc_search 863 lib/search/regex.c else if (!lc_mc_search->is_case_sensitive) lc_mc_search 884 lib/search/regex.c mc_search_set_error (lc_mc_search, MC_SEARCH_E_REGEX_COMPILE, "%s", error); lc_mc_search 890 lib/search/regex.c lc_mc_search->regex_match_info = pcre_study (mc_search_cond->regex_handle, 0, &error); lc_mc_search 891 lib/search/regex.c if (lc_mc_search->regex_match_info == NULL && error != NULL) lc_mc_search 894 lib/search/regex.c mc_search_set_error (lc_mc_search, MC_SEARCH_E_REGEX_COMPILE, "%s", error); lc_mc_search 901 lib/search/regex.c lc_mc_search->is_utf8 = str_isutf8 (charset); lc_mc_search 907 lib/search/regex.c mc_search__run_regex (mc_search_t *lc_mc_search, const void *user_data, lc_mc_search 915 lib/search/regex.c if (lc_mc_search->regex_buffer != NULL) lc_mc_search 916 lib/search/regex.c g_string_set_size (lc_mc_search->regex_buffer, 0); lc_mc_search 918 lib/search/regex.c lc_mc_search->regex_buffer = g_string_sized_new (64); lc_mc_search 923 lib/search/regex.c g_string_set_size (lc_mc_search->regex_buffer, 0); lc_mc_search 924 lib/search/regex.c lc_mc_search->start_buffer = current_pos; lc_mc_search 926 lib/search/regex.c if (lc_mc_search->search_fn != NULL) lc_mc_search 932 lib/search/regex.c ret = lc_mc_search->search_fn (user_data, current_pos, ¤t_chr); lc_mc_search 947 lib/search/regex.c g_string_append_c (lc_mc_search->regex_buffer, (char) current_chr); lc_mc_search 973 lib/search/regex.c g_string_append_len (lc_mc_search->regex_buffer, (const char *) user_data + virtual_pos, lc_mc_search 978 lib/search/regex.c switch (mc_search__regex_found_cond (lc_mc_search, lc_mc_search->regex_buffer)) lc_mc_search 982 lib/search/regex.c g_match_info_fetch_pos (lc_mc_search->regex_match_info, 0, &start_pos, &end_pos); lc_mc_search 984 lib/search/regex.c start_pos = lc_mc_search->iovector[0]; lc_mc_search 985 lib/search/regex.c end_pos = lc_mc_search->iovector[1]; lc_mc_search 989 lib/search/regex.c lc_mc_search->normal_offset = lc_mc_search->start_buffer + start_pos; lc_mc_search 994 lib/search/regex.c g_string_free (lc_mc_search->regex_buffer, TRUE); lc_mc_search 995 lib/search/regex.c lc_mc_search->regex_buffer = NULL; lc_mc_search 999 lib/search/regex.c if ((lc_mc_search->update_fn != NULL) && lc_mc_search 1000 lib/search/regex.c ((lc_mc_search->update_fn) (user_data, current_pos) == MC_SEARCH_CB_ABORT)) lc_mc_search 1007 lib/search/regex.c g_string_free (lc_mc_search->regex_buffer, TRUE); lc_mc_search 1008 lib/search/regex.c lc_mc_search->regex_buffer = NULL; lc_mc_search 1010 lib/search/regex.c MC_PTR_FREE (lc_mc_search->error_str); lc_mc_search 1011 lib/search/regex.c lc_mc_search->error = ret == MC_SEARCH_CB_ABORT ? MC_SEARCH_E_ABORT : MC_SEARCH_E_NOTFOUND; lc_mc_search 1019 lib/search/regex.c mc_search_regex_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str) lc_mc_search 1031 lib/search/regex.c if (lc_mc_search->num_results < 0) lc_mc_search 1034 lib/search/regex.c if (num_replace_tokens > lc_mc_search->num_results - 1 lc_mc_search 1037 lib/search/regex.c mc_search_set_error (lc_mc_search, MC_SEARCH_E_REGEX_REPLACE, "%s", lc_mc_search 1084 lib/search/regex.c &replace_flags, lc_mc_search->is_utf8); lc_mc_search 1091 lib/search/regex.c if (lc_index > lc_mc_search->num_results) lc_mc_search 1094 lib/search/regex.c mc_search_set_error (lc_mc_search, MC_SEARCH_E_REGEX_REPLACE, lc_mc_search 1099 lib/search/regex.c tmp_str = mc_search_regex__get_token_by_num (lc_mc_search, lc_index); lc_mc_search 67 lib/search/search.c mc_search__cond_struct_new (mc_search_t *lc_mc_search, const GString *str, const char *charset) lc_mc_search 75 lib/search/search.c lc_mc_search->regex_match_info = pcre2_match_data_create (MC_SEARCH__NUM_REPLACE_ARGS, NULL); lc_mc_search 76 lib/search/search.c lc_mc_search->iovector = pcre2_get_ovector_pointer (lc_mc_search->regex_match_info); lc_mc_search 78 lib/search/search.c switch (lc_mc_search->search_type) lc_mc_search 81 lib/search/search.c mc_search__cond_struct_new_init_glob (charset, lc_mc_search, mc_search_cond); lc_mc_search 84 lib/search/search.c mc_search__cond_struct_new_init_normal (charset, lc_mc_search, mc_search_cond); lc_mc_search 87 lib/search/search.c mc_search__cond_struct_new_init_regex (charset, lc_mc_search, mc_search_cond); lc_mc_search 90 lib/search/search.c mc_search__cond_struct_new_init_hex (charset, lc_mc_search, mc_search_cond); lc_mc_search 157 lib/search/search.c mc_search_t *lc_mc_search; lc_mc_search 162 lib/search/search.c lc_mc_search = g_new0 (mc_search_t, 1); lc_mc_search 163 lib/search/search.c lc_mc_search->original.str = g_string_new_len (original, original_len); lc_mc_search 165 lib/search/search.c lc_mc_search->original.charset = lc_mc_search 172 lib/search/search.c return lc_mc_search; lc_mc_search 178 lib/search/search.c mc_search_free (mc_search_t *lc_mc_search) lc_mc_search 180 lib/search/search.c if (lc_mc_search == NULL) lc_mc_search 183 lib/search/search.c g_string_free (lc_mc_search->original.str, TRUE); lc_mc_search 185 lib/search/search.c g_free (lc_mc_search->original.charset); lc_mc_search 187 lib/search/search.c g_free (lc_mc_search->error_str); lc_mc_search 189 lib/search/search.c if (lc_mc_search->prepared.conditions != NULL) lc_mc_search 190 lib/search/search.c g_ptr_array_free (lc_mc_search->prepared.conditions, TRUE); lc_mc_search 193 lib/search/search.c if (lc_mc_search->regex_match_info != NULL) lc_mc_search 194 lib/search/search.c g_match_info_free (lc_mc_search->regex_match_info); lc_mc_search 196 lib/search/search.c g_free (lc_mc_search->regex_match_info); lc_mc_search 199 lib/search/search.c if (lc_mc_search->regex_buffer != NULL) lc_mc_search 200 lib/search/search.c g_string_free (lc_mc_search->regex_buffer, TRUE); lc_mc_search 202 lib/search/search.c g_free (lc_mc_search); lc_mc_search 208 lib/search/search.c mc_search_prepare (mc_search_t *lc_mc_search) lc_mc_search 212 lib/search/search.c if (lc_mc_search->prepared.conditions != NULL) lc_mc_search 213 lib/search/search.c return lc_mc_search->prepared.result; lc_mc_search 217 lib/search/search.c if (!lc_mc_search->is_all_charsets) lc_mc_search 219 lib/search/search.c mc_search__cond_struct_new (lc_mc_search, lc_mc_search->original.str, lc_mc_search 220 lib/search/search.c lc_mc_search->original.charset)); lc_mc_search 230 lib/search/search.c if (g_ascii_strcasecmp (id, lc_mc_search->original.charset) == 0) lc_mc_search 232 lib/search/search.c mc_search__cond_struct_new (lc_mc_search, lc_mc_search 233 lib/search/search.c lc_mc_search->original.str, lc_mc_search 234 lib/search/search.c lc_mc_search->original.charset)); lc_mc_search 240 lib/search/search.c mc_search__recode_str (lc_mc_search->original.str->str, lc_mc_search 241 lib/search/search.c lc_mc_search->original.str->len, lc_mc_search 242 lib/search/search.c lc_mc_search->original.charset, id); lc_mc_search 243 lib/search/search.c g_ptr_array_add (ret, mc_search__cond_struct_new (lc_mc_search, buffer, id)); lc_mc_search 250 lib/search/search.c mc_search__cond_struct_new (lc_mc_search, lc_mc_search->original.str, lc_mc_search 253 lib/search/search.c lc_mc_search->prepared.conditions = ret; lc_mc_search 254 lib/search/search.c lc_mc_search->prepared.result = (lc_mc_search->error == MC_SEARCH_E_OK); lc_mc_search 256 lib/search/search.c return lc_mc_search->prepared.result; lc_mc_search 275 lib/search/search.c mc_search_run (mc_search_t *lc_mc_search, const void *user_data, lc_mc_search 280 lib/search/search.c if (lc_mc_search == NULL || user_data == NULL) lc_mc_search 282 lib/search/search.c if (!mc_search_is_type_avail (lc_mc_search->search_type)) lc_mc_search 284 lib/search/search.c mc_search_set_error (lc_mc_search, MC_SEARCH_E_INPUT, "%s", _(STR_E_UNKNOWN_TYPE)); lc_mc_search 288 lib/search/search.c if (lc_mc_search->regex_match_info != NULL) lc_mc_search 290 lib/search/search.c g_match_info_free (lc_mc_search->regex_match_info); lc_mc_search 291 lib/search/search.c lc_mc_search->regex_match_info = NULL; lc_mc_search 295 lib/search/search.c mc_search_set_error (lc_mc_search, MC_SEARCH_E_OK, NULL); lc_mc_search 297 lib/search/search.c if (!mc_search_prepare (lc_mc_search)) lc_mc_search 300 lib/search/search.c switch (lc_mc_search->search_type) lc_mc_search 303 lib/search/search.c ret = mc_search__run_normal (lc_mc_search, user_data, start_search, end_search, found_len); lc_mc_search 306 lib/search/search.c ret = mc_search__run_regex (lc_mc_search, user_data, start_search, end_search, found_len); lc_mc_search 309 lib/search/search.c ret = mc_search__run_glob (lc_mc_search, user_data, start_search, end_search, found_len); lc_mc_search 312 lib/search/search.c ret = mc_search__run_hex (lc_mc_search, user_data, start_search, end_search, found_len); lc_mc_search 353 lib/search/search.c mc_search_prepare_replace_str (mc_search_t *lc_mc_search, GString *replace_str) lc_mc_search 360 lib/search/search.c if (lc_mc_search == NULL) lc_mc_search 363 lib/search/search.c switch (lc_mc_search->search_type) lc_mc_search 366 lib/search/search.c ret = mc_search_regex_prepare_replace_str (lc_mc_search, replace_str); lc_mc_search 369 lib/search/search.c ret = mc_search_glob_prepare_replace_str (lc_mc_search, replace_str); lc_mc_search 372 lib/search/search.c ret = mc_search_normal_prepare_replace_str (lc_mc_search, replace_str); lc_mc_search 375 lib/search/search.c ret = mc_search_hex_prepare_replace_str (lc_mc_search, replace_str); lc_mc_search 387 lib/search/search.c mc_search_prepare_replace_str2 (mc_search_t *lc_mc_search, const char *replace_str) lc_mc_search 393 lib/search/search.c ret = mc_search_prepare_replace_str (lc_mc_search, replace_str2); lc_mc_search 401 lib/search/search.c mc_search_is_fixed_search_str (const mc_search_t *lc_mc_search) lc_mc_search 403 lib/search/search.c if (lc_mc_search == NULL) lc_mc_search 405 lib/search/search.c switch (lc_mc_search->search_type) lc_mc_search 454 lib/search/search.c mc_search_getstart_result_by_num (mc_search_t *lc_mc_search, int lc_index) lc_mc_search 456 lib/search/search.c if (lc_mc_search == NULL) lc_mc_search 458 lib/search/search.c if (lc_mc_search->search_type == MC_SEARCH_T_NORMAL) lc_mc_search 465 lib/search/search.c g_match_info_fetch_pos (lc_mc_search->regex_match_info, lc_index, &start_pos, &end_pos); lc_mc_search 469 lib/search/search.c return lc_mc_search->iovector[lc_index * 2]; lc_mc_search 476 lib/search/search.c mc_search_getend_result_by_num (mc_search_t *lc_mc_search, int lc_index) lc_mc_search 478 lib/search/search.c if (lc_mc_search == NULL) lc_mc_search 480 lib/search/search.c if (lc_mc_search->search_type == MC_SEARCH_T_NORMAL) lc_mc_search 487 lib/search/search.c g_match_info_fetch_pos (lc_mc_search->regex_match_info, lc_index, &start_pos, &end_pos); lc_mc_search 491 lib/search/search.c return lc_mc_search->iovector[lc_index * 2 + 1]; lc_mc_search 505 lib/search/search.c mc_search_set_error (mc_search_t *lc_mc_search, mc_search_error_t code, const gchar *format, ...) lc_mc_search 507 lib/search/search.c lc_mc_search->error = code; lc_mc_search 509 lib/search/search.c MC_PTR_FREE (lc_mc_search->error_str); lc_mc_search 516 lib/search/search.c lc_mc_search->error_str = g_strdup_vprintf (format, args);