--------------------------------------------------------------------------- | Facility : libnform | Function : static bool Check_RegularExpression_Field( | FIELD * field, | const void * argp) | | Description : Validate buffer content to be a valid regular expression | | Return Values : TRUE - field
| 228 | | FALSE - field is invalid |
| 229 | +--------------------------------------------------------------------------*/ |
| 230 | static bool Check_RegularExpression_Field(FIELD * field, const void * argp) |
| 231 | { |
| 232 | bool match = FALSE; |
| 233 | #if HAVE_REGEX_H_FUNCS |
| 234 | const RegExp_Arg *ap = (const RegExp_Arg*)argp; |
| 235 | if (ap && ap->pRegExp) |
| 236 | match = (regexec(ap->pRegExp,field_buffer(field,0),0,NULL,0) ? FALSE:TRUE); |
| 237 | #elif HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS |
| 238 | RegExp_Arg *ap = (RegExp_Arg *)argp; |
| 239 | if (ap && ap->compiled_expression) |
| 240 | match = (step(field_buffer(field,0),ap->compiled_expression) ? TRUE:FALSE); |
| 241 | #else |
| 242 | argp=0; /* Silence unused parameter warning. */ |
| 243 | field=0; /* Silence unused parameter warning. */ |
| 244 | #endif |
| 245 | return match; |
| 246 | } |
| 247 | |
| 248 | static FIELDTYPE typeREGEXP = { |
| 249 | _HAS_ARGS | _RESIDENT, |
nothing calls this directly
no test coverage detected
searching dependent graphs…