MCPcopy Create free account
hub / github.com/Kitware/CMake / Check_RegularExpression_Field

Function Check_RegularExpression_Field

Source/CursesDialog/form/fty_regex.c:230–246  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | 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

Source from the content-addressed store, hash-verified

228| FALSE - field is invalid
229+--------------------------------------------------------------------------*/
230static 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
248static FIELDTYPE typeREGEXP = {
249 _HAS_ARGS | _RESIDENT,

Callers

nothing calls this directly

Calls 1

field_bufferFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…