| 156 | } |
| 157 | |
| 158 | int engine_output_read(void* engine, char* output, double* data, int size, int maxtokens) { |
| 159 | Engine* e = static_cast<Engine*>(engine); |
| 160 | InputBuffer* buf = e->getOutput(output); |
| 161 | if (buf==NULL) { |
| 162 | cerr << "ERROR: unknown output " << output << endl; |
| 163 | return -1; |
| 164 | } |
| 165 | if (size!=buf->info().size) { |
| 166 | cerr << "ERROR: invalid output size ! output '" << output << "' has size " << buf->info().size << endl; |
| 167 | return -1; |
| 168 | } |
| 169 | int read = buf->read(data,maxtokens); |
| 170 | buf->consumeTokens(read); |
| 171 | return read; |
| 172 | } |
| 173 | |
| 174 | void engine_reset(void* engine) { |
| 175 | Engine* e = static_cast<Engine*>(engine); |
nothing calls this directly
no test coverage detected