ntlib.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /* Utility and Unix shadow routines for GNU Emacs support programs on NT.
  2. Copyright (C) 1994, 2002-2012 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
  7. (at 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 <io.h>
  20. #include <stdio.h>
  21. #ifdef sleep
  22. #undef sleep
  23. #endif
  24. void sleep (unsigned long seconds);
  25. char *getwd (char *dir);
  26. int getppid (void);
  27. char * getlogin (void);
  28. char * cuserid (char * s);
  29. unsigned getuid (void);
  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 mktemp
  56. #define mktemp _mktemp
  57. #undef open
  58. #define open _open
  59. #undef pipe
  60. #define pipe _pipe
  61. #undef read
  62. #define read _read
  63. #undef rename
  64. #undef rmdir
  65. #define rmdir _rmdir
  66. #undef unlink
  67. #define unlink _unlink
  68. #undef write
  69. #define write _write
  70. /* map to MSVC names */
  71. #define execlp _execlp
  72. #define execvp _execvp
  73. #define fdopen _fdopen
  74. #ifndef fileno
  75. #define fileno _fileno
  76. #endif
  77. #define getcwd _getcwd
  78. #define getw _getw
  79. #define getpid _getpid
  80. #define isatty _isatty
  81. #define locking _locking
  82. #define logb _logb
  83. #define _longjmp longjmp
  84. #define lseek _lseek
  85. #define popen _popen
  86. #define pclose _pclose
  87. #define umask _umask
  88. #define utime _utime
  89. #define index strchr
  90. #define rindex strrchr
  91. /* Make standard winsock definitions available if needed. */
  92. #undef _WINSOCKAPI_
  93. #undef _WINSOCK_H
  94. /* end of ntlib.h */