ntlib.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* Utility and Unix shadow routines for GNU Emacs support programs on NT.
  2. Copyright (C) 1994, 2002-2017 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 pipe
  54. #define pipe _pipe
  55. #undef read
  56. #define read _read
  57. #undef rmdir
  58. #define rmdir _rmdir
  59. #undef unlink
  60. #define unlink _unlink
  61. #undef write
  62. #define write _write
  63. /* map to MSVC names */
  64. #define execlp _execlp
  65. #define execvp _execvp
  66. #define fdopen _fdopen
  67. #ifndef fileno
  68. #define fileno _fileno
  69. #endif
  70. #define getcwd _getcwd
  71. #define getw _getw
  72. #define getpid _getpid
  73. #define isatty _isatty
  74. #define locking _locking
  75. #define logb _logb
  76. #define _longjmp longjmp
  77. #define popen _popen
  78. #define pclose _pclose
  79. #define umask _umask
  80. #define utime _utime
  81. #define index strchr
  82. #define rindex strrchr
  83. /* Make standard winsock definitions available if needed. */
  84. #undef _WINSOCKAPI_
  85. #undef _WINSOCK_H
  86. /* end of ntlib.h */