ntlib.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* Utility and Unix shadow routines for GNU Emacs support programs on NT.
  2. Copyright (C) 1994, 2002-2015 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 <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 getuid (void);
  31. unsigned geteuid (void);
  32. unsigned getegid (void);
  33. unsigned getgid (void);
  34. int setuid (unsigned uid);
  35. int setregid (unsigned rgid, unsigned gid);
  36. char * getpass (const char * prompt);
  37. int fchown (int fd, unsigned uid, unsigned gid);
  38. int mkostemp (char * template, int flags);
  39. /* redirect or undo interceptions created by config.h */
  40. #undef access
  41. #define access _access
  42. #undef chdir
  43. #define chdir _chdir
  44. #undef chmod
  45. #define chmod _chmod
  46. #undef close
  47. #define close _close
  48. #undef creat
  49. #define creat _creat
  50. #undef ctime
  51. #undef dup
  52. #define dup _dup
  53. #undef dup2
  54. #define dup2 _dup2
  55. #undef fopen
  56. #undef mkdir
  57. #define mkdir _mkdir
  58. #undef open
  59. #define open _open
  60. #undef pipe
  61. #define pipe _pipe
  62. #undef read
  63. #define read _read
  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 popen _popen
  85. #define pclose _pclose
  86. #define umask _umask
  87. #define utime _utime
  88. #define index strchr
  89. #define rindex strrchr
  90. /* Make standard winsock definitions available if needed. */
  91. #undef _WINSOCKAPI_
  92. #undef _WINSOCK_H
  93. /* end of ntlib.h */