1
0
mirror of https://github.com/simh/simh.git synced 2026-04-28 12:47:25 +00:00

SCP: Add RegEx support to EXPECT string processing

This commit is contained in:
Mark Pizzolato
2014-10-20 04:42:25 -07:00
parent ddc29fb2c9
commit 5af6210ed9
45 changed files with 899 additions and 477 deletions

View File

@@ -121,6 +121,17 @@
#include <process.h>
#endif
#ifdef USE_REGEX
#undef USE_REGEX
#endif
#if defined(HAVE_PCREPOSIX_H)
#include <pcreposix.h>
#define USE_REGEX 1
#elif defined(HAVE_REGEX_H)
#include <regex.h>
#define USE_REGEX 1
#endif
/* avoid macro names collisions */
#ifdef MAX
#undef MAX
@@ -643,6 +654,10 @@ struct sim_exptab {
int32 switches; /* flags */
#define EXP_TYP_PERSIST (SWMASK ('P')) /* rule persists after match, default is once a rule matches, it is removed */
#define EXP_TYP_CLEARALL (SWMASK ('C')) /* clear all rules after matching this rule, default is to once a rule matches, it is removed */
#define EXP_TYP_REGEX (SWMASK ('R')) /* rule pattern is a regular expression */
#if defined(USE_REGEX)
regex_t regex; /* compiled regular expression */
#endif
char *act; /* action string */
};