Merge from emacs-23
[bpt/emacs.git] / lib-src / ntlib.h
CommitLineData
c911543b 1/* Utility and Unix shadow routines for GNU Emacs support programs on NT.
294981c7 2 Copyright (C) 1994, 2002, 2003, 2004, 2005, 2006, 2007,
5df4f04c 3 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
c911543b 4
294981c7 5This file is part of GNU Emacs.
c911543b 6
294981c7
GM
7GNU Emacs is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
c911543b 11
294981c7
GM
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
c911543b 16
294981c7
GM
17You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
c911543b 19
c911543b
GV
20
21#include <pwd.h>
22#include <malloc.h>
23
6bf87eac
GV
24/* Include these headers now so we don't have to worry about include
25 order dependencies in common source files. */
26#include <direct.h>
27#include <io.h>
28#include <stdio.h>
29
30#ifdef sleep
31#undef sleep
32#endif
361358ea 33void sleep (unsigned long seconds);
4eb8218d 34char *getwd (char *dir);
361358ea
JB
35int getppid (void);
36char * getlogin (void);
c911543b 37char * cuserid (char * s);
361358ea
JB
38unsigned getuid (void);
39unsigned getegid (void);
40unsigned getgid (void);
22749e9a 41int setuid (unsigned uid);
b372fceb 42int setegid (unsigned gid);
c911543b 43char * getpass (const char * prompt);
22749e9a 44int fchown (int fd, unsigned uid, unsigned gid);
c911543b 45
14fa0be5 46/* redirect or undo interceptions created by config.h */
6bf87eac
GV
47#undef access
48#define access _access
49#undef chdir
50#define chdir _chdir
51#undef chmod
52#define chmod _chmod
53#undef close
54#define close _close
55#undef creat
56#define creat _creat
57#undef ctime
58#undef dup
59#define dup _dup
60#undef dup2
61#define dup2 _dup2
62#undef fopen
63#undef mkdir
64#define mkdir _mkdir
65#undef mktemp
66#define mktemp _mktemp
67#undef open
68#define open _open
69#undef pipe
70#define pipe _pipe
71#undef read
72#define read _read
73#undef rename
74#undef rmdir
75#define rmdir _rmdir
76#undef unlink
77#define unlink _unlink
78#undef write
79#define write _write
80
81/* map to MSVC names */
82#define execlp _execlp
83#define execvp _execvp
6bf87eac 84#define fdopen _fdopen
23bf9efb 85#ifndef fileno
6bf87eac 86#define fileno _fileno
23bf9efb 87#endif
6bf87eac
GV
88#define getcwd _getcwd
89#define getw _getw
90#define getpid _getpid
91#define isatty _isatty
92#define locking _locking
93#define logb _logb
94#define _longjmp longjmp
95#define lseek _lseek
96#define popen _popen
97#define pclose _pclose
6bf87eac
GV
98#define umask _umask
99#define utime _utime
100#define index strchr
101#define rindex strrchr
102
14fa0be5
AI
103/* Make standard winsock definitions available if needed. */
104#undef _WINSOCKAPI_
afffac46 105#undef _WINSOCK_H
14fa0be5 106
c911543b 107/* end of ntlib.h */
ab5796a9
MB
108
109/* arch-tag: 93444f66-7b98-4aa5-a5cd-01444094af28
110 (do not change this comment) */