2014-10-14 21:43:13 -04:00
|
|
|
#include "re1.5.h"
|
|
|
|
|
|
|
|
int _re1_5_classmatch(const char *pc, const char *sp)
|
|
|
|
{
|
|
|
|
// pc points to "cnt" byte after opcode
|
2014-10-16 06:56:13 -04:00
|
|
|
int is_positive = (pc[-1] == Class);
|
2014-10-14 21:43:13 -04:00
|
|
|
int cnt = *pc++;
|
|
|
|
while (cnt--) {
|
2014-10-16 06:56:13 -04:00
|
|
|
if (*sp >= *pc && *sp <= pc[1]) return is_positive;
|
|
|
|
pc += 2;
|
2014-10-14 21:43:13 -04:00
|
|
|
}
|
2014-10-16 06:56:13 -04:00
|
|
|
return !is_positive;
|
|
|
|
}
|