io.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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-2009 986-Studio.
  7. *
  8. */
  9. #include <stdio.h>
  10. #include <stdarg.h>
  11. #include <os_dependent.h>
  12. char LevelChar[] = { 'E', 'W', 'A', 'N', 'V', 'D'};
  13. ConsoleLevel console_ActualLevel = Console_Default;
  14. /* Actually nothing to do */
  15. int console_init(ConsoleLevel DefaultLevel)
  16. {
  17. console_ActualLevel = DefaultLevel;
  18. return 0;
  19. }
  20. /* Actually a simple printf with levels */
  21. int console_vprintf(const ConsoleLevel level, const char *format, va_list ap)
  22. {
  23. if (console_ActualLevel >= level)
  24. vprintf(format, ap);
  25. return 0;
  26. }
  27. int console_printf(const ConsoleLevel level, const char *format, ...)
  28. {
  29. va_list ap;
  30. va_start(ap, format);
  31. ret = console_vprintf(level, format, ap);
  32. va_end(ap);
  33. return ret;
  34. }
  35. int console_printf_d(const char *format, ...)
  36. {
  37. va_list ap;
  38. va_start(ap, format);
  39. console_vprintf (Console_Debug, format, ap);
  40. va_end(ap);
  41. return 0;
  42. }