| 123 | extern DMFCBase *basethis; |
| 124 | |
| 125 | bool StringParseWord(const char *string, char *word, int size, const char **newpos) { |
| 126 | *newpos = string; |
| 127 | word[0] = '\0'; |
| 128 | |
| 129 | // get through all the whitespace |
| 130 | while (*string && *string == ' ') |
| 131 | string++; |
| 132 | if (!(*string)) { |
| 133 | // nothing is left in the string |
| 134 | *newpos = string; |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | // we're at the beginning of a word |
| 139 | while (*string && *string != ' ') { |
| 140 | if (size > 1) { |
| 141 | *word = *string; |
| 142 | size--; |
| 143 | word++; |
| 144 | } |
| 145 | |
| 146 | string++; |
| 147 | } |
| 148 | |
| 149 | // tack on an ending \0 |
| 150 | *word = '\0'; |
| 151 | |
| 152 | *newpos = string; |
| 153 | return true; |
| 154 | } |
| 155 | |
| 156 | bool StringParseNumber(const char *string, int *number, const char **newpos) { |
| 157 | char temp[10]; |
no outgoing calls
no test coverage detected