i m p l i c i t _ n a m e Determines if a name is of the form prefix [ ] where prefix has a fixed known length.
| 212 | // Determines if a name is of the form prefix<n[...n]>[<spaces>] |
| 213 | // where prefix has a fixed known length. |
| 214 | bool implicit_name(const char* name, const char* prefix, int prefix_len) |
| 215 | { |
| 216 | if (strncmp(name, prefix, prefix_len) != 0) |
| 217 | return false; |
| 218 | |
| 219 | int i = prefix_len; |
| 220 | while (name[i] >= '0' && name[i] <= '9') |
| 221 | ++i; |
| 222 | |
| 223 | if (i == prefix_len) // 'prefix' alone isn't valid |
| 224 | return false; |
| 225 | |
| 226 | while (name[i] == ' ') |
| 227 | ++i; |
| 228 | |
| 229 | return !name[i]; // we reached null term |
| 230 | } |
| 231 | |
| 232 | |
| 233 | int name_length(const TEXT* const name) |
no outgoing calls
no test coverage detected