tty.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* include/kernel/tty.h
  2. *
  3. * Copyright (C) 2021, 2022 intirain.
  4. *
  5. * This file is part of evx.
  6. *
  7. * evx is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * evx is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with evx. If not, see <https://www.gnu.org/licenses/>
  19. */
  20. #ifndef __TTY_H
  21. #define __TTY_H
  22. #ifndef __ASSEMBLER__
  23. #include <sys/types.h>
  24. struct tty {
  25. char *dev_name;
  26. int priv_data;
  27. #define FLAGS_READABLE 1
  28. #define FLAGS_COLORS 2
  29. int flags;
  30. int (* putc) (char);
  31. struct tty *next;
  32. /* optional */
  33. char (* getc) (void);
  34. };
  35. int tty_register(struct tty *);
  36. int tty_write(struct tty *, char *);
  37. int tty_write_all(char *);
  38. extern struct klist_node ttys;
  39. #endif
  40. #endif