fns.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. // cmux will server a tty file system structured as
  10. // /s/cmux
  11. // /dev/cmuxctl
  12. // /dev/cmuxsnarf
  13. // /dev/pty*
  14. // /dev/tty*
  15. // pty0 and tty0 will be the session leaders for stuff like ^Z
  16. // all half-baked theories.
  17. void keyboardsend(char*, int);
  18. // whide/unhide will probably become console switching?
  19. int whide(Window*);
  20. int wunhide(int);
  21. void freescrtemps(void);
  22. // /dev/ttyfs/ctl
  23. int parsewctl(char**, int*, int*, char**, char*, char*);
  24. int writewctl(Xfid*, char*);
  25. Window *new(Console*, int, char*, char*, char**);
  26. int min(int, int);
  27. int max(int, int);
  28. Rune* strrune(Rune*, Rune);
  29. int isalnum(Rune);
  30. void timerstop(Timer*);
  31. void timercancel(Timer*);
  32. Timer* timerstart(int);
  33. void error(char*);
  34. void killprocs(void);
  35. int shutdown(void*, char*);
  36. void *erealloc(void*, uint);
  37. void *emalloc(uint);
  38. char *estrdup(char*);
  39. // snarf buffer? Sure, why not?
  40. // /dev/snarf can hold items to be pasted between consoles.
  41. void putsnarf(void);
  42. void getsnarf(void);
  43. void timerinit(void);
  44. void cvttorunes(char*, int, Rune*, int*, int*, int*);
  45. #define runemalloc(n) malloc((n)*sizeof(Rune))
  46. #define runerealloc(a, n) realloc(a, (n)*sizeof(Rune))
  47. #define runemove(a, b, n) memmove(a, b, (n)*sizeof(Rune))
  48. // ??
  49. void
  50. wsendctlmesg(Window *w, int m, Console *i);
  51. char*
  52. runetobyte(Rune *r, int n, int *ip);