Import libarchive 2.0.28.
[dragonfly.git] / contrib / libarchive-2.0 / libarchive / config_windows.h
1 /*-
2  * Copyright (c) 2003-2006 Tim Kientzle
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer
10  *    in this position and unchanged.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28
29 /* Start of configuration for native Win32 with Visual Studio. */
30 /* TODO: Fix this. */
31 #undef  HAVE_ACL_CREATE_ENTRY
32 #undef  HAVE_ACL_INIT
33 #undef  HAVE_ACL_SET_FD
34 #undef  HAVE_ACL_SET_FD_NP
35 #undef  HAVE_ACL_SET_FILE
36 #undef  HAVE_ACL_USER
37 #undef  HAVE_BZLIB_H
38 #undef  HAVE_CHFLAGS
39 #define HAVE_DECL_STRERROR_R 1
40 #define HAVE_EFTYPE 1
41 #define HAVE_EILSEQ 1
42 #define HAVE_ERRNO_H 1
43 #undef  HAVE_FCHDIR
44 #undef  HAVE_FCHFLAGS
45 #undef  HAVE_FCHMOD
46 #undef  HAVE_FCHOWN
47 #define HAVE_FCNTL_H 1
48 #undef  HAVE_FSEEKO
49 #undef  HAVE_FUTIMES
50 #undef  HAVE_GRP_H
51 #undef  HAVE_INTTYPES_H
52 #undef  HAVE_LCHFLAGS
53 #undef  HAVE_LCHMOD
54 #undef  HAVE_LCHOWN
55 #define HAVE_LIMITS_H 1
56 #undef  HAVE_LUTIMES
57 #define HAVE_MALLOC 1
58 #define HAVE_MEMMOVE 1
59 #define HAVE_MEMORY_H 1
60 #define HAVE_MEMSET 1
61 #define HAVE_MKDIR 1
62 #undef  HAVE_MKFIFO
63 #undef  HAVE_PATHS_H
64 #undef  HAVE_PWD_H
65 #undef  HAVE_STDINT_H
66 #define HAVE_STDLIB_H 1
67 #define HAVE_STRCHR 1
68 #define HAVE_STRDUP 1
69 #define HAVE_STRERROR 1
70 #undef  HAVE_STRERROR_R
71 #define HAVE_STRINGS_H 1
72 #define HAVE_STRING_H 1
73 #define HAVE_STRRCHR 1
74 #undef  HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
75 #undef  HAVE_STRUCT_STAT_ST_RDEV
76 #undef  HAVE_SYS_ACL_H
77 #undef  HAVE_SYS_IOCTL_H
78 #define HAVE_SYS_STAT_H 1
79 #undef  HAVE_SYS_TIME_H
80 #define HAVE_SYS_TYPES_H 1
81 #undef  HAVE_SYS_WAIT_H
82 #undef  HAVE_TIMEGM
83 #undef  HAVE_UNISTD_H
84 #define HAVE_WCHAR_H 1
85 #undef  HAVE_ZLIB_H
86 #define STDC_HEADERS 1
87 #define TIME_WITH_SYS_TIME 1
88
89 /*
90  * TODO: libarchive relies heavily on having the file type
91  * encoded as part of the mode value.  Windows kind-of, sort-of
92  * supports this, but the following needs to be carefully compared
93  * to Windows conventions and quite possibly changed extensively.
94  */
95 #define S_IFIFO  0010000                /* named pipe (fifo) */
96 //#define       S_IFCHR  0020000                /* character special */
97 //#define       S_IFDIR  0040000                /* directory */
98 #define S_IFBLK  0060000                /* block special */
99 //#define       S_IFREG  0100000                /* regular */
100 #define S_IFLNK  0120000                /* symbolic link */
101 #define S_IFSOCK 0140000                /* socket */
102 #define S_ISVTX  0001000                /* save swapped text even after use */
103 //#define       S_ISUID
104 //#define       S_ISGID
105 //#define       PATH_MAX
106 #define S_IRWXU 0700
107 #define S_IRWXG 0070
108 #define S_IRWXO 0007
109 #define S_ISDIR(m)      (((m) & 0170000) == S_IFDIR)    /* directory */
110 #define S_ISCHR(m)      (((m) & 0170000) == S_IFCHR)    /* char special */
111 #define S_ISBLK(m)      (((m) & 0170000) == S_IFBLK)    /* block special */
112 #define S_ISREG(m)      (((m) & 0170000) == S_IFREG)    /* regular file */
113 #define S_ISFIFO(m)     (((m) & 0170000) == S_IFIFO)    /* fifo or socket */
114 #define S_ISLNK(m)      (((m) & 0170000) == S_IFLNK)    /* symbolic link */
115 #define S_ISSOCK(m)     (((m) & 0170000) == S_IFSOCK)   /* socket */
116
117 /* Basic definitions for system and integer types. */
118 typedef int uid_t;
119 typedef int gid_t;
120 typedef int id_t;
121 typedef unsigned short mode_t;
122 typedef unsigned _int64 uint64_t;
123 typedef unsigned _int16 uint16_t;
124 typedef uint64_t uintmax_t;
125 typedef _int64 intmax_t;
126
127 /* Replacement for major/minor/makedev. */
128 #define major(x) ((int)(0x00ff & ((x) >> 8)))
129 #define minor(x) ((int)(0xffff00ff & (x)))
130 #define makedev(maj,min) ((0xff00 & ((maj)<<8))|(0xffff00ff & (min)))
131
132
133 #define EFTYPE 7
134 #define STDERR_FILENO 2
135
136 /* Alias the Windows _function to the POSIX equivalent. */
137 #include <io.h>
138 #define write _write
139 #define read _read
140 #define lseek _lseek
141 #define open _open
142 #define chdir _chdir
143 #define mkdir _mkdir
144 #define close _close
145
146 #define PACKAGE_NAME "libarchive"
147 #define PACKAGE_VERSION "2.0experimental"
148
149 /* TODO: Fix the code, don't suppress the warnings. */
150 #pragma warning(disable:4996)
151 #pragma warning(disable:4244)
152 #pragma warning(disable:4305)
153 #pragma warning(disable:4267)
154
155 /* End of Win32/Visual Studio definitions. */