--------------------------------------------------------------------------- | 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 |
| 83 | | FALSE - field is invalid |
| 84 | +--------------------------------------------------------------------------*/ |
| 85 | static 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…