3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-07 03:31:24 +00:00

Changed frontend-api from FILE to std::istream

This commit is contained in:
Clifford Wolf 2014-08-23 15:03:55 +02:00
parent 5dce303a2a
commit 19cff41eb4
22 changed files with 116 additions and 89 deletions

View file

@ -41,7 +41,7 @@ struct WriteFileFrontend : public Frontend {
log(" EOT\n");
log("\n");
}
virtual void execute(FILE *&f, std::string filename, std::vector<std::string> args, RTLIL::Design*)
virtual void execute(std::istream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design*)
{
bool append_mode = false;
std::string output_filename;
@ -67,7 +67,7 @@ struct WriteFileFrontend : public Frontend {
char buffer[64 * 1024];
size_t bytes;
while (0 < (bytes = fread(buffer, 1, sizeof(buffer), f)))
while (0 < (bytes = f->readsome(buffer, sizeof(buffer))))
fwrite(buffer, bytes, 1, of);
fclose(of);