ntlib.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* Utility and Unix shadow routines for GNU Emacs support programs on NT.
  2. Copyright (C) 1994, 2002-2016 Free Software Foundation, Inc.
  3. This file is part of GNU Emacs.
  4. GNU Emacs is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or (at
  7. your option) any later version.
  8. GNU Emacs is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
  14. #include <pwd.h>
  15. #include <malloc.h>
  16. /* Include these headers now so we don't have to worry about include
  17. order dependencies in common source files. */
  18. #include <direct.h>
  19. #include <fcntl.h>
  20. #include <io.h>
  21. #include <stdio.h>
  22. #ifdef sleep
  23. #undef sleep
  24. #endif
  25. unsigned sleep (unsigned seconds);
  26. char *getwd (char *dir);
  27. int getppid (void);
  28. char * getlogin (void);
  29. char * cuserid (char * s);
  30. unsigned getegid (void);
  31. unsigned getgid (void);
  32. int setuid (unsigned uid);
  33. int setregid (unsigned rgid, unsigned gid);
  34. char * getpass (const char * prompt);
  35. int fchown (int fd, unsigned uid, unsigned gid);
  36. /* redirect or undo interceptions created by config.h */
  37. #undef access
  38. #define access _access
  39. #undef chdir
  40. #define chdir _chdir
  41. #undef chmod
  42. #define chmod _chmod
  43. #undef close
  44. #define close _close
  45. #undef creat
  46. #define creat _creat
  47. #undef ctime
  48. #undef dup
  49. #define dup _dup
  50. #undef dup2
  51. #define dup2 _dup2
  52. #undef fopen
  53. #undef mkdir
  54. #define mkdir _mkdir
  55. #undef open
  56. #define open _open
  57. #undef pipe
  58. #define pipe _pipe
  59. #undef read
  60. #define read _read
  61. #undef rmdir
  62. #define rmdir _rmdir
  63. #undef unlink
  64. #define unlink _unlink
  65. #undef write
  66. #define write _write
  67. /* map to MSVC names */
  68. #define execlp _execlp
  69. #define execvp _execvp
  70. #define fdopen _fdopen
  71. #ifndef fileno
  72. #define fileno _fileno
  73. #endif
  74. #define getcwd _getcwd
  75. #define getw _getw
  76. #define getpid _getpid
  77. #define isatty _isatty
  78. #define locking _locking
  79. #define logb _logb
  80. #define _longjmp longjmp
  81. #define popen _popen
  82. #define pclose _pclose
  83. #define umask _umask
  84. #define utime _utime
  85. #define index strchr
  86. #define rindex strrchr
  87. /* Make standard winsock definitions available if needed. */
  88. #undef _WINSOCKAPI_
  89. #undef _WINSOCK_H
  90. /* end of ntlib.h */