win.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. enum
  10. {
  11. False,
  12. True,
  13. EVENTSIZE=256,
  14. };
  15. typedef struct Event Event;
  16. struct Event
  17. {
  18. int c1;
  19. int c2;
  20. int q0;
  21. int q1;
  22. int flag;
  23. int nb;
  24. int nr;
  25. char b[EVENTSIZE*UTFmax+1];
  26. Rune r[EVENTSIZE+1];
  27. };
  28. typedef struct Win Win;
  29. struct Win
  30. {
  31. int winid;
  32. int addr;
  33. Biobuf *body;
  34. int ctl;
  35. int data;
  36. int event;
  37. char buf[512];
  38. char *bufp;
  39. int nbuf;
  40. };
  41. int dead(Win*);
  42. void wnew(Win*);
  43. void wwritebody(Win*, char *s, int n);
  44. void wread(Win*, u32, u32, char*);
  45. void wclean(Win*);
  46. void wname(Win*, char*);
  47. void wdormant(Win*);
  48. void wevent(Win*, Event*);
  49. void wtagwrite(Win*, char*, int);
  50. void wwriteevent(Win*, Event*);
  51. void wslave(Win*, Channel*); /* chan(Event) */
  52. void wreplace(Win*, char*, char*, int);
  53. void wselect(Win*, char*);
  54. int wdel(Win*);
  55. int wreadall(Win*, char**);
  56. void ctlwrite(Win*, char*);
  57. int getec(Win*);
  58. int geten(Win*);
  59. int geter(Win*, char*, int*);
  60. int openfile(Win*, char*);
  61. void openbody(Win*, int);