sys.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. Copyright (c) 2001 by Juliusz Chroboczek
  3. Permission is hereby granted, free of charge, to any person obtaining a copy
  4. of this software and associated documentation files (the "Software"), to deal
  5. in the Software without restriction, including without limitation the rights
  6. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. copies of the Software, and to permit persons to whom the Software is
  8. furnished to do so, subject to the following conditions:
  9. The above copyright notice and this permission notice shall be included in
  10. all copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17. THE SOFTWARE.
  18. */
  19. #ifndef LUIT_SYS_H
  20. #define LUIT_SYS_H 1
  21. #if defined(__GNUC__) && defined(_FORTIFY_SOURCE)
  22. #define USE_IGNORE_RC
  23. extern int ignore_unused;
  24. #define IGNORE_RC(func) ignore_unused = (int) func
  25. #else
  26. #define IGNORE_RC(func) (void) func
  27. #endif /* gcc workarounds */
  28. int waitForOutput(int fd);
  29. int waitForInput(int fd1, int fd2);
  30. int setWindowSize(int sfd, int dfd);
  31. int installHandler(int signum, void (*handler) (int));
  32. int copyTermios(int sfd, int dfd);
  33. int saveTermios(void);
  34. int restoreTermios(void);
  35. int setRawTermios(void);
  36. char *my_basename(char *path);
  37. int allocatePty(int *pty_return, char **line_return);
  38. int openTty(char *line);
  39. int droppriv(void);
  40. char *strmalloc(const char *value);
  41. #ifdef NO_LEAKS
  42. void luit_leaks(void);
  43. void charset_leaks(void);
  44. void iso2022_leaks(void);
  45. void ExitProgram(int code);
  46. #else
  47. #define ExitProgram(code) exit(code)
  48. #endif
  49. #endif /* LUIT_SYS_H */