1 #ifndef MC__SEARCH_INTERNAL_H
2 #define MC__SEARCH_INTERNAL_H
4 /*** typedefs(not structures) and defined constants **********************************************/
6 #ifdef SEARCH_TYPE_GLIB
7 #define mc_search_regex_t GRegex
10 #define mc_search_regex_t pcre2_code
12 #define mc_search_regex_t pcre
16 /*** enums ***************************************************************************************/
23 COND__FOUND_CHAR_LAST
,
26 } mc_search__found_cond_t
;
28 /*** structures declarations (and typedefs of structures)*****************************************/
30 typedef struct mc_search_cond_struct
35 mc_search_regex_t
*regex_handle
;
39 /*** global variables defined in .c file *********************************************************/
41 /*** declarations of public functions ************************************************************/
45 GString
*mc_search__recode_str (const char *str
, gsize str_len
, const char *charset_from
,
46 const char *charset_to
);
47 GString
*mc_search__get_one_symbol (const char *charset
, const char *str
, gsize str_len
,
48 gboolean
* just_letters
);
49 GString
*mc_search__tolower_case_str (const char *charset
, const GString
* str
);
50 GString
*mc_search__toupper_case_str (const char *charset
, const GString
* str
);
52 /* search/regex.c : */
54 void mc_search__cond_struct_new_init_regex (const char *charset
, mc_search_t
* lc_mc_search
,
55 mc_search_cond_t
* mc_search_cond
);
56 gboolean
mc_search__run_regex (mc_search_t
* lc_mc_search
, const void *user_data
,
57 gsize start_search
, gsize end_search
, gsize
* found_len
);
58 GString
*mc_search_regex_prepare_replace_str (mc_search_t
* lc_mc_search
, GString
* replace_str
);
60 /* search/normal.c : */
62 void mc_search__cond_struct_new_init_normal (const char *charset
, mc_search_t
* lc_mc_search
,
63 mc_search_cond_t
* mc_search_cond
);
64 gboolean
mc_search__run_normal (mc_search_t
* lc_mc_search
, const void *user_data
,
65 gsize start_search
, gsize end_search
, gsize
* found_len
);
66 GString
*mc_search_normal_prepare_replace_str (mc_search_t
* lc_mc_search
, GString
* replace_str
);
70 void mc_search__cond_struct_new_init_glob (const char *charset
, mc_search_t
* lc_mc_search
,
71 mc_search_cond_t
* mc_search_cond
);
72 gboolean
mc_search__run_glob (mc_search_t
* lc_mc_search
, const void *user_data
,
73 gsize start_search
, gsize end_search
, gsize
* found_len
);
74 GString
*mc_search_glob_prepare_replace_str (mc_search_t
* lc_mc_search
, GString
* replace_str
);
78 void mc_search__cond_struct_new_init_hex (const char *charset
, mc_search_t
* lc_mc_search
,
79 mc_search_cond_t
* mc_search_cond
);
80 gboolean
mc_search__run_hex (mc_search_t
* lc_mc_search
, const void *user_data
,
81 gsize start_search
, gsize end_search
, gsize
* found_len
);
82 GString
*mc_search_hex_prepare_replace_str (mc_search_t
* lc_mc_search
, GString
* replace_str
);
84 /*** inline functions ****************************************************************************/
86 #endif /* MC__SEARCH_INTERNAL_H */