2023-08-23 21:14:40 -04:00
|
|
|
#ifndef REGEX_H
|
|
|
|
#define REGEX_H
|
|
|
|
|
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-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-08-26 16:39:07 -04:00
|
|
|
extern bool regex_search(regex_t * regex, const char * const string);
|
|
|
|
extern int regex_match(regex_t * regex, const char * const 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
|