| 175 | } |
| 176 | |
| 177 | SMCError TextParsers::ParseSMCStream(const char *stream, |
| 178 | size_t length, |
| 179 | ITextListener_SMC *smc_listener, |
| 180 | SMCStates *states, |
| 181 | char *buffer, |
| 182 | size_t maxsize) |
| 183 | { |
| 184 | RawStream rs; |
| 185 | SMCError result; |
| 186 | |
| 187 | rs.stream = stream; |
| 188 | rs.length = length; |
| 189 | rs.pos = 0; |
| 190 | |
| 191 | result = ParseStream_SMC(&rs, RawStreamReader, smc_listener, states); |
| 192 | |
| 193 | const char *errstr = GetSMCErrorString(result); |
| 194 | UTIL_Format(buffer, maxsize, "%s", errstr != NULL ? errstr : "Unknown error"); |
| 195 | |
| 196 | return result; |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Raw parsing of streams with helper functions |
no test coverage detected