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

Function Check_Alpha_Field

Source/CursesDialog/form/fty_alpha.c:85–104  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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