2023-09-18 16:43:57 -04:00
|
|
|
#ifndef JEGER_H
|
|
|
|
#define JEGER_H
|
2023-08-23 21:14:40 -04:00
|
|
|
|
2023-08-28 15:58:20 -04:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2023-08-23 21:14:40 -04:00
|
|
|
#include "vector.h"
|
2023-08-19 18:49:10 -04:00
|
|
|
|
|
|
|
extern bool is_case_on;
|
|
|
|
|
2023-08-23 21:14:40 -04:00
|
|
|
typedef struct {
|
2023-08-25 13:44:07 -04:00
|
|
|
int accepting_state;
|
2023-08-23 21:14:40 -04:00
|
|
|
char * str;
|
|
|
|
vector_t delta_table; // <delta_t>
|
|
|
|
vector_t catch_table; // <offshoot_t>
|
|
|
|
} regex_t;
|
|
|
|
|
2023-09-18 16:43:57 -04:00
|
|
|
typedef struct {
|
|
|
|
int position;
|
|
|
|
int width;
|
|
|
|
} match_t;
|
|
|
|
|
2023-08-23 19:59:59 -04:00
|
|
|
extern regex_t * regex_compile(const char * const pattern);
|
|
|
|
extern int regex_free(regex_t * const regex);
|
2023-09-18 16:43:57 -04:00
|
|
|
extern bool regex_search(const regex_t * const regex, const char * const string);
|
|
|
|
extern match_t * regex_match(const regex_t * const regex, const char * const string, const bool start_of_string);
|
2023-08-23 21:14:40 -04:00
|
|
|
|
2023-08-23 22:11:46 -04:00
|
|
|
extern bool is_magic(const char c);
|
|
|
|
|
2023-08-23 21:14:40 -04:00
|
|
|
#endif
|