| 198 | |
| 199 | |
| 200 | static inline const char *parse_mode(const char *str, uint16_t *modep) |
| 201 | { |
| 202 | unsigned char c; |
| 203 | unsigned int mode = 0; |
| 204 | |
| 205 | if (*str == ' ') |
| 206 | return NULL; |
| 207 | |
| 208 | while ((c = *str++) != ' ') { |
| 209 | if (c < '0' || c > '7') |
| 210 | return NULL; |
| 211 | mode = (mode << 3) + (c - '0'); |
| 212 | } |
| 213 | *modep = mode; |
| 214 | return str; |
| 215 | } |
| 216 | |
| 217 | /* |
| 218 | * Returns the object, having parsed it to find out what it is. |
no outgoing calls
no test coverage detected