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
9 #define mc_search_regex_t pcre
12 /*** enums ***************************************************************************************/
18 COND__FOUND_CHAR_LAST
,
21 } mc_search__found_cond_t
;
23 /*** structures declarations (and typedefs of structures)*****************************************/
25 typedef struct mc_search_cond_struct
{
29 mc_search_regex_t
*regex_handle
;
34 /*** global variables defined in .c file *********************************************************/
36 extern const char * STR_E_NOTFOUND
;
37 extern const char * STR_E_UNKNOWN_TYPE
;
38 extern const char * STR_E_RPL_NOT_EQ_TO_FOUND
;
39 extern const char * STR_E_RPL_INVALID_TOKEN
;
40 /*** declarations of public functions ************************************************************/
45 gchar
*mc_search__recode_str (const char *, gsize
, const char *, const char *, gsize
*);
47 gchar
*mc_search__get_one_symbol (const char *, const char *, gsize
, gboolean
*);
49 int mc_search__get_char (mc_search_t
*, const void *, gsize
);
51 GString
*mc_search__tolower_case_str (const char *, const char *, gsize
);
53 GString
*mc_search__toupper_case_str (const char *, const char *, gsize
);
55 /* search/regex.c : */
57 void mc_search__cond_struct_new_init_regex (const char *, mc_search_t
*, mc_search_cond_t
*);
59 gboolean
mc_search__run_regex (mc_search_t
*, const void *, gsize
, gsize
, gsize
*);
61 GString
*mc_search_regex_prepare_replace_str (mc_search_t
*, GString
*);
63 /* search/normal.c : */
65 void mc_search__cond_struct_new_init_normal (const char *, mc_search_t
*, mc_search_cond_t
*);
67 gboolean
mc_search__run_normal (mc_search_t
*, const void *, gsize
, gsize
, gsize
*);
69 GString
*mc_search_normal_prepare_replace_str (mc_search_t
*, GString
*);
73 void mc_search__cond_struct_new_init_glob (const char *, mc_search_t
*, mc_search_cond_t
*);
75 gboolean
mc_search__run_glob (mc_search_t
*, const void *, gsize
, gsize
, gsize
*);
77 GString
*mc_search_glob_prepare_replace_str (mc_search_t
*, GString
*);
81 void mc_search__cond_struct_new_init_hex (const char *, mc_search_t
*, mc_search_cond_t
*);
83 gboolean
mc_search__run_hex (mc_search_t
*, const void *, gsize
, gsize
, gsize
*);
85 GString
*mc_search_hex_prepare_replace_str (mc_search_t
*, GString
*);