You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 line
756B

  1. #ifndef JEGER_H
  2. #define JEGER_H
  3. #include <stdbool.h>
  4. #include "vector.h"
  5. extern bool is_case_on;
  6. typedef struct {
  7. int accepting_state;
  8. char * str;
  9. vector_t delta_table; // <delta_t>
  10. vector_t catch_table; // <offshoot_t>
  11. } regex_t;
  12. typedef struct {
  13. union {
  14. int position;
  15. const char * _pos_ptr;
  16. };
  17. int width;
  18. } match_t;
  19. extern regex_t * regex_compile(const char * const pattern);
  20. extern int regex_free(regex_t * const regex);
  21. extern bool regex_search(const regex_t * const regex, const char * const string);
  22. extern match_t * regex_match(const regex_t * const regex, const char * const string, const bool start_of_string);
  23. extern bool is_magic(const char c);
  24. extern bool is_sentinel(const match_t * const match);
  25. #endif