xref: /minix3/external/bsd/libarchive/dist/tar/bsdtar_windows.h (revision 543adbed3a3a783ed36434adafbc258b6bde442d)
1*543adbedSBen Gras /*-
2*543adbedSBen Gras  * Copyright (c) 2009 Michihiro NAKAJIMA
3*543adbedSBen Gras  * All rights reserved.
4*543adbedSBen Gras  *
5*543adbedSBen Gras  * Redistribution and use in source and binary forms, with or without
6*543adbedSBen Gras  * modification, are permitted provided that the following conditions
7*543adbedSBen Gras  * are met:
8*543adbedSBen Gras  * 1. Redistributions of source code must retain the above copyright
9*543adbedSBen Gras  *    notice, this list of conditions and the following disclaimer.
10*543adbedSBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
11*543adbedSBen Gras  *    notice, this list of conditions and the following disclaimer in the
12*543adbedSBen Gras  *    documentation and/or other materials provided with the distribution.
13*543adbedSBen Gras  *
14*543adbedSBen Gras  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
15*543adbedSBen Gras  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16*543adbedSBen Gras  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17*543adbedSBen Gras  * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
18*543adbedSBen Gras  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19*543adbedSBen Gras  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20*543adbedSBen Gras  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21*543adbedSBen Gras  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22*543adbedSBen Gras  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23*543adbedSBen Gras  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24*543adbedSBen Gras  *
25*543adbedSBen Gras  * $FreeBSD$
26*543adbedSBen Gras  */
27*543adbedSBen Gras 
28*543adbedSBen Gras #ifndef BSDTAR_WINDOWS_H
29*543adbedSBen Gras #define BSDTAR_WINDOWS_H 1
30*543adbedSBen Gras #include <direct.h>
31*543adbedSBen Gras #include <windows.h>
32*543adbedSBen Gras 
33*543adbedSBen Gras #ifndef PRId64
34*543adbedSBen Gras #define PRId64 "I64"
35*543adbedSBen Gras #endif
36*543adbedSBen Gras #define geteuid()	0
37*543adbedSBen Gras 
38*543adbedSBen Gras #ifndef S_IFIFO
39*543adbedSBen Gras #define S_IFIFO	0010000 /* pipe */
40*543adbedSBen Gras #endif
41*543adbedSBen Gras 
42*543adbedSBen Gras #include <string.h>  /* Must include before redefining 'strdup' */
43*543adbedSBen Gras #if !defined(__BORLANDC__)
44*543adbedSBen Gras #define strdup _strdup
45*543adbedSBen Gras #endif
46*543adbedSBen Gras #if !defined(__BORLANDC__)
47*543adbedSBen Gras #define getcwd _getcwd
48*543adbedSBen Gras #endif
49*543adbedSBen Gras 
50*543adbedSBen Gras #define chdir __tar_chdir
51*543adbedSBen Gras int __tar_chdir(const char *);
52*543adbedSBen Gras 
53*543adbedSBen Gras #ifndef S_ISREG
54*543adbedSBen Gras #define S_ISREG(a)	(a & _S_IFREG)
55*543adbedSBen Gras #endif
56*543adbedSBen Gras #ifndef S_ISBLK
57*543adbedSBen Gras #define S_ISBLK(a)	(0)
58*543adbedSBen Gras #endif
59*543adbedSBen Gras 
60*543adbedSBen Gras #endif /* BSDTAR_WINDOWS_H */
61