15139
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
1 /* Utility and Unix shadow routines for GNU Emacs support programs on NT.
|
68647
|
2 Copyright (C) 1994, 2002, 2003, 2004, 2005,
|
|
3 2006 Free Software Foundation, Inc.
|
15139
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
4
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
5 This file is part of GNU Emacs.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
6
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
7 GNU Emacs is free software; you can redistribute it and/or modify it
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
9 Free Software Foundation; either version 2, or (at your option) any later
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
10 version.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
11
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
12 GNU Emacs is distributed in the hope that it will be useful, but WITHOUT
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
15 more details.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
16
|
15742
|
17 You should have received a copy of the GNU General Public License
|
|
18 along with GNU Emacs; see the file COPYING. If not, write to the
|
64083
|
19 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
20 Boston, MA 02110-1301, USA.
|
15139
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
21
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
22 */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
23
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
24 #include <pwd.h>
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
25 #include <malloc.h>
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
26
|
19232
|
27 /* Include these headers now so we don't have to worry about include
|
|
28 order dependencies in common source files. */
|
|
29 #include <direct.h>
|
|
30 #include <io.h>
|
|
31 #include <stdio.h>
|
|
32
|
|
33 #ifdef sleep
|
|
34 #undef sleep
|
|
35 #endif
|
31082
|
36 void sleep(unsigned long seconds);
|
15674
|
37 char *getwd (char *dir);
|
15139
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
38 int getppid(void);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
39 char * getlogin ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
40 char * cuserid (char * s);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
41 int getuid ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
42 int setuid (int uid);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
43 struct passwd * getpwuid (int uid);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
44 char * getpass (const char * prompt);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
45 int fchown (int fd, int uid, int gid);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
46
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
47 #ifndef BSTRING
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
48 #define bzero(b, l) memset(b, 0, l)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
49 #define bcopy(s, d, l) memcpy(d, s, l)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
50 #define bcmp(a, b, l) memcmp(a, b, l)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
51 #endif
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
52
|
22315
|
53 /* redirect or undo interceptions created by config.h */
|
19232
|
54 #undef access
|
|
55 #define access _access
|
|
56 #undef chdir
|
|
57 #define chdir _chdir
|
|
58 #undef chmod
|
|
59 #define chmod _chmod
|
|
60 #undef close
|
|
61 #define close _close
|
|
62 #undef creat
|
|
63 #define creat _creat
|
|
64 #undef ctime
|
|
65 #undef dup
|
|
66 #define dup _dup
|
|
67 #undef dup2
|
|
68 #define dup2 _dup2
|
|
69 #undef fopen
|
|
70 #undef mkdir
|
|
71 #define mkdir _mkdir
|
|
72 #undef mktemp
|
|
73 #define mktemp _mktemp
|
|
74 #undef open
|
|
75 #define open _open
|
|
76 #undef pipe
|
|
77 #define pipe _pipe
|
|
78 #undef read
|
|
79 #define read _read
|
|
80 #undef rename
|
|
81 #undef rmdir
|
|
82 #define rmdir _rmdir
|
|
83 #undef unlink
|
|
84 #define unlink _unlink
|
|
85 #undef write
|
|
86 #define write _write
|
|
87
|
|
88 /* map to MSVC names */
|
|
89 #define execlp _execlp
|
|
90 #define execvp _execvp
|
|
91 #define fcloseall _fcloseall
|
|
92 #define fdopen _fdopen
|
|
93 #define fgetchar _fgetchar
|
63018
|
94 #ifndef fileno
|
19232
|
95 #define fileno _fileno
|
63018
|
96 #endif
|
19232
|
97 #define flushall _flushall
|
|
98 #define fputchar _fputchar
|
|
99 #define getcwd _getcwd
|
|
100 #define getw _getw
|
|
101 #define getpid _getpid
|
|
102 #define isatty _isatty
|
|
103 #define locking _locking
|
|
104 #define logb _logb
|
|
105 #define _longjmp longjmp
|
|
106 #define lseek _lseek
|
|
107 #define popen _popen
|
|
108 #define pclose _pclose
|
|
109 #define putw _putw
|
|
110 #define umask _umask
|
|
111 #define utime _utime
|
|
112 #define index strchr
|
|
113 #define rindex strrchr
|
|
114
|
22315
|
115 /* Make standard winsock definitions available if needed. */
|
|
116 #undef _WINSOCKAPI_
|
31082
|
117 #undef _WINSOCK_H
|
22315
|
118
|
15139
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
119 /* end of ntlib.h */
|
52401
|
120
|
|
121 /* arch-tag: 93444f66-7b98-4aa5-a5cd-01444094af28
|
|
122 (do not change this comment) */
|