2014-10-15 02:43:13 +01: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 11:56:13 +01:00
|
|
|
int is_positive = (pc[-1] == Class);
|
2014-10-15 02:43:13 +01:00
|
|
|
int cnt = *pc++;
|
|
|
|
while (cnt--) {
|
2014-10-16 11:56:13 +01:00
|
|
|
if (*sp >= *pc && *sp <= pc[1]) return is_positive;
|
|
|
|
pc += 2;
|
2014-10-15 02:43:13 +01:00
|
|
|
}
|
2014-10-16 11:56:13 +01:00
|
|
|
return !is_positive;
|
|
|
|
}
|