io.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * IO Manager - The peTI-NESulator Project
  3. * os/macos/graphics.c
  4. *
  5. * Created by Manoël Trapier on 04/01/09.
  6. * Copyright (c) 2003-2018 986-Studio. All rights reserved.
  7. *
  8. * $LastChangedDate$
  9. * $Author$
  10. * $HeadURL$
  11. * $Revision$
  12. *
  13. */
  14. #include <stdio.h>
  15. #include <stdarg.h>
  16. #include <os_dependent.h>
  17. char LevelChar[] = { 'E', 'W', 'A', 'N', 'V', 'D'};
  18. ConsoleLevel console_ActualLevel = Console_Default;
  19. /* Actually nothing to do */
  20. int console_init(ConsoleLevel DefaultLevel)
  21. {
  22. console_ActualLevel = DefaultLevel;
  23. return 0;
  24. }
  25. /* Actually a simple printf with levels */
  26. int console_vprintf(const ConsoleLevel level, const char *format, va_list ap)
  27. {
  28. if (console_ActualLevel >= level)
  29. vprintf(format, ap);
  30. return 0;
  31. }
  32. int console_printf(const ConsoleLevel level, const char *format, ...)
  33. {
  34. va_list ap;
  35. va_start(ap, format);
  36. ret = console_vprintf(level, format, ap);
  37. va_end(ap);
  38. return 0;
  39. }
  40. int console_printf_d(const char *format, ...)
  41. {
  42. va_list ap;
  43. va_start(ap, format);
  44. console_vprintf (Console_Debug, format, ap);
  45. va_end(ap);
  46. return 0;
  47. }