console.cpp 661 B

123456789101112131415161718192021222324252627282930313233
  1. #include "console.h"
  2. #include <api/service/svcs/svc_console.h>
  3. #include <api/service/svc_enum.h>
  4. void Console::outputString(int severity, const char *string) {
  5. if (!console) {
  6. console = new ConsoleEnum;
  7. }
  8. if (needscan) {
  9. needscan=0;
  10. console->reset();
  11. svc_console *con = console->getNext();
  12. noconsole = (con == NULL);
  13. }
  14. if (noconsole) return;
  15. console->reset();
  16. svc_console *con = console->getNext();
  17. while (con) {
  18. con->outputString(severity, string);
  19. con = console->getNext();
  20. }
  21. }
  22. void Console::reset() {
  23. needscan=1;
  24. }
  25. int Console::needscan=1;
  26. int Console::noconsole=0;
  27. ConsoleEnum *Console::console = NULL;