internal.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef MC__SEARCH_INTERNAL_H
  2. #define MC__SEARCH_INTERNAL_H
  3. /*** typedefs(not structures) and defined constants **********************************************/
  4. #ifdef SEARCH_TYPE_GLIB
  5. #define mc_search_regex_t GRegex
  6. #else
  7. #define mc_search_regex_t pcre
  8. #endif
  9. /*** enums ***************************************************************************************/
  10. typedef enum
  11. {
  12. COND__NOT_FOUND,
  13. COND__NOT_ALL_FOUND,
  14. COND__FOUND_CHAR,
  15. COND__FOUND_CHAR_LAST,
  16. COND__FOUND_OK,
  17. COND__FOUND_ERROR
  18. } mc_search__found_cond_t;
  19. /*** structures declarations (and typedefs of structures)*****************************************/
  20. typedef struct mc_search_cond_struct
  21. {
  22. GString *str;
  23. GString *upper;
  24. GString *lower;
  25. mc_search_regex_t *regex_handle;
  26. gchar *charset;
  27. } mc_search_cond_t;
  28. /*** global variables defined in .c file *********************************************************/
  29. /*** declarations of public functions ************************************************************/
  30. /* search/lib.c : */
  31. gchar *mc_search__recode_str (const char *, gsize, const char *, const char *, gsize *);
  32. gchar *mc_search__get_one_symbol (const char *, const char *, gsize, gboolean *);
  33. GString *mc_search__tolower_case_str (const char *, const char *, gsize);
  34. GString *mc_search__toupper_case_str (const char *, const char *, gsize);
  35. /* search/regex.c : */
  36. void mc_search__cond_struct_new_init_regex (const char *, mc_search_t *, mc_search_cond_t *);
  37. gboolean mc_search__run_regex (mc_search_t *, const void *, gsize, gsize, gsize *);
  38. GString *mc_search_regex_prepare_replace_str (mc_search_t *, GString *);
  39. /* search/normal.c : */
  40. void mc_search__cond_struct_new_init_normal (const char *, mc_search_t *, mc_search_cond_t *);
  41. gboolean mc_search__run_normal (mc_search_t *, const void *, gsize, gsize, gsize *);
  42. GString *mc_search_normal_prepare_replace_str (mc_search_t *, GString *);
  43. /* search/glob.c : */
  44. void mc_search__cond_struct_new_init_glob (const char *, mc_search_t *, mc_search_cond_t *);
  45. gboolean mc_search__run_glob (mc_search_t *, const void *, gsize, gsize, gsize *);
  46. GString *mc_search_glob_prepare_replace_str (mc_search_t *, GString *);
  47. /* search/hex.c : */
  48. void mc_search__cond_struct_new_init_hex (const char *, mc_search_t *, mc_search_cond_t *);
  49. gboolean mc_search__run_hex (mc_search_t *, const void *, gsize, gsize, gsize *);
  50. GString *mc_search_hex_prepare_replace_str (mc_search_t *, GString *);
  51. /*** inline functions ****************************************************************************/
  52. #endif