libarchive-static 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. data/ext/Makefile +6 -0
  2. data/ext/extconf.rb +61 -0
  3. data/ext/libarchive-0.1.1/COPYING.libarchive +60 -0
  4. data/ext/libarchive-0.1.1/LICENSE.libbzip2 +42 -0
  5. data/ext/libarchive-0.1.1/README.txt +143 -0
  6. data/ext/libarchive-0.1.1/ext/Makefile.in +0 -0
  7. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.c +31 -0
  8. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.h +6 -0
  9. data/ext/libarchive-0.1.1/ext/archive_read_support_format.c +32 -0
  10. data/ext/libarchive-0.1.1/ext/archive_read_support_format.h +6 -0
  11. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.c +29 -0
  12. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.h +6 -0
  13. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.c +32 -0
  14. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.h +6 -0
  15. data/ext/libarchive-0.1.1/ext/config.h.in +22 -0
  16. data/ext/libarchive-0.1.1/ext/configure +3904 -0
  17. data/ext/libarchive-0.1.1/ext/configure.in +11 -0
  18. data/ext/libarchive-0.1.1/ext/depend +19 -0
  19. data/ext/libarchive-0.1.1/ext/extconf.rb +6 -0
  20. data/ext/libarchive-0.1.1/ext/install-sh +250 -0
  21. data/ext/libarchive-0.1.1/ext/libarchive.c +89 -0
  22. data/ext/libarchive-0.1.1/ext/libarchive_archive.c +84 -0
  23. data/ext/libarchive-0.1.1/ext/libarchive_entry.c +1015 -0
  24. data/ext/libarchive-0.1.1/ext/libarchive_internal.h +155 -0
  25. data/ext/libarchive-0.1.1/ext/libarchive_reader.c +328 -0
  26. data/ext/libarchive-0.1.1/ext/libarchive_win32.h +52 -0
  27. data/ext/libarchive-0.1.1/ext/libarchive_writer.c +246 -0
  28. data/ext/libarchive-0.1.1/libarchive.c +1762 -0
  29. data/ext/libarchive-2.8.4/Makefile.in +7076 -0
  30. data/ext/libarchive-2.8.4/build/autoconf/check_stdcall_func.m4 +51 -0
  31. data/ext/libarchive-2.8.4/build/autoconf/compile +143 -0
  32. data/ext/libarchive-2.8.4/build/autoconf/config.guess +1502 -0
  33. data/ext/libarchive-2.8.4/build/autoconf/config.sub +1708 -0
  34. data/ext/libarchive-2.8.4/build/autoconf/depcomp +630 -0
  35. data/ext/libarchive-2.8.4/build/autoconf/install-sh +291 -0
  36. data/ext/libarchive-2.8.4/build/autoconf/la_uid_t.m4 +20 -0
  37. data/ext/libarchive-2.8.4/build/autoconf/ltmain.sh +8406 -0
  38. data/ext/libarchive-2.8.4/build/autoconf/missing +376 -0
  39. data/ext/libarchive-2.8.4/build/pkgconfig/libarchive.pc.in +10 -0
  40. data/ext/libarchive-2.8.4/config.h.in +772 -0
  41. data/ext/libarchive-2.8.4/configure +17916 -0
  42. data/ext/libarchive-2.8.4/libarchive/archive.h +741 -0
  43. data/ext/libarchive-2.8.4/libarchive/archive_check_magic.c +134 -0
  44. data/ext/libarchive-2.8.4/libarchive/archive_crc32.h +66 -0
  45. data/ext/libarchive-2.8.4/libarchive/archive_endian.h +162 -0
  46. data/ext/libarchive-2.8.4/libarchive/archive_entry.c +2202 -0
  47. data/ext/libarchive-2.8.4/libarchive/archive_entry.h +524 -0
  48. data/ext/libarchive-2.8.4/libarchive/archive_entry_copy_bhfi.c +74 -0
  49. data/ext/libarchive-2.8.4/libarchive/archive_entry_copy_stat.c +77 -0
  50. data/ext/libarchive-2.8.4/libarchive/archive_entry_link_resolver.c +405 -0
  51. data/ext/libarchive-2.8.4/libarchive/archive_entry_private.h +184 -0
  52. data/ext/libarchive-2.8.4/libarchive/archive_entry_stat.c +118 -0
  53. data/ext/libarchive-2.8.4/libarchive/archive_entry_strmode.c +87 -0
  54. data/ext/libarchive-2.8.4/libarchive/archive_entry_xattr.c +158 -0
  55. data/ext/libarchive-2.8.4/libarchive/archive_hash.h +281 -0
  56. data/ext/libarchive-2.8.4/libarchive/archive_platform.h +165 -0
  57. data/ext/libarchive-2.8.4/libarchive/archive_private.h +124 -0
  58. data/ext/libarchive-2.8.4/libarchive/archive_read.c +1249 -0
  59. data/ext/libarchive-2.8.4/libarchive/archive_read_data_into_fd.c +93 -0
  60. data/ext/libarchive-2.8.4/libarchive/archive_read_disk.c +198 -0
  61. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_entry_from_file.c +570 -0
  62. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_private.h +62 -0
  63. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_set_standard_lookup.c +303 -0
  64. data/ext/libarchive-2.8.4/libarchive/archive_read_extract.c +182 -0
  65. data/ext/libarchive-2.8.4/libarchive/archive_read_open_fd.c +190 -0
  66. data/ext/libarchive-2.8.4/libarchive/archive_read_open_file.c +165 -0
  67. data/ext/libarchive-2.8.4/libarchive/archive_read_open_filename.c +272 -0
  68. data/ext/libarchive-2.8.4/libarchive/archive_read_open_memory.c +156 -0
  69. data/ext/libarchive-2.8.4/libarchive/archive_read_private.h +199 -0
  70. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_all.c +60 -0
  71. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_bzip2.c +353 -0
  72. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_compress.c +444 -0
  73. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_gzip.c +465 -0
  74. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_none.c +40 -0
  75. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_program.c +459 -0
  76. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_rpm.c +287 -0
  77. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_uu.c +627 -0
  78. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_xz.c +708 -0
  79. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_all.c +43 -0
  80. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_ar.c +584 -0
  81. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_cpio.c +777 -0
  82. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_empty.c +93 -0
  83. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_iso9660.c +2830 -0
  84. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_mtree.c +1304 -0
  85. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_raw.c +185 -0
  86. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_tar.c +2418 -0
  87. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_xar.c +3151 -0
  88. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_zip.c +903 -0
  89. data/ext/libarchive-2.8.4/libarchive/archive_string.c +453 -0
  90. data/ext/libarchive-2.8.4/libarchive/archive_string.h +148 -0
  91. data/ext/libarchive-2.8.4/libarchive/archive_string_sprintf.c +164 -0
  92. data/ext/libarchive-2.8.4/libarchive/archive_util.c +391 -0
  93. data/ext/libarchive-2.8.4/libarchive/archive_virtual.c +94 -0
  94. data/ext/libarchive-2.8.4/libarchive/archive_windows.c +1236 -0
  95. data/ext/libarchive-2.8.4/libarchive/archive_windows.h +347 -0
  96. data/ext/libarchive-2.8.4/libarchive/archive_write.c +466 -0
  97. data/ext/libarchive-2.8.4/libarchive/archive_write_disk.c +2628 -0
  98. data/ext/libarchive-2.8.4/libarchive/archive_write_disk_private.h +38 -0
  99. data/ext/libarchive-2.8.4/libarchive/archive_write_disk_set_standard_lookup.c +262 -0
  100. data/ext/libarchive-2.8.4/libarchive/archive_write_open_fd.c +141 -0
  101. data/ext/libarchive-2.8.4/libarchive/archive_write_open_file.c +105 -0
  102. data/ext/libarchive-2.8.4/libarchive/archive_write_open_filename.c +162 -0
  103. data/ext/libarchive-2.8.4/libarchive/archive_write_open_memory.c +126 -0
  104. data/ext/libarchive-2.8.4/libarchive/archive_write_private.h +122 -0
  105. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_bzip2.c +408 -0
  106. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_compress.c +492 -0
  107. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_gzip.c +477 -0
  108. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_none.c +257 -0
  109. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_program.c +347 -0
  110. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_xz.c +438 -0
  111. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format.c +72 -0
  112. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_ar.c +550 -0
  113. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_by_name.c +76 -0
  114. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio.c +344 -0
  115. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio_newc.c +295 -0
  116. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_mtree.c +1050 -0
  117. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_pax.c +1386 -0
  118. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_shar.c +626 -0
  119. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_ustar.c +587 -0
  120. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_zip.c +667 -0
  121. data/ext/libarchive-2.8.4/libarchive/config_freebsd.h +154 -0
  122. data/ext/libarchive-2.8.4/libarchive/filter_fork.c +161 -0
  123. data/ext/libarchive-2.8.4/libarchive/filter_fork.h +41 -0
  124. data/ext/libarchive-2.8.4/libarchive/filter_fork_windows.c +113 -0
  125. data/ext/libarchive-static-makefile +80 -0
  126. data/ext/libarchive-static-wrapper-makefile +22 -0
  127. data/ext/zlib-1.2.5/Makefile.in +257 -0
  128. data/ext/zlib-1.2.5/adler32.c +169 -0
  129. data/ext/zlib-1.2.5/compress.c +80 -0
  130. data/ext/zlib-1.2.5/configure +596 -0
  131. data/ext/zlib-1.2.5/crc32.c +442 -0
  132. data/ext/zlib-1.2.5/crc32.h +441 -0
  133. data/ext/zlib-1.2.5/deflate.c +1834 -0
  134. data/ext/zlib-1.2.5/deflate.h +342 -0
  135. data/ext/zlib-1.2.5/example.c +565 -0
  136. data/ext/zlib-1.2.5/gzclose.c +25 -0
  137. data/ext/zlib-1.2.5/gzguts.h +132 -0
  138. data/ext/zlib-1.2.5/gzlib.c +537 -0
  139. data/ext/zlib-1.2.5/gzread.c +653 -0
  140. data/ext/zlib-1.2.5/gzwrite.c +531 -0
  141. data/ext/zlib-1.2.5/infback.c +632 -0
  142. data/ext/zlib-1.2.5/inffast.c +340 -0
  143. data/ext/zlib-1.2.5/inffast.h +11 -0
  144. data/ext/zlib-1.2.5/inffixed.h +94 -0
  145. data/ext/zlib-1.2.5/inflate.c +1480 -0
  146. data/ext/zlib-1.2.5/inflate.h +122 -0
  147. data/ext/zlib-1.2.5/inftrees.c +330 -0
  148. data/ext/zlib-1.2.5/inftrees.h +62 -0
  149. data/ext/zlib-1.2.5/minigzip.c +440 -0
  150. data/ext/zlib-1.2.5/trees.c +1244 -0
  151. data/ext/zlib-1.2.5/trees.h +128 -0
  152. data/ext/zlib-1.2.5/uncompr.c +59 -0
  153. data/ext/zlib-1.2.5/zconf.h +428 -0
  154. data/ext/zlib-1.2.5/zlib.h +1613 -0
  155. data/ext/zlib-1.2.5/zutil.c +318 -0
  156. data/ext/zlib-1.2.5/zutil.h +274 -0
  157. metadata +211 -0
@@ -0,0 +1,347 @@
1
+ /*-
2
+ * Copyright (c) 2009 Michihiro NAKAJIMA
3
+ * Copyright (c) 2003-2006 Tim Kientzle
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without
7
+ * modification, are permitted provided that the following conditions
8
+ * are met:
9
+ * 1. Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer
11
+ * in this position and unchanged.
12
+ * 2. Redistributions in binary form must reproduce the above copyright
13
+ * notice, this list of conditions and the following disclaimer in the
14
+ * documentation and/or other materials provided with the distribution.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
17
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
20
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
+ *
27
+ * $FreeBSD$
28
+ */
29
+
30
+ #ifndef __LIBARCHIVE_BUILD
31
+ #error This header is only to be used internally to libarchive.
32
+ #endif
33
+
34
+ /*
35
+ * TODO: A lot of stuff in here isn't actually used by libarchive and
36
+ * can be trimmed out. Note that this file is used by libarchive and
37
+ * libarchive_test but nowhere else. (But note that it gets compiled
38
+ * with many different Windows environments, including MinGW, Visual
39
+ * Studio, and Cygwin. Significant changes should be tested in all three.)
40
+ */
41
+
42
+ /*
43
+ * TODO: Don't use off_t in here. Use __int64 instead. Note that
44
+ * Visual Studio and the Windows SDK define off_t as 32 bits; Win32's
45
+ * more modern file handling APIs all use __int64 instead of off_t.
46
+ */
47
+
48
+ #ifndef LIBARCHIVE_ARCHIVE_WINDOWS_H_INCLUDED
49
+ #define LIBARCHIVE_ARCHIVE_WINDOWS_H_INCLUDED
50
+
51
+ /* Start of configuration for native Win32 */
52
+
53
+ #include <errno.h>
54
+ #define set_errno(val) ((errno)=val)
55
+ #include <io.h>
56
+ #include <stdlib.h> //brings in NULL
57
+ #if defined(HAVE_STDINT_H)
58
+ #include <stdint.h>
59
+ #endif
60
+ #include <stdio.h>
61
+ #include <fcntl.h>
62
+ #include <sys/stat.h>
63
+ #include <process.h>
64
+ #include <direct.h>
65
+ #define NOCRYPT
66
+ #include <windows.h>
67
+ //#define EFTYPE 7
68
+
69
+ #if !defined(STDIN_FILENO)
70
+ #define STDIN_FILENO 0
71
+ #endif
72
+
73
+ #if !defined(STDOUT_FILENO)
74
+ #define STDOUT_FILENO 1
75
+ #endif
76
+
77
+ #if !defined(STDERR_FILENO)
78
+ #define STDERR_FILENO 2
79
+ #endif
80
+
81
+
82
+ #if defined(_MSC_VER)
83
+ /* TODO: Fix the code, don't suppress the warnings. */
84
+ #pragma warning(disable:4244) /* 'conversion' conversion from 'type1' to 'type2', possible loss of data */
85
+ #endif
86
+ #if defined(__BORLANDC__)
87
+ #pragma warn -8068 /* Constant out of range in comparison. */
88
+ #pragma warn -8072 /* Suspicious pointer arithmetic. */
89
+ #endif
90
+
91
+ #ifndef NULL
92
+ #ifdef __cplusplus
93
+ #define NULL 0
94
+ #else
95
+ #define NULL ((void *)0)
96
+ #endif
97
+ #endif
98
+
99
+ /* Alias the Windows _function to the POSIX equivalent. */
100
+ #define access _access
101
+ #define chdir __la_chdir
102
+ #define chmod __la_chmod
103
+ #define close _close
104
+ #define fcntl __la_fcntl
105
+ #ifndef fileno
106
+ #define fileno _fileno
107
+ #endif
108
+ #define fstat __la_fstat
109
+ #define ftruncate __la_ftruncate
110
+ #define futimes __la_futimes
111
+ #define getcwd _getcwd
112
+ #define link __la_link
113
+ #define lseek __la_lseek
114
+ #define lstat __la_stat
115
+ #define mbstowcs __la_mbstowcs
116
+ #define mkdir(d,m) __la_mkdir(d, m)
117
+ #define mktemp _mktemp
118
+ #define open __la_open
119
+ #define read __la_read
120
+ #define rmdir __la_rmdir
121
+ #if !defined(__BORLANDC__)
122
+ #define setmode _setmode
123
+ #endif
124
+ #define stat(path,stref) __la_stat(path,stref)
125
+ #if !defined(__BORLANDC__)
126
+ #define strdup _strdup
127
+ #endif
128
+ #define tzset _tzset
129
+ #if !defined(__BORLANDC__)
130
+ #define umask _umask
131
+ #endif
132
+ #define unlink __la_unlink
133
+ #define utimes __la_utimes
134
+ #define waitpid __la_waitpid
135
+ #define write __la_write
136
+
137
+ #ifndef O_RDONLY
138
+ #define O_RDONLY _O_RDONLY
139
+ #define O_WRONLY _O_WRONLY
140
+ #define O_TRUNC _O_TRUNC
141
+ #define O_CREAT _O_CREAT
142
+ #define O_EXCL _O_EXCL
143
+ #define O_BINARY _O_BINARY
144
+ #endif
145
+
146
+ #ifndef _S_IFIFO
147
+ #define _S_IFIFO 0010000 /* pipe */
148
+ #endif
149
+ #ifndef _S_IFCHR
150
+ #define _S_IFCHR 0020000 /* character special */
151
+ #endif
152
+ #ifndef _S_IFDIR
153
+ #define _S_IFDIR 0040000 /* directory */
154
+ #endif
155
+ #ifndef _S_IFBLK
156
+ #define _S_IFBLK 0060000 /* block special */
157
+ #endif
158
+ #ifndef _S_IFLNK
159
+ #define _S_IFLNK 0120000 /* symbolic link */
160
+ #endif
161
+ #ifndef _S_IFSOCK
162
+ #define _S_IFSOCK 0140000 /* socket */
163
+ #endif
164
+ #ifndef _S_IFREG
165
+ #define _S_IFREG 0100000 /* regular */
166
+ #endif
167
+ #ifndef _S_IFMT
168
+ #define _S_IFMT 0170000 /* file type mask */
169
+ #endif
170
+
171
+ #ifndef S_IFIFO
172
+ #define S_IFIFO _S_IFIFO
173
+ #endif
174
+ //#define S_IFCHR _S_IFCHR
175
+ //#define S_IFDIR _S_IFDIR
176
+ #ifndef S_IFBLK
177
+ #define S_IFBLK _S_IFBLK
178
+ #endif
179
+ #ifndef S_IFLNK
180
+ #define S_IFLNK _S_IFLNK
181
+ #endif
182
+ #ifndef S_IFSOCK
183
+ #define S_IFSOCK _S_IFSOCK
184
+ #endif
185
+ //#define S_IFREG _S_IFREG
186
+ //#define S_IFMT _S_IFMT
187
+
188
+ #ifndef S_ISBLK
189
+ #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) /* block special */
190
+ #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* fifo or socket */
191
+ #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) /* char special */
192
+ #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) /* directory */
193
+ #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) /* regular file */
194
+ #endif
195
+ #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* Symbolic link */
196
+ #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) /* Socket */
197
+
198
+ #define _S_ISUID 0004000 /* set user id on execution */
199
+ #define _S_ISGID 0002000 /* set group id on execution */
200
+ #define _S_ISVTX 0001000 /* save swapped text even after use */
201
+
202
+ #define S_ISUID _S_ISUID
203
+ #define S_ISGID _S_ISGID
204
+ #define S_ISVTX _S_ISVTX
205
+
206
+ #define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
207
+ #define _S_IXUSR _S_IEXEC /* read permission, user */
208
+ #define _S_IWUSR _S_IWRITE /* write permission, user */
209
+ #define _S_IRUSR _S_IREAD /* execute/search permission, user */
210
+ #define _S_IRWXG (_S_IRWXU >> 3)
211
+ #define _S_IXGRP (_S_IXUSR >> 3) /* read permission, group */
212
+ #define _S_IWGRP (_S_IWUSR >> 3) /* write permission, group */
213
+ #define _S_IRGRP (_S_IRUSR >> 3) /* execute/search permission, group */
214
+ #define _S_IRWXO (_S_IRWXG >> 3)
215
+ #define _S_IXOTH (_S_IXGRP >> 3) /* read permission, other */
216
+ #define _S_IWOTH (_S_IWGRP >> 3) /* write permission, other */
217
+ #define _S_IROTH (_S_IRGRP >> 3) /* execute/search permission, other */
218
+
219
+ #ifndef S_IRWXU
220
+ #define S_IRWXU _S_IRWXU
221
+ #define S_IXUSR _S_IXUSR
222
+ #define S_IWUSR _S_IWUSR
223
+ #define S_IRUSR _S_IRUSR
224
+ #endif
225
+ #define S_IRWXG _S_IRWXG
226
+ #define S_IXGRP _S_IXGRP
227
+ #define S_IWGRP _S_IWGRP
228
+ #define S_IRGRP _S_IRGRP
229
+ #define S_IRWXO _S_IRWXO
230
+ #define S_IXOTH _S_IXOTH
231
+ #define S_IWOTH _S_IWOTH
232
+ #define S_IROTH _S_IROTH
233
+
234
+ #define F_DUPFD 0 /* Duplicate file descriptor. */
235
+ #define F_GETFD 1 /* Get file descriptor flags. */
236
+ #define F_SETFD 2 /* Set file descriptor flags. */
237
+ #define F_GETFL 3 /* Get file status flags. */
238
+ #define F_SETFL 4 /* Set file status flags. */
239
+ #define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
240
+ #define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
241
+ #define F_GETLK 7 /* Get record locking info. */
242
+ #define F_SETLK 8 /* Set record locking info (non-blocking). */
243
+ #define F_SETLKW 9 /* Set record locking info (blocking). */
244
+
245
+ /* XXX missing */
246
+ #define F_GETLK64 7 /* Get record locking info. */
247
+ #define F_SETLK64 8 /* Set record locking info (non-blocking). */
248
+ #define F_SETLKW64 9 /* Set record locking info (blocking). */
249
+
250
+ /* File descriptor flags used with F_GETFD and F_SETFD. */
251
+ #define FD_CLOEXEC 1 /* Close on exec. */
252
+
253
+ //NOT SURE IF O_NONBLOCK is OK here but at least the 0x0004 flag is not used by anything else...
254
+ #define O_NONBLOCK 0x0004 /* Non-blocking I/O. */
255
+ //#define O_NDELAY O_NONBLOCK
256
+
257
+ /* Symbolic constants for the access() function */
258
+ #if !defined(F_OK)
259
+ #define R_OK 4 /* Test for read permission */
260
+ #define W_OK 2 /* Test for write permission */
261
+ #define X_OK 1 /* Test for execute permission */
262
+ #define F_OK 0 /* Test for existence of file */
263
+ #endif
264
+
265
+
266
+ #ifdef _LARGEFILE_SOURCE
267
+ # define __USE_LARGEFILE 1 /* declare fseeko and ftello */
268
+ #endif
269
+
270
+ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
271
+ # define __USE_FILE_OFFSET64 1 /* replace 32-bit functions by 64-bit ones */
272
+ #endif
273
+
274
+ #if __USE_LARGEFILE && __USE_FILE_OFFSET64
275
+ /* replace stat and seek by their large-file equivalents */
276
+ #undef stat
277
+ #define stat _stati64
278
+
279
+ #undef lseek
280
+ #define lseek _lseeki64
281
+ #define lseek64 _lseeki64
282
+ #define tell _telli64
283
+ #define tell64 _telli64
284
+
285
+ #ifdef __MINGW32__
286
+ # define fseek fseeko64
287
+ # define fseeko fseeko64
288
+ # define ftell ftello64
289
+ # define ftello ftello64
290
+ # define ftell64 ftello64
291
+ #endif /* __MINGW32__ */
292
+ #endif /* LARGE_FILES */
293
+
294
+ #ifdef USE_WINSOCK_TIMEVAL
295
+ /* Winsock timeval has long size tv_sec. */
296
+ #define __timeval timeval
297
+ #else
298
+ struct _timeval64i32 {
299
+ time_t tv_sec;
300
+ long tv_usec;
301
+ };
302
+ #define __timeval _timeval64i32
303
+ #endif
304
+
305
+ /* End of Win32 definitions. */
306
+
307
+ /* Tell libarchive code that we have simulations for these. */
308
+ #ifndef HAVE_FTRUNCATE
309
+ #define HAVE_FTRUNCATE 1
310
+ #endif
311
+ #ifndef HAVE_FUTIMES
312
+ #define HAVE_FUTIMES 1
313
+ #endif
314
+ #ifndef HAVE_UTIMES
315
+ #define HAVE_UTIMES 1
316
+ #endif
317
+ #ifndef HAVE_LINK
318
+ #define HAVE_LINK 1
319
+ #endif
320
+
321
+ /* Replacement POSIX function */
322
+ extern int __la_chdir(const char *path);
323
+ extern int __la_chmod(const char *path, mode_t mode);
324
+ extern int __la_fcntl(int fd, int cmd, int val);
325
+ extern int __la_fstat(int fd, struct stat *st);
326
+ extern int __la_ftruncate(int fd, off_t length);
327
+ extern int __la_futimes(int fd, const struct __timeval *times);
328
+ extern int __la_link(const char *src, const char *dst);
329
+ extern __int64 __la_lseek(int fd, __int64 offset, int whence);
330
+ extern size_t __la_mbstowcs(wchar_t *wcstr, const char *mbstr, size_t nwchars);
331
+ extern int __la_mkdir(const char *path, mode_t mode);
332
+ extern int __la_open(const char *path, int flags, ...);
333
+ extern ssize_t __la_read(int fd, void *buf, size_t nbytes);
334
+ extern int __la_rmdir(const char *path);
335
+ extern int __la_stat(const char *path, struct stat *st);
336
+ extern int __la_unlink(const char *path);
337
+ extern int __la_utimes(const char *name, const struct __timeval *times);
338
+ extern pid_t __la_waitpid(pid_t wpid, int *status, int option);
339
+ extern ssize_t __la_write(int fd, const void *buf, size_t nbytes);
340
+
341
+ #define _stat64i32(path, st) __la_stat(path, st)
342
+ #define _stat64(path, st) __la_stat(path, st)
343
+ /* for status returned by la_waitpid */
344
+ #define WIFEXITED(sts) ((sts & 0x100) == 0)
345
+ #define WEXITSTATUS(sts) (sts & 0x0FF)
346
+
347
+ #endif /* LIBARCHIVE_ARCHIVE_WINDOWS_H_INCLUDED */