Advertisement
Guest User

Untitled

a guest
Jan 12th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include "DeviceIOConsole.h"
  2. #include <stdio.h>
  3.  
  4. // --------------------------------------------------------------------------------------------------------------------
  5. void DeviceIOConsole_constructor(DeviceIOAbstract* this)
  6. {
  7. this->readIn = DeviceIOConsole_readIn;
  8. this->writeOut = DeviceIOConsole_writeOut;
  9. this->writeErr = DeviceIOConsole_writeErr;
  10. }
  11.  
  12. // --------------------------------------------------------------------------------------------------------------------
  13. int DeviceIOConsole_readIn(char* buffer)
  14. {
  15. return fgets (buffer, 256, stdin);
  16. }
  17.  
  18. // --------------------------------------------------------------------------------------------------------------------
  19. int DeviceIOConsole_writeOut(char* buffer)
  20. {
  21. return fprintf (stdout, "%s", buffer);
  22. }
  23.  
  24. // --------------------------------------------------------------------------------------------------------------------
  25. int DeviceIOConsole_writeErr(char* buffer)
  26. {
  27. return fprintf (stderr, "%s", buffer);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement