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

Function Check_AlphaNumeric_Field

Source/CursesDialog/form/fty_alnum.c:84–103  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | Facility : libnform | Function : static bool Check_AlphaNumeric_Field( | FIELD *field, | const void *argp) | | Description : Validate buffer content to be a valid alphanumeric value | | Return Values : TRUE - field is

Source from the content-addressed store, hash-verified

82| FALSE - field is invalid
83+--------------------------------------------------------------------------*/
84static bool Check_AlphaNumeric_Field(FIELD * field, const void * argp)
85{
86 int width = ((const alnumARG *)argp)->width;
87 unsigned char *bp = (unsigned char *)field_buffer(field,0);
88 int l = -1;
89 unsigned char *s;
90
91 while(*bp && *bp==' ')
92 bp++;
93 if (*bp)
94 {
95 s = bp;
96 while(*bp && isalnum(*bp))
97 bp++;
98 l = (int)(bp-s);
99 while(*bp && *bp==' ')
100 bp++;
101 }
102 return ((*bp || (l < width)) ? FALSE : TRUE);
103}
104
105/*---------------------------------------------------------------------------
106| Facility : libnform

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…