# 1 "" # 1 "bzlib.c" /*-------------------------------------------------------------*/ /*--- Library top-level functions. ---*/ /*--- bzlib.c ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ /*-- CHANGES ~~~~~~~ 0.9.0 -- original version. 0.9.0a/b -- no changes in this file. 0.9.0c * made zero-length BZ_FLUSH work correctly in bzCompress(). * fixed bzWrite/bzRead to ignore zero-length requests. * fixed bzread to correctly handle read requests after EOF. * wrong parameter order in call to bzDecompressInit in bzBuffToBuffDecompress. Fixed. --*/ #if 0 /* expanded by -frewrite-includes */ #include "spec.h" #endif /* expanded by -frewrite-includes */ # 76 "bzlib.c" # 1 "./spec.h" 1 /* Prototypes for stuff in spec.c */ void spec_initbufs(); void spec_compress(int in, int out, int level); void spec_uncompress(int in, int out, int level); int spec_init (); int spec_random_load (int fd); int spec_load (int num, char *filename, int size); int spec_read (int fd, unsigned char *buf, int size); int spec_reset (int fd); int spec_write (int fd, unsigned char *buf, int size); int spec_getc (int fd); int spec_ungetc (unsigned char ch, int fd); int spec_fread (unsigned char *buf, int size, int num, int fd); int spec_fwrite (unsigned char *buf, int size, int num, int fd); int spec_rewind (int fd); int spec_putc (unsigned char ch, int fd); int debug_time(); # 77 "bzlib.c" 2 #if 0 /* expanded by -frewrite-includes */ #include "bzlib_private.h" #endif /* expanded by -frewrite-includes */ # 77 "bzlib.c" # 1 "./bzlib_private.h" 1 /*-------------------------------------------------------------*/ /*--- Private header file for the library. ---*/ /*--- bzlib_private.h ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ #ifndef _BZLIB_PRIVATE_H #define _BZLIB_PRIVATE_H #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 65 "./bzlib_private.h" # 1 "/usr/local/popcorn/aarch64/include/stdlib.h" 1 3 #ifndef _STDLIB_H #define _STDLIB_H #ifdef __cplusplus extern "C" { #endif # 7 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 8 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 # 1 "/usr/local/popcorn/aarch64/include/features.h" 1 3 #ifndef _FEATURES_H #define _FEATURES_H #if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE) #define _GNU_SOURCE 1 #endif # 7 "/usr/local/popcorn/aarch64/include/features.h" 3 #if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE) #define _BSD_SOURCE 1 #endif # 11 "/usr/local/popcorn/aarch64/include/features.h" 3 #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) #define _BSD_SOURCE 1 #define _XOPEN_SOURCE 700 #endif # 18 "/usr/local/popcorn/aarch64/include/features.h" 3 #if __STDC_VERSION__ >= 199901L #define __restrict restrict #elif !defined(__GNUC__) # 22 "/usr/local/popcorn/aarch64/include/features.h" 3 #define __restrict #endif # 24 "/usr/local/popcorn/aarch64/include/features.h" 3 #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) #define __inline inline #elif !defined(__GNUC__) # 28 "/usr/local/popcorn/aarch64/include/features.h" 3 #define __inline #endif # 30 "/usr/local/popcorn/aarch64/include/features.h" 3 #if __STDC_VERSION__ >= 201112L #elif defined(__GNUC__) # 33 "/usr/local/popcorn/aarch64/include/features.h" 3 #define _Noreturn __attribute__((__noreturn__)) #else # 35 "/usr/local/popcorn/aarch64/include/features.h" 3 #define _Noreturn #endif # 37 "/usr/local/popcorn/aarch64/include/features.h" 3 #endif # 39 "/usr/local/popcorn/aarch64/include/features.h" 3 # 9 "/usr/local/popcorn/aarch64/include/stdlib.h" 2 3 #ifdef __cplusplus #define NULL 0L #else # 13 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #define NULL ((void*)0) #endif # 15 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #define __NEED_size_t #define __NEED_wchar_t #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 19 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 # 1 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 1 3 #define _Addr long #define _Int64 long #define _Reg long #if defined(__NEED_va_list) && !defined(__DEFINED_va_list) typedef __builtin_va_list va_list; #define __DEFINED_va_list #endif # 9 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) typedef __builtin_va_list __isoc_va_list; #define __DEFINED___isoc_va_list #endif # 14 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifndef __cplusplus #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) typedef unsigned wchar_t; #define __DEFINED_wchar_t #endif # 21 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 23 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 27 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef int blksize_t; #define __DEFINED_blksize_t #endif # 33 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned int nlink_t; #define __DEFINED_nlink_t #endif # 38 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) typedef float float_t; #define __DEFINED_float_t #endif # 44 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) typedef double double_t; #define __DEFINED_double_t #endif # 49 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) typedef struct { long long __ll; long double __ld; } max_align_t; #define __DEFINED_max_align_t #endif # 55 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_time_t) && !defined(__DEFINED_time_t) typedef long time_t; #define __DEFINED_time_t #endif # 61 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) typedef long suseconds_t; #define __DEFINED_suseconds_t #endif # 66 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; #define __DEFINED_pthread_attr_t #endif # 72 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; #define __DEFINED_pthread_mutex_t #endif # 77 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; #define __DEFINED_mtx_t #endif # 82 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; #define __DEFINED_pthread_cond_t #endif # 87 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; #define __DEFINED_cnd_t #endif # 92 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; #define __DEFINED_pthread_rwlock_t #endif # 97 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; #define __DEFINED_pthread_barrier_t #endif # 102 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_size_t) && !defined(__DEFINED_size_t) typedef unsigned _Addr size_t; #define __DEFINED_size_t #endif # 107 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) typedef unsigned _Addr uintptr_t; #define __DEFINED_uintptr_t #endif # 112 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) typedef _Addr ptrdiff_t; #define __DEFINED_ptrdiff_t #endif # 117 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) typedef _Addr ssize_t; #define __DEFINED_ssize_t #endif # 122 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) typedef _Addr intptr_t; #define __DEFINED_intptr_t #endif # 127 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) typedef _Addr regoff_t; #define __DEFINED_regoff_t #endif # 132 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_register_t) && !defined(__DEFINED_register_t) typedef _Reg register_t; #define __DEFINED_register_t #endif # 137 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) typedef signed char int8_t; #define __DEFINED_int8_t #endif # 143 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) typedef short int16_t; #define __DEFINED_int16_t #endif # 148 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) typedef int int32_t; #define __DEFINED_int32_t #endif # 153 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) typedef _Int64 int64_t; #define __DEFINED_int64_t #endif # 158 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) typedef _Int64 intmax_t; #define __DEFINED_intmax_t #endif # 163 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) typedef unsigned char uint8_t; #define __DEFINED_uint8_t #endif # 168 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) typedef unsigned short uint16_t; #define __DEFINED_uint16_t #endif # 173 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) typedef unsigned int uint32_t; #define __DEFINED_uint32_t #endif # 178 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) typedef unsigned _Int64 uint64_t; #define __DEFINED_uint64_t #endif # 183 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) typedef unsigned _Int64 u_int64_t; #define __DEFINED_u_int64_t #endif # 188 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) typedef unsigned _Int64 uintmax_t; #define __DEFINED_uintmax_t #endif # 193 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) typedef unsigned mode_t; #define __DEFINED_mode_t #endif # 199 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned _Reg nlink_t; #define __DEFINED_nlink_t #endif # 204 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_off_t) && !defined(__DEFINED_off_t) typedef _Int64 off_t; #define __DEFINED_off_t #endif # 209 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) typedef unsigned _Int64 ino_t; #define __DEFINED_ino_t #endif # 214 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) typedef unsigned _Int64 dev_t; #define __DEFINED_dev_t #endif # 219 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef long blksize_t; #define __DEFINED_blksize_t #endif # 224 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) typedef _Int64 blkcnt_t; #define __DEFINED_blkcnt_t #endif # 229 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) typedef unsigned _Int64 fsblkcnt_t; #define __DEFINED_fsblkcnt_t #endif # 234 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) typedef unsigned _Int64 fsfilcnt_t; #define __DEFINED_fsfilcnt_t #endif # 239 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 245 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) typedef unsigned long wctype_t; #define __DEFINED_wctype_t #endif # 250 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) typedef void * timer_t; #define __DEFINED_timer_t #endif # 256 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) typedef int clockid_t; #define __DEFINED_clockid_t #endif # 261 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) typedef long clock_t; #define __DEFINED_clock_t #endif # 266 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) struct timeval { time_t tv_sec; suseconds_t tv_usec; }; #define __DEFINED_struct_timeval #endif # 271 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) struct timespec { time_t tv_sec; long tv_nsec; }; #define __DEFINED_struct_timespec #endif # 276 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) typedef int pid_t; #define __DEFINED_pid_t #endif # 282 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_id_t) && !defined(__DEFINED_id_t) typedef unsigned id_t; #define __DEFINED_id_t #endif # 287 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) typedef unsigned uid_t; #define __DEFINED_uid_t #endif # 292 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) typedef unsigned gid_t; #define __DEFINED_gid_t #endif # 297 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_key_t) && !defined(__DEFINED_key_t) typedef int key_t; #define __DEFINED_key_t #endif # 302 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) typedef unsigned useconds_t; #define __DEFINED_useconds_t #endif # 307 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifdef __cplusplus #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef unsigned long pthread_t; #define __DEFINED_pthread_t #endif # 314 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #else # 316 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef struct __pthread * pthread_t; #define __DEFINED_pthread_t #endif # 320 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 322 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) typedef int pthread_once_t; #define __DEFINED_pthread_once_t #endif # 326 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) typedef unsigned pthread_key_t; #define __DEFINED_pthread_key_t #endif # 331 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) typedef int pthread_spinlock_t; #define __DEFINED_pthread_spinlock_t #endif # 336 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) typedef struct { unsigned __attr; } pthread_mutexattr_t; #define __DEFINED_pthread_mutexattr_t #endif # 341 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) typedef struct { unsigned __attr; } pthread_condattr_t; #define __DEFINED_pthread_condattr_t #endif # 346 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) typedef struct { unsigned __attr; } pthread_barrierattr_t; #define __DEFINED_pthread_barrierattr_t #endif # 351 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; #define __DEFINED_pthread_rwlockattr_t #endif # 356 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_FILE) && !defined(__DEFINED_FILE) typedef struct _IO_FILE FILE; #define __DEFINED_FILE #endif # 362 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; #define __DEFINED_mbstate_t #endif # 368 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) typedef struct __locale_struct * locale_t; #define __DEFINED_locale_t #endif # 374 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; #define __DEFINED_sigset_t #endif # 380 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) struct iovec { void *iov_base; size_t iov_len; }; #define __DEFINED_struct_iovec #endif # 386 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) typedef unsigned socklen_t; #define __DEFINED_socklen_t #endif # 392 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) typedef unsigned short sa_family_t; #define __DEFINED_sa_family_t #endif # 397 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #undef _Addr #undef _Int64 #undef _Reg # 20 "/usr/local/popcorn/aarch64/include/stdlib.h" 2 3 int atoi (const char *); long atol (const char *); long long atoll (const char *); double atof (const char *); float strtof (const char *__restrict, char **__restrict); double strtod (const char *__restrict, char **__restrict); long double strtold (const char *__restrict, char **__restrict); long strtol (const char *__restrict, char **__restrict, int); unsigned long strtoul (const char *__restrict, char **__restrict, int); long long strtoll (const char *__restrict, char **__restrict, int); unsigned long long strtoull (const char *__restrict, char **__restrict, int); int rand (void); void srand (unsigned); void *malloc (size_t); void *calloc (size_t, size_t); void *realloc (void *, size_t); void free (void *); void *aligned_alloc(size_t, size_t); _Noreturn void abort (void); int atexit (void (*) (void)); _Noreturn void exit (int); _Noreturn void _Exit (int); int at_quick_exit (void (*) (void)); _Noreturn void quick_exit (int); char *getenv (const char *); int system (const char *); void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *)); void qsort (void *, size_t, size_t, int (*)(const void *, const void *)); int abs (int); long labs (long); long long llabs (long long); typedef struct { int quot, rem; } div_t; typedef struct { long quot, rem; } ldiv_t; typedef struct { long long quot, rem; } lldiv_t; div_t div (int, int); ldiv_t ldiv (long, long); lldiv_t lldiv (long long, long long); int mblen (const char *, size_t); int mbtowc (wchar_t *__restrict, const char *__restrict, size_t); int wctomb (char *, wchar_t); size_t mbstowcs (wchar_t *__restrict, const char *__restrict, size_t); size_t wcstombs (char *__restrict, const wchar_t *__restrict, size_t); #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 size_t __ctype_get_mb_cur_max(void); #define MB_CUR_MAX (__ctype_get_mb_cur_max()) #define RAND_MAX (0x7fffffff) #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) #define WNOHANG 1 #define WUNTRACED 2 #define WEXITSTATUS(s) (((s) & 0xff00) >> 8) #define WTERMSIG(s) ((s) & 0x7f) #define WSTOPSIG(s) WEXITSTATUS(s) #define WIFEXITED(s) (!WTERMSIG(s)) #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) int posix_memalign (void **, size_t, size_t); int setenv (const char *, const char *, int); int unsetenv (const char *); int mkstemp (char *); int mkostemp (char *, int); char *mkdtemp (char *); int getsubopt (char **, char *const *, char **); int rand_r (unsigned *); #endif # 109 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) char *realpath (const char *__restrict, char *__restrict); long int random (void); void srandom (unsigned int); char *initstate (unsigned int, char *, size_t); char *setstate (char *); int putenv (char *); int posix_openpt (int); int grantpt (int); int unlockpt (int); char *ptsname (int); char *l64a (long); long a64l (const char *); void setkey (const char *); double drand48 (void); double erand48 (unsigned short [3]); long int lrand48 (void); long int nrand48 (unsigned short [3]); long mrand48 (void); long jrand48 (unsigned short [3]); void srand48 (long); unsigned short *seed48 (unsigned short [3]); void lcong48 (unsigned short [7]); #endif # 136 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 138 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 # 1 "/usr/local/popcorn/aarch64/include/alloca.h" 1 3 #ifndef _ALLOCA_H #define _ALLOCA_H #ifdef __cplusplus extern "C" { #endif # 7 "/usr/local/popcorn/aarch64/include/alloca.h" 3 #define __NEED_size_t #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 9 "/usr/local/popcorn/aarch64/include/alloca.h" 3 # 1 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 1 3 #define _Addr long #define _Int64 long #define _Reg long #if defined(__NEED_va_list) && !defined(__DEFINED_va_list) typedef __builtin_va_list va_list; #define __DEFINED_va_list #endif # 9 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) typedef __builtin_va_list __isoc_va_list; #define __DEFINED___isoc_va_list #endif # 14 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifndef __cplusplus #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) typedef unsigned wchar_t; #define __DEFINED_wchar_t #endif # 21 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 23 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 27 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef int blksize_t; #define __DEFINED_blksize_t #endif # 33 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned int nlink_t; #define __DEFINED_nlink_t #endif # 38 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) typedef float float_t; #define __DEFINED_float_t #endif # 44 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) typedef double double_t; #define __DEFINED_double_t #endif # 49 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) typedef struct { long long __ll; long double __ld; } max_align_t; #define __DEFINED_max_align_t #endif # 55 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_time_t) && !defined(__DEFINED_time_t) typedef long time_t; #define __DEFINED_time_t #endif # 61 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) typedef long suseconds_t; #define __DEFINED_suseconds_t #endif # 66 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; #define __DEFINED_pthread_attr_t #endif # 72 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; #define __DEFINED_pthread_mutex_t #endif # 77 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; #define __DEFINED_mtx_t #endif # 82 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; #define __DEFINED_pthread_cond_t #endif # 87 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; #define __DEFINED_cnd_t #endif # 92 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; #define __DEFINED_pthread_rwlock_t #endif # 97 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; #define __DEFINED_pthread_barrier_t #endif # 102 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_size_t) && !defined(__DEFINED_size_t) typedef unsigned _Addr size_t; #define __DEFINED_size_t #endif # 107 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) typedef unsigned _Addr uintptr_t; #define __DEFINED_uintptr_t #endif # 112 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) typedef _Addr ptrdiff_t; #define __DEFINED_ptrdiff_t #endif # 117 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) typedef _Addr ssize_t; #define __DEFINED_ssize_t #endif # 122 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) typedef _Addr intptr_t; #define __DEFINED_intptr_t #endif # 127 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) typedef _Addr regoff_t; #define __DEFINED_regoff_t #endif # 132 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_register_t) && !defined(__DEFINED_register_t) typedef _Reg register_t; #define __DEFINED_register_t #endif # 137 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) typedef signed char int8_t; #define __DEFINED_int8_t #endif # 143 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) typedef short int16_t; #define __DEFINED_int16_t #endif # 148 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) typedef int int32_t; #define __DEFINED_int32_t #endif # 153 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) typedef _Int64 int64_t; #define __DEFINED_int64_t #endif # 158 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) typedef _Int64 intmax_t; #define __DEFINED_intmax_t #endif # 163 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) typedef unsigned char uint8_t; #define __DEFINED_uint8_t #endif # 168 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) typedef unsigned short uint16_t; #define __DEFINED_uint16_t #endif # 173 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) typedef unsigned int uint32_t; #define __DEFINED_uint32_t #endif # 178 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) typedef unsigned _Int64 uint64_t; #define __DEFINED_uint64_t #endif # 183 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) typedef unsigned _Int64 u_int64_t; #define __DEFINED_u_int64_t #endif # 188 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) typedef unsigned _Int64 uintmax_t; #define __DEFINED_uintmax_t #endif # 193 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) typedef unsigned mode_t; #define __DEFINED_mode_t #endif # 199 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned _Reg nlink_t; #define __DEFINED_nlink_t #endif # 204 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_off_t) && !defined(__DEFINED_off_t) typedef _Int64 off_t; #define __DEFINED_off_t #endif # 209 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) typedef unsigned _Int64 ino_t; #define __DEFINED_ino_t #endif # 214 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) typedef unsigned _Int64 dev_t; #define __DEFINED_dev_t #endif # 219 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef long blksize_t; #define __DEFINED_blksize_t #endif # 224 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) typedef _Int64 blkcnt_t; #define __DEFINED_blkcnt_t #endif # 229 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) typedef unsigned _Int64 fsblkcnt_t; #define __DEFINED_fsblkcnt_t #endif # 234 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) typedef unsigned _Int64 fsfilcnt_t; #define __DEFINED_fsfilcnt_t #endif # 239 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 245 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) typedef unsigned long wctype_t; #define __DEFINED_wctype_t #endif # 250 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) typedef void * timer_t; #define __DEFINED_timer_t #endif # 256 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) typedef int clockid_t; #define __DEFINED_clockid_t #endif # 261 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) typedef long clock_t; #define __DEFINED_clock_t #endif # 266 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) struct timeval { time_t tv_sec; suseconds_t tv_usec; }; #define __DEFINED_struct_timeval #endif # 271 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) struct timespec { time_t tv_sec; long tv_nsec; }; #define __DEFINED_struct_timespec #endif # 276 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) typedef int pid_t; #define __DEFINED_pid_t #endif # 282 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_id_t) && !defined(__DEFINED_id_t) typedef unsigned id_t; #define __DEFINED_id_t #endif # 287 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) typedef unsigned uid_t; #define __DEFINED_uid_t #endif # 292 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) typedef unsigned gid_t; #define __DEFINED_gid_t #endif # 297 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_key_t) && !defined(__DEFINED_key_t) typedef int key_t; #define __DEFINED_key_t #endif # 302 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) typedef unsigned useconds_t; #define __DEFINED_useconds_t #endif # 307 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifdef __cplusplus #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef unsigned long pthread_t; #define __DEFINED_pthread_t #endif # 314 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #else # 316 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef struct __pthread * pthread_t; #define __DEFINED_pthread_t #endif # 320 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 322 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) typedef int pthread_once_t; #define __DEFINED_pthread_once_t #endif # 326 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) typedef unsigned pthread_key_t; #define __DEFINED_pthread_key_t #endif # 331 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) typedef int pthread_spinlock_t; #define __DEFINED_pthread_spinlock_t #endif # 336 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) typedef struct { unsigned __attr; } pthread_mutexattr_t; #define __DEFINED_pthread_mutexattr_t #endif # 341 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) typedef struct { unsigned __attr; } pthread_condattr_t; #define __DEFINED_pthread_condattr_t #endif # 346 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) typedef struct { unsigned __attr; } pthread_barrierattr_t; #define __DEFINED_pthread_barrierattr_t #endif # 351 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; #define __DEFINED_pthread_rwlockattr_t #endif # 356 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_FILE) && !defined(__DEFINED_FILE) typedef struct _IO_FILE FILE; #define __DEFINED_FILE #endif # 362 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; #define __DEFINED_mbstate_t #endif # 368 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) typedef struct __locale_struct * locale_t; #define __DEFINED_locale_t #endif # 374 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; #define __DEFINED_sigset_t #endif # 380 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) struct iovec { void *iov_base; size_t iov_len; }; #define __DEFINED_struct_iovec #endif # 386 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) typedef unsigned socklen_t; #define __DEFINED_socklen_t #endif # 392 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) typedef unsigned short sa_family_t; #define __DEFINED_sa_family_t #endif # 397 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #undef _Addr #undef _Int64 #undef _Reg # 10 "/usr/local/popcorn/aarch64/include/alloca.h" 2 3 void *alloca(size_t); #ifdef __GNUC__ #define alloca __builtin_alloca #endif # 16 "/usr/local/popcorn/aarch64/include/alloca.h" 3 #ifdef __cplusplus } #endif # 20 "/usr/local/popcorn/aarch64/include/alloca.h" 3 #endif # 22 "/usr/local/popcorn/aarch64/include/alloca.h" 3 # 139 "/usr/local/popcorn/aarch64/include/stdlib.h" 2 3 char *mktemp (char *); int mkstemps (char *, int); int mkostemps (char *, int, int); void *valloc (size_t); void *memalign(size_t, size_t); int getloadavg(double *, int); int clearenv(void); #define WCOREDUMP(s) ((s) & 0x80) #define WIFCONTINUED(s) ((s) == 0xffff) #endif # 149 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #ifdef _GNU_SOURCE int ptsname_r(int, char *, size_t); char *ecvt(double, int, int *, int *); char *fcvt(double, int, int *, int *); char *gcvt(double, int, char *); struct __locale_struct; float strtof_l(const char *__restrict, char **__restrict, struct __locale_struct *); double strtod_l(const char *__restrict, char **__restrict, struct __locale_struct *); long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *); #endif # 160 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #define mkstemp64 mkstemp #define mkostemp64 mkostemp #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define mkstemps64 mkstemps #define mkostemps64 mkostemps #endif # 168 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #endif # 169 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #ifdef __cplusplus } #endif # 173 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 #endif # 175 "/usr/local/popcorn/aarch64/include/stdlib.h" 3 # 66 "./bzlib_private.h" 2 #ifndef BZ_NO_STDIO #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 68 "./bzlib_private.h" # 1 "/usr/local/popcorn/aarch64/include/stdio.h" 1 3 #ifndef _STDIO_H #define _STDIO_H #ifdef __cplusplus extern "C" { #endif # 7 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 8 "/usr/local/popcorn/aarch64/include/stdio.h" 3 # 9 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #define __NEED_FILE #define __NEED___isoc_va_list #define __NEED_size_t #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) #define __NEED_ssize_t #define __NEED_off_t #define __NEED_va_list #endif # 21 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 22 "/usr/local/popcorn/aarch64/include/stdio.h" 3 # 1 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 1 3 #define _Addr long #define _Int64 long #define _Reg long #if defined(__NEED_va_list) && !defined(__DEFINED_va_list) typedef __builtin_va_list va_list; #define __DEFINED_va_list #endif # 9 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) typedef __builtin_va_list __isoc_va_list; #define __DEFINED___isoc_va_list #endif # 14 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifndef __cplusplus #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) typedef unsigned wchar_t; #define __DEFINED_wchar_t #endif # 21 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 23 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 27 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef int blksize_t; #define __DEFINED_blksize_t #endif # 33 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned int nlink_t; #define __DEFINED_nlink_t #endif # 38 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) typedef float float_t; #define __DEFINED_float_t #endif # 44 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) typedef double double_t; #define __DEFINED_double_t #endif # 49 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) typedef struct { long long __ll; long double __ld; } max_align_t; #define __DEFINED_max_align_t #endif # 55 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_time_t) && !defined(__DEFINED_time_t) typedef long time_t; #define __DEFINED_time_t #endif # 61 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) typedef long suseconds_t; #define __DEFINED_suseconds_t #endif # 66 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; #define __DEFINED_pthread_attr_t #endif # 72 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; #define __DEFINED_pthread_mutex_t #endif # 77 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; #define __DEFINED_mtx_t #endif # 82 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; #define __DEFINED_pthread_cond_t #endif # 87 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; #define __DEFINED_cnd_t #endif # 92 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; #define __DEFINED_pthread_rwlock_t #endif # 97 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; #define __DEFINED_pthread_barrier_t #endif # 102 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_size_t) && !defined(__DEFINED_size_t) typedef unsigned _Addr size_t; #define __DEFINED_size_t #endif # 107 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) typedef unsigned _Addr uintptr_t; #define __DEFINED_uintptr_t #endif # 112 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) typedef _Addr ptrdiff_t; #define __DEFINED_ptrdiff_t #endif # 117 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) typedef _Addr ssize_t; #define __DEFINED_ssize_t #endif # 122 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) typedef _Addr intptr_t; #define __DEFINED_intptr_t #endif # 127 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) typedef _Addr regoff_t; #define __DEFINED_regoff_t #endif # 132 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_register_t) && !defined(__DEFINED_register_t) typedef _Reg register_t; #define __DEFINED_register_t #endif # 137 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) typedef signed char int8_t; #define __DEFINED_int8_t #endif # 143 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) typedef short int16_t; #define __DEFINED_int16_t #endif # 148 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) typedef int int32_t; #define __DEFINED_int32_t #endif # 153 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) typedef _Int64 int64_t; #define __DEFINED_int64_t #endif # 158 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) typedef _Int64 intmax_t; #define __DEFINED_intmax_t #endif # 163 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) typedef unsigned char uint8_t; #define __DEFINED_uint8_t #endif # 168 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) typedef unsigned short uint16_t; #define __DEFINED_uint16_t #endif # 173 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) typedef unsigned int uint32_t; #define __DEFINED_uint32_t #endif # 178 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) typedef unsigned _Int64 uint64_t; #define __DEFINED_uint64_t #endif # 183 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) typedef unsigned _Int64 u_int64_t; #define __DEFINED_u_int64_t #endif # 188 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) typedef unsigned _Int64 uintmax_t; #define __DEFINED_uintmax_t #endif # 193 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) typedef unsigned mode_t; #define __DEFINED_mode_t #endif # 199 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned _Reg nlink_t; #define __DEFINED_nlink_t #endif # 204 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_off_t) && !defined(__DEFINED_off_t) typedef _Int64 off_t; #define __DEFINED_off_t #endif # 209 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) typedef unsigned _Int64 ino_t; #define __DEFINED_ino_t #endif # 214 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) typedef unsigned _Int64 dev_t; #define __DEFINED_dev_t #endif # 219 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef long blksize_t; #define __DEFINED_blksize_t #endif # 224 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) typedef _Int64 blkcnt_t; #define __DEFINED_blkcnt_t #endif # 229 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) typedef unsigned _Int64 fsblkcnt_t; #define __DEFINED_fsblkcnt_t #endif # 234 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) typedef unsigned _Int64 fsfilcnt_t; #define __DEFINED_fsfilcnt_t #endif # 239 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 245 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) typedef unsigned long wctype_t; #define __DEFINED_wctype_t #endif # 250 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) typedef void * timer_t; #define __DEFINED_timer_t #endif # 256 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) typedef int clockid_t; #define __DEFINED_clockid_t #endif # 261 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) typedef long clock_t; #define __DEFINED_clock_t #endif # 266 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) struct timeval { time_t tv_sec; suseconds_t tv_usec; }; #define __DEFINED_struct_timeval #endif # 271 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) struct timespec { time_t tv_sec; long tv_nsec; }; #define __DEFINED_struct_timespec #endif # 276 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) typedef int pid_t; #define __DEFINED_pid_t #endif # 282 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_id_t) && !defined(__DEFINED_id_t) typedef unsigned id_t; #define __DEFINED_id_t #endif # 287 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) typedef unsigned uid_t; #define __DEFINED_uid_t #endif # 292 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) typedef unsigned gid_t; #define __DEFINED_gid_t #endif # 297 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_key_t) && !defined(__DEFINED_key_t) typedef int key_t; #define __DEFINED_key_t #endif # 302 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) typedef unsigned useconds_t; #define __DEFINED_useconds_t #endif # 307 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifdef __cplusplus #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef unsigned long pthread_t; #define __DEFINED_pthread_t #endif # 314 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #else # 316 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef struct __pthread * pthread_t; #define __DEFINED_pthread_t #endif # 320 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 322 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) typedef int pthread_once_t; #define __DEFINED_pthread_once_t #endif # 326 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) typedef unsigned pthread_key_t; #define __DEFINED_pthread_key_t #endif # 331 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) typedef int pthread_spinlock_t; #define __DEFINED_pthread_spinlock_t #endif # 336 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) typedef struct { unsigned __attr; } pthread_mutexattr_t; #define __DEFINED_pthread_mutexattr_t #endif # 341 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) typedef struct { unsigned __attr; } pthread_condattr_t; #define __DEFINED_pthread_condattr_t #endif # 346 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) typedef struct { unsigned __attr; } pthread_barrierattr_t; #define __DEFINED_pthread_barrierattr_t #endif # 351 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; #define __DEFINED_pthread_rwlockattr_t #endif # 356 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_FILE) && !defined(__DEFINED_FILE) typedef struct _IO_FILE FILE; #define __DEFINED_FILE #endif # 362 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; #define __DEFINED_mbstate_t #endif # 368 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) typedef struct __locale_struct * locale_t; #define __DEFINED_locale_t #endif # 374 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; #define __DEFINED_sigset_t #endif # 380 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) struct iovec { void *iov_base; size_t iov_len; }; #define __DEFINED_struct_iovec #endif # 386 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) typedef unsigned socklen_t; #define __DEFINED_socklen_t #endif # 392 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) typedef unsigned short sa_family_t; #define __DEFINED_sa_family_t #endif # 397 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #undef _Addr #undef _Int64 #undef _Reg # 23 "/usr/local/popcorn/aarch64/include/stdio.h" 2 3 #ifdef __cplusplus #define NULL 0L #else # 27 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #define NULL ((void*)0) #endif # 29 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #undef EOF #define EOF (-1) #undef SEEK_SET #undef SEEK_CUR #undef SEEK_END #define SEEK_SET 0 #define SEEK_CUR 1 #define SEEK_END 2 #define _IOFBF 0 #define _IOLBF 1 #define _IONBF 2 #define BUFSIZ 1024 #define FILENAME_MAX 4096 #define FOPEN_MAX 1000 #define TMP_MAX 10000 #define L_tmpnam 20 typedef union _G_fpos64_t { char __opaque[16]; double __align; } fpos_t; extern FILE *const stdin; extern FILE *const stdout; extern FILE *const stderr; #define stdin (stdin) #define stdout (stdout) #define stderr (stderr) FILE *fopen(const char *__restrict, const char *__restrict); FILE *freopen(const char *__restrict, const char *__restrict, FILE *__restrict); int fclose(FILE *); int remove(const char *); int rename(const char *, const char *); int feof(FILE *); int ferror(FILE *); int fflush(FILE *); void clearerr(FILE *); int fseek(FILE *, long, int); long ftell(FILE *); void rewind(FILE *); int fgetpos(FILE *__restrict, fpos_t *__restrict); int fsetpos(FILE *, const fpos_t *); size_t fread(void *__restrict, size_t, size_t, FILE *__restrict); size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict); int fgetc(FILE *); int getc(FILE *); int getchar(void); int ungetc(int, FILE *); int fputc(int, FILE *); int putc(int, FILE *); int putchar(int); char *fgets(char *__restrict, int, FILE *__restrict); #if __STDC_VERSION__ < 201112L char *gets(char *); #endif # 98 "/usr/local/popcorn/aarch64/include/stdio.h" 3 int fputs(const char *__restrict, FILE *__restrict); int puts(const char *); int printf(const char *__restrict, ...); int fprintf(FILE *__restrict, const char *__restrict, ...); int sprintf(char *__restrict, const char *__restrict, ...); int snprintf(char *__restrict, size_t, const char *__restrict, ...); int vprintf(const char *__restrict, __isoc_va_list); int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list); int vsprintf(char *__restrict, const char *__restrict, __isoc_va_list); int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list); int scanf(const char *__restrict, ...); int fscanf(FILE *__restrict, const char *__restrict, ...); int sscanf(const char *__restrict, const char *__restrict, ...); int vscanf(const char *__restrict, __isoc_va_list); int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list); int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list); void perror(const char *); int setvbuf(FILE *__restrict, char *__restrict, int, size_t); void setbuf(FILE *__restrict, char *__restrict); char *tmpnam(char *); FILE *tmpfile(void); #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) FILE *fmemopen(void *__restrict, size_t, const char *__restrict); FILE *open_memstream(char **, size_t *); FILE *fdopen(int, const char *); FILE *popen(const char *, const char *); int pclose(FILE *); int fileno(FILE *); int fseeko(FILE *, off_t, int); off_t ftello(FILE *); int dprintf(int, const char *__restrict, ...); int vdprintf(int, const char *__restrict, __isoc_va_list); void flockfile(FILE *); int ftrylockfile(FILE *); void funlockfile(FILE *); int getc_unlocked(FILE *); int getchar_unlocked(void); int putc_unlocked(int, FILE *); int putchar_unlocked(int); ssize_t getdelim(char **__restrict, size_t *__restrict, int, FILE *__restrict); ssize_t getline(char **__restrict, size_t *__restrict, FILE *__restrict); int renameat(int, const char *, int, const char *); char *ctermid(char *); #define L_ctermid 20 #endif # 153 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) #define P_tmpdir "/tmp" char *tempnam(const char *, const char *); #endif # 160 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #define L_cuserid 20 char *cuserid(char *); void setlinebuf(FILE *); void setbuffer(FILE *, char *, size_t); int fgetc_unlocked(FILE *); int fputc_unlocked(int, FILE *); int fflush_unlocked(FILE *); size_t fread_unlocked(void *, size_t, size_t, FILE *); size_t fwrite_unlocked(const void *, size_t, size_t, FILE *); void clearerr_unlocked(FILE *); int feof_unlocked(FILE *); int ferror_unlocked(FILE *); int fileno_unlocked(FILE *); int getw(FILE *); int putw(int, FILE *); char *fgetln(FILE *, size_t *); int asprintf(char **, const char *, ...); int vasprintf(char **, const char *, __isoc_va_list); #endif # 181 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #ifdef _GNU_SOURCE char *fgets_unlocked(char *, int, FILE *); int fputs_unlocked(const char *, FILE *); #endif # 186 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) #define tmpfile64 tmpfile #define fopen64 fopen #define freopen64 freopen #define fseeko64 fseeko #define ftello64 ftello #define fgetpos64 fgetpos #define fsetpos64 fsetpos #define fpos64_t fpos_t #define off64_t off_t #endif # 198 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #ifdef __cplusplus } #endif # 202 "/usr/local/popcorn/aarch64/include/stdio.h" 3 #endif # 204 "/usr/local/popcorn/aarch64/include/stdio.h" 3 # 69 "./bzlib_private.h" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 69 "./bzlib_private.h" # 1 "/usr/local/popcorn/aarch64/include/ctype.h" 1 3 #ifndef _CTYPE_H #define _CTYPE_H #ifdef __cplusplus extern "C" { #endif # 7 "/usr/local/popcorn/aarch64/include/ctype.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 8 "/usr/local/popcorn/aarch64/include/ctype.h" 3 # 9 "/usr/local/popcorn/aarch64/include/ctype.h" 3 int isalnum(int); int isalpha(int); int isblank(int); int iscntrl(int); int isdigit(int); int isgraph(int); int islower(int); int isprint(int); int ispunct(int); int isspace(int); int isupper(int); int isxdigit(int); int tolower(int); int toupper(int); #ifndef __cplusplus static __inline int __isspace(int _c) { return _c == ' ' || (unsigned)_c-'\t' < 5; } #define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a)|32)-'a') < 26) #define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a)-'0') < 10) #define islower(a) (0 ? islower(a) : ((unsigned)(a)-'a') < 26) #define isupper(a) (0 ? isupper(a) : ((unsigned)(a)-'A') < 26) #define isprint(a) (0 ? isprint(a) : ((unsigned)(a)-0x20) < 0x5f) #define isgraph(a) (0 ? isgraph(a) : ((unsigned)(a)-0x21) < 0x5e) #define isspace(a) __isspace(a) #endif # 39 "/usr/local/popcorn/aarch64/include/ctype.h" 3 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) #define __NEED_locale_t #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 46 "/usr/local/popcorn/aarch64/include/ctype.h" 3 # 1 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 1 3 #define _Addr long #define _Int64 long #define _Reg long #if defined(__NEED_va_list) && !defined(__DEFINED_va_list) typedef __builtin_va_list va_list; #define __DEFINED_va_list #endif # 9 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) typedef __builtin_va_list __isoc_va_list; #define __DEFINED___isoc_va_list #endif # 14 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifndef __cplusplus #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) typedef unsigned wchar_t; #define __DEFINED_wchar_t #endif # 21 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 23 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 27 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef int blksize_t; #define __DEFINED_blksize_t #endif # 33 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned int nlink_t; #define __DEFINED_nlink_t #endif # 38 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) typedef float float_t; #define __DEFINED_float_t #endif # 44 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) typedef double double_t; #define __DEFINED_double_t #endif # 49 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) typedef struct { long long __ll; long double __ld; } max_align_t; #define __DEFINED_max_align_t #endif # 55 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_time_t) && !defined(__DEFINED_time_t) typedef long time_t; #define __DEFINED_time_t #endif # 61 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) typedef long suseconds_t; #define __DEFINED_suseconds_t #endif # 66 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; #define __DEFINED_pthread_attr_t #endif # 72 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; #define __DEFINED_pthread_mutex_t #endif # 77 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; #define __DEFINED_mtx_t #endif # 82 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; #define __DEFINED_pthread_cond_t #endif # 87 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; #define __DEFINED_cnd_t #endif # 92 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; #define __DEFINED_pthread_rwlock_t #endif # 97 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; #define __DEFINED_pthread_barrier_t #endif # 102 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_size_t) && !defined(__DEFINED_size_t) typedef unsigned _Addr size_t; #define __DEFINED_size_t #endif # 107 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) typedef unsigned _Addr uintptr_t; #define __DEFINED_uintptr_t #endif # 112 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) typedef _Addr ptrdiff_t; #define __DEFINED_ptrdiff_t #endif # 117 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) typedef _Addr ssize_t; #define __DEFINED_ssize_t #endif # 122 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) typedef _Addr intptr_t; #define __DEFINED_intptr_t #endif # 127 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) typedef _Addr regoff_t; #define __DEFINED_regoff_t #endif # 132 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_register_t) && !defined(__DEFINED_register_t) typedef _Reg register_t; #define __DEFINED_register_t #endif # 137 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) typedef signed char int8_t; #define __DEFINED_int8_t #endif # 143 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) typedef short int16_t; #define __DEFINED_int16_t #endif # 148 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) typedef int int32_t; #define __DEFINED_int32_t #endif # 153 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) typedef _Int64 int64_t; #define __DEFINED_int64_t #endif # 158 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) typedef _Int64 intmax_t; #define __DEFINED_intmax_t #endif # 163 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) typedef unsigned char uint8_t; #define __DEFINED_uint8_t #endif # 168 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) typedef unsigned short uint16_t; #define __DEFINED_uint16_t #endif # 173 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) typedef unsigned int uint32_t; #define __DEFINED_uint32_t #endif # 178 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) typedef unsigned _Int64 uint64_t; #define __DEFINED_uint64_t #endif # 183 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) typedef unsigned _Int64 u_int64_t; #define __DEFINED_u_int64_t #endif # 188 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) typedef unsigned _Int64 uintmax_t; #define __DEFINED_uintmax_t #endif # 193 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) typedef unsigned mode_t; #define __DEFINED_mode_t #endif # 199 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned _Reg nlink_t; #define __DEFINED_nlink_t #endif # 204 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_off_t) && !defined(__DEFINED_off_t) typedef _Int64 off_t; #define __DEFINED_off_t #endif # 209 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) typedef unsigned _Int64 ino_t; #define __DEFINED_ino_t #endif # 214 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) typedef unsigned _Int64 dev_t; #define __DEFINED_dev_t #endif # 219 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef long blksize_t; #define __DEFINED_blksize_t #endif # 224 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) typedef _Int64 blkcnt_t; #define __DEFINED_blkcnt_t #endif # 229 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) typedef unsigned _Int64 fsblkcnt_t; #define __DEFINED_fsblkcnt_t #endif # 234 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) typedef unsigned _Int64 fsfilcnt_t; #define __DEFINED_fsfilcnt_t #endif # 239 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 245 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) typedef unsigned long wctype_t; #define __DEFINED_wctype_t #endif # 250 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) typedef void * timer_t; #define __DEFINED_timer_t #endif # 256 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) typedef int clockid_t; #define __DEFINED_clockid_t #endif # 261 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) typedef long clock_t; #define __DEFINED_clock_t #endif # 266 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) struct timeval { time_t tv_sec; suseconds_t tv_usec; }; #define __DEFINED_struct_timeval #endif # 271 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) struct timespec { time_t tv_sec; long tv_nsec; }; #define __DEFINED_struct_timespec #endif # 276 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) typedef int pid_t; #define __DEFINED_pid_t #endif # 282 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_id_t) && !defined(__DEFINED_id_t) typedef unsigned id_t; #define __DEFINED_id_t #endif # 287 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) typedef unsigned uid_t; #define __DEFINED_uid_t #endif # 292 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) typedef unsigned gid_t; #define __DEFINED_gid_t #endif # 297 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_key_t) && !defined(__DEFINED_key_t) typedef int key_t; #define __DEFINED_key_t #endif # 302 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) typedef unsigned useconds_t; #define __DEFINED_useconds_t #endif # 307 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifdef __cplusplus #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef unsigned long pthread_t; #define __DEFINED_pthread_t #endif # 314 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #else # 316 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef struct __pthread * pthread_t; #define __DEFINED_pthread_t #endif # 320 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 322 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) typedef int pthread_once_t; #define __DEFINED_pthread_once_t #endif # 326 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) typedef unsigned pthread_key_t; #define __DEFINED_pthread_key_t #endif # 331 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) typedef int pthread_spinlock_t; #define __DEFINED_pthread_spinlock_t #endif # 336 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) typedef struct { unsigned __attr; } pthread_mutexattr_t; #define __DEFINED_pthread_mutexattr_t #endif # 341 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) typedef struct { unsigned __attr; } pthread_condattr_t; #define __DEFINED_pthread_condattr_t #endif # 346 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) typedef struct { unsigned __attr; } pthread_barrierattr_t; #define __DEFINED_pthread_barrierattr_t #endif # 351 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; #define __DEFINED_pthread_rwlockattr_t #endif # 356 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_FILE) && !defined(__DEFINED_FILE) typedef struct _IO_FILE FILE; #define __DEFINED_FILE #endif # 362 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; #define __DEFINED_mbstate_t #endif # 368 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) typedef struct __locale_struct * locale_t; #define __DEFINED_locale_t #endif # 374 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; #define __DEFINED_sigset_t #endif # 380 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) struct iovec { void *iov_base; size_t iov_len; }; #define __DEFINED_struct_iovec #endif # 386 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) typedef unsigned socklen_t; #define __DEFINED_socklen_t #endif # 392 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) typedef unsigned short sa_family_t; #define __DEFINED_sa_family_t #endif # 397 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #undef _Addr #undef _Int64 #undef _Reg # 47 "/usr/local/popcorn/aarch64/include/ctype.h" 2 3 int isalnum_l(int, locale_t); int isalpha_l(int, locale_t); int isblank_l(int, locale_t); int iscntrl_l(int, locale_t); int isdigit_l(int, locale_t); int isgraph_l(int, locale_t); int islower_l(int, locale_t); int isprint_l(int, locale_t); int ispunct_l(int, locale_t); int isspace_l(int, locale_t); int isupper_l(int, locale_t); int isxdigit_l(int, locale_t); int tolower_l(int, locale_t); int toupper_l(int, locale_t); int isascii(int); int toascii(int); #define _tolower(a) ((a)|0x20) #define _toupper(a) ((a)&0x5f) #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128) #endif # 70 "/usr/local/popcorn/aarch64/include/ctype.h" 3 #ifdef __cplusplus } #endif # 74 "/usr/local/popcorn/aarch64/include/ctype.h" 3 #endif # 76 "/usr/local/popcorn/aarch64/include/ctype.h" 3 # 70 "./bzlib_private.h" 2 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 70 "./bzlib_private.h" # 1 "/usr/local/popcorn/aarch64/include/string.h" 1 3 #ifndef _STRING_H #define _STRING_H #ifdef __cplusplus extern "C" { #endif # 7 "/usr/local/popcorn/aarch64/include/string.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 8 "/usr/local/popcorn/aarch64/include/string.h" 3 # 9 "/usr/local/popcorn/aarch64/include/string.h" 3 #ifdef __cplusplus #define NULL 0L #else # 13 "/usr/local/popcorn/aarch64/include/string.h" 3 #define NULL ((void*)0) #endif # 15 "/usr/local/popcorn/aarch64/include/string.h" 3 #define __NEED_size_t #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) #define __NEED_locale_t #endif # 22 "/usr/local/popcorn/aarch64/include/string.h" 3 #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 23 "/usr/local/popcorn/aarch64/include/string.h" 3 # 1 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 1 3 #define _Addr long #define _Int64 long #define _Reg long #if defined(__NEED_va_list) && !defined(__DEFINED_va_list) typedef __builtin_va_list va_list; #define __DEFINED_va_list #endif # 9 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) typedef __builtin_va_list __isoc_va_list; #define __DEFINED___isoc_va_list #endif # 14 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifndef __cplusplus #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) typedef unsigned wchar_t; #define __DEFINED_wchar_t #endif # 21 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 23 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 27 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef int blksize_t; #define __DEFINED_blksize_t #endif # 33 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned int nlink_t; #define __DEFINED_nlink_t #endif # 38 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) typedef float float_t; #define __DEFINED_float_t #endif # 44 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) typedef double double_t; #define __DEFINED_double_t #endif # 49 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) typedef struct { long long __ll; long double __ld; } max_align_t; #define __DEFINED_max_align_t #endif # 55 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_time_t) && !defined(__DEFINED_time_t) typedef long time_t; #define __DEFINED_time_t #endif # 61 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) typedef long suseconds_t; #define __DEFINED_suseconds_t #endif # 66 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; #define __DEFINED_pthread_attr_t #endif # 72 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; #define __DEFINED_pthread_mutex_t #endif # 77 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; #define __DEFINED_mtx_t #endif # 82 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; #define __DEFINED_pthread_cond_t #endif # 87 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; #define __DEFINED_cnd_t #endif # 92 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; #define __DEFINED_pthread_rwlock_t #endif # 97 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; #define __DEFINED_pthread_barrier_t #endif # 102 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_size_t) && !defined(__DEFINED_size_t) typedef unsigned _Addr size_t; #define __DEFINED_size_t #endif # 107 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) typedef unsigned _Addr uintptr_t; #define __DEFINED_uintptr_t #endif # 112 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) typedef _Addr ptrdiff_t; #define __DEFINED_ptrdiff_t #endif # 117 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) typedef _Addr ssize_t; #define __DEFINED_ssize_t #endif # 122 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) typedef _Addr intptr_t; #define __DEFINED_intptr_t #endif # 127 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) typedef _Addr regoff_t; #define __DEFINED_regoff_t #endif # 132 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_register_t) && !defined(__DEFINED_register_t) typedef _Reg register_t; #define __DEFINED_register_t #endif # 137 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) typedef signed char int8_t; #define __DEFINED_int8_t #endif # 143 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) typedef short int16_t; #define __DEFINED_int16_t #endif # 148 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) typedef int int32_t; #define __DEFINED_int32_t #endif # 153 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) typedef _Int64 int64_t; #define __DEFINED_int64_t #endif # 158 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) typedef _Int64 intmax_t; #define __DEFINED_intmax_t #endif # 163 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) typedef unsigned char uint8_t; #define __DEFINED_uint8_t #endif # 168 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) typedef unsigned short uint16_t; #define __DEFINED_uint16_t #endif # 173 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) typedef unsigned int uint32_t; #define __DEFINED_uint32_t #endif # 178 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) typedef unsigned _Int64 uint64_t; #define __DEFINED_uint64_t #endif # 183 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) typedef unsigned _Int64 u_int64_t; #define __DEFINED_u_int64_t #endif # 188 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) typedef unsigned _Int64 uintmax_t; #define __DEFINED_uintmax_t #endif # 193 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) typedef unsigned mode_t; #define __DEFINED_mode_t #endif # 199 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned _Reg nlink_t; #define __DEFINED_nlink_t #endif # 204 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_off_t) && !defined(__DEFINED_off_t) typedef _Int64 off_t; #define __DEFINED_off_t #endif # 209 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) typedef unsigned _Int64 ino_t; #define __DEFINED_ino_t #endif # 214 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) typedef unsigned _Int64 dev_t; #define __DEFINED_dev_t #endif # 219 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef long blksize_t; #define __DEFINED_blksize_t #endif # 224 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) typedef _Int64 blkcnt_t; #define __DEFINED_blkcnt_t #endif # 229 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) typedef unsigned _Int64 fsblkcnt_t; #define __DEFINED_fsblkcnt_t #endif # 234 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) typedef unsigned _Int64 fsfilcnt_t; #define __DEFINED_fsfilcnt_t #endif # 239 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 245 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) typedef unsigned long wctype_t; #define __DEFINED_wctype_t #endif # 250 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) typedef void * timer_t; #define __DEFINED_timer_t #endif # 256 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) typedef int clockid_t; #define __DEFINED_clockid_t #endif # 261 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) typedef long clock_t; #define __DEFINED_clock_t #endif # 266 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) struct timeval { time_t tv_sec; suseconds_t tv_usec; }; #define __DEFINED_struct_timeval #endif # 271 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) struct timespec { time_t tv_sec; long tv_nsec; }; #define __DEFINED_struct_timespec #endif # 276 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) typedef int pid_t; #define __DEFINED_pid_t #endif # 282 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_id_t) && !defined(__DEFINED_id_t) typedef unsigned id_t; #define __DEFINED_id_t #endif # 287 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) typedef unsigned uid_t; #define __DEFINED_uid_t #endif # 292 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) typedef unsigned gid_t; #define __DEFINED_gid_t #endif # 297 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_key_t) && !defined(__DEFINED_key_t) typedef int key_t; #define __DEFINED_key_t #endif # 302 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) typedef unsigned useconds_t; #define __DEFINED_useconds_t #endif # 307 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifdef __cplusplus #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef unsigned long pthread_t; #define __DEFINED_pthread_t #endif # 314 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #else # 316 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef struct __pthread * pthread_t; #define __DEFINED_pthread_t #endif # 320 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 322 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) typedef int pthread_once_t; #define __DEFINED_pthread_once_t #endif # 326 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) typedef unsigned pthread_key_t; #define __DEFINED_pthread_key_t #endif # 331 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) typedef int pthread_spinlock_t; #define __DEFINED_pthread_spinlock_t #endif # 336 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) typedef struct { unsigned __attr; } pthread_mutexattr_t; #define __DEFINED_pthread_mutexattr_t #endif # 341 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) typedef struct { unsigned __attr; } pthread_condattr_t; #define __DEFINED_pthread_condattr_t #endif # 346 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) typedef struct { unsigned __attr; } pthread_barrierattr_t; #define __DEFINED_pthread_barrierattr_t #endif # 351 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; #define __DEFINED_pthread_rwlockattr_t #endif # 356 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_FILE) && !defined(__DEFINED_FILE) typedef struct _IO_FILE FILE; #define __DEFINED_FILE #endif # 362 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; #define __DEFINED_mbstate_t #endif # 368 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) typedef struct __locale_struct * locale_t; #define __DEFINED_locale_t #endif # 374 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; #define __DEFINED_sigset_t #endif # 380 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) struct iovec { void *iov_base; size_t iov_len; }; #define __DEFINED_struct_iovec #endif # 386 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) typedef unsigned socklen_t; #define __DEFINED_socklen_t #endif # 392 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) typedef unsigned short sa_family_t; #define __DEFINED_sa_family_t #endif # 397 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #undef _Addr #undef _Int64 #undef _Reg # 24 "/usr/local/popcorn/aarch64/include/string.h" 2 3 void *memcpy (void *__restrict, const void *__restrict, size_t); void *memmove (void *, const void *, size_t); void *memset (void *, int, size_t); int memcmp (const void *, const void *, size_t); void *memchr (const void *, int, size_t); char *strcpy (char *__restrict, const char *__restrict); char *strncpy (char *__restrict, const char *__restrict, size_t); char *strcat (char *__restrict, const char *__restrict); char *strncat (char *__restrict, const char *__restrict, size_t); int strcmp (const char *, const char *); int strncmp (const char *, const char *, size_t); int strcoll (const char *, const char *); size_t strxfrm (char *__restrict, const char *__restrict, size_t); char *strchr (const char *, int); char *strrchr (const char *, int); size_t strcspn (const char *, const char *); size_t strspn (const char *, const char *); char *strpbrk (const char *, const char *); char *strstr (const char *, const char *); char *strtok (char *__restrict, const char *__restrict); size_t strlen (const char *); char *strerror (int); #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 57 "/usr/local/popcorn/aarch64/include/string.h" 3 # 1 "/usr/local/popcorn/aarch64/include/strings.h" 1 3 #ifndef _STRINGS_H #define _STRINGS_H #ifdef __cplusplus extern "C" { #endif # 7 "/usr/local/popcorn/aarch64/include/strings.h" 3 #define __NEED_size_t #define __NEED_locale_t #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 11 "/usr/local/popcorn/aarch64/include/strings.h" 3 # 1 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 1 3 #define _Addr long #define _Int64 long #define _Reg long #if defined(__NEED_va_list) && !defined(__DEFINED_va_list) typedef __builtin_va_list va_list; #define __DEFINED_va_list #endif # 9 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list) typedef __builtin_va_list __isoc_va_list; #define __DEFINED___isoc_va_list #endif # 14 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifndef __cplusplus #if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t) typedef unsigned wchar_t; #define __DEFINED_wchar_t #endif # 21 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 23 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 27 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef int blksize_t; #define __DEFINED_blksize_t #endif # 33 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned int nlink_t; #define __DEFINED_nlink_t #endif # 38 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_float_t) && !defined(__DEFINED_float_t) typedef float float_t; #define __DEFINED_float_t #endif # 44 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_double_t) && !defined(__DEFINED_double_t) typedef double double_t; #define __DEFINED_double_t #endif # 49 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t) typedef struct { long long __ll; long double __ld; } max_align_t; #define __DEFINED_max_align_t #endif # 55 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_time_t) && !defined(__DEFINED_time_t) typedef long time_t; #define __DEFINED_time_t #endif # 61 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t) typedef long suseconds_t; #define __DEFINED_suseconds_t #endif # 66 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t) typedef struct { union { int __i[14]; volatile int __vi[14]; unsigned long __s[7]; } __u; } pthread_attr_t; #define __DEFINED_pthread_attr_t #endif # 72 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } pthread_mutex_t; #define __DEFINED_pthread_mutex_t #endif # 77 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t) typedef struct { union { int __i[10]; volatile int __vi[10]; volatile void *volatile __p[5]; } __u; } mtx_t; #define __DEFINED_mtx_t #endif # 82 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } pthread_cond_t; #define __DEFINED_pthread_cond_t #endif # 87 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t) typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; } __u; } cnd_t; #define __DEFINED_cnd_t #endif # 92 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t) typedef struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; } __u; } pthread_rwlock_t; #define __DEFINED_pthread_rwlock_t #endif # 97 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t) typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } __u; } pthread_barrier_t; #define __DEFINED_pthread_barrier_t #endif # 102 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_size_t) && !defined(__DEFINED_size_t) typedef unsigned _Addr size_t; #define __DEFINED_size_t #endif # 107 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t) typedef unsigned _Addr uintptr_t; #define __DEFINED_uintptr_t #endif # 112 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t) typedef _Addr ptrdiff_t; #define __DEFINED_ptrdiff_t #endif # 117 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t) typedef _Addr ssize_t; #define __DEFINED_ssize_t #endif # 122 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t) typedef _Addr intptr_t; #define __DEFINED_intptr_t #endif # 127 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t) typedef _Addr regoff_t; #define __DEFINED_regoff_t #endif # 132 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_register_t) && !defined(__DEFINED_register_t) typedef _Reg register_t; #define __DEFINED_register_t #endif # 137 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t) typedef signed char int8_t; #define __DEFINED_int8_t #endif # 143 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t) typedef short int16_t; #define __DEFINED_int16_t #endif # 148 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t) typedef int int32_t; #define __DEFINED_int32_t #endif # 153 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t) typedef _Int64 int64_t; #define __DEFINED_int64_t #endif # 158 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t) typedef _Int64 intmax_t; #define __DEFINED_intmax_t #endif # 163 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t) typedef unsigned char uint8_t; #define __DEFINED_uint8_t #endif # 168 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t) typedef unsigned short uint16_t; #define __DEFINED_uint16_t #endif # 173 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t) typedef unsigned int uint32_t; #define __DEFINED_uint32_t #endif # 178 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t) typedef unsigned _Int64 uint64_t; #define __DEFINED_uint64_t #endif # 183 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t) typedef unsigned _Int64 u_int64_t; #define __DEFINED_u_int64_t #endif # 188 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t) typedef unsigned _Int64 uintmax_t; #define __DEFINED_uintmax_t #endif # 193 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t) typedef unsigned mode_t; #define __DEFINED_mode_t #endif # 199 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t) typedef unsigned _Reg nlink_t; #define __DEFINED_nlink_t #endif # 204 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_off_t) && !defined(__DEFINED_off_t) typedef _Int64 off_t; #define __DEFINED_off_t #endif # 209 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t) typedef unsigned _Int64 ino_t; #define __DEFINED_ino_t #endif # 214 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t) typedef unsigned _Int64 dev_t; #define __DEFINED_dev_t #endif # 219 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t) typedef long blksize_t; #define __DEFINED_blksize_t #endif # 224 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t) typedef _Int64 blkcnt_t; #define __DEFINED_blkcnt_t #endif # 229 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t) typedef unsigned _Int64 fsblkcnt_t; #define __DEFINED_fsblkcnt_t #endif # 234 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t) typedef unsigned _Int64 fsfilcnt_t; #define __DEFINED_fsfilcnt_t #endif # 239 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t) typedef unsigned wint_t; #define __DEFINED_wint_t #endif # 245 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t) typedef unsigned long wctype_t; #define __DEFINED_wctype_t #endif # 250 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t) typedef void * timer_t; #define __DEFINED_timer_t #endif # 256 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t) typedef int clockid_t; #define __DEFINED_clockid_t #endif # 261 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t) typedef long clock_t; #define __DEFINED_clock_t #endif # 266 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval) struct timeval { time_t tv_sec; suseconds_t tv_usec; }; #define __DEFINED_struct_timeval #endif # 271 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec) struct timespec { time_t tv_sec; long tv_nsec; }; #define __DEFINED_struct_timespec #endif # 276 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t) typedef int pid_t; #define __DEFINED_pid_t #endif # 282 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_id_t) && !defined(__DEFINED_id_t) typedef unsigned id_t; #define __DEFINED_id_t #endif # 287 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t) typedef unsigned uid_t; #define __DEFINED_uid_t #endif # 292 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t) typedef unsigned gid_t; #define __DEFINED_gid_t #endif # 297 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_key_t) && !defined(__DEFINED_key_t) typedef int key_t; #define __DEFINED_key_t #endif # 302 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t) typedef unsigned useconds_t; #define __DEFINED_useconds_t #endif # 307 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #ifdef __cplusplus #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef unsigned long pthread_t; #define __DEFINED_pthread_t #endif # 314 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #else # 316 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t) typedef struct __pthread * pthread_t; #define __DEFINED_pthread_t #endif # 320 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #endif # 322 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t) typedef int pthread_once_t; #define __DEFINED_pthread_once_t #endif # 326 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t) typedef unsigned pthread_key_t; #define __DEFINED_pthread_key_t #endif # 331 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t) typedef int pthread_spinlock_t; #define __DEFINED_pthread_spinlock_t #endif # 336 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t) typedef struct { unsigned __attr; } pthread_mutexattr_t; #define __DEFINED_pthread_mutexattr_t #endif # 341 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t) typedef struct { unsigned __attr; } pthread_condattr_t; #define __DEFINED_pthread_condattr_t #endif # 346 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t) typedef struct { unsigned __attr; } pthread_barrierattr_t; #define __DEFINED_pthread_barrierattr_t #endif # 351 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t) typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t; #define __DEFINED_pthread_rwlockattr_t #endif # 356 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_FILE) && !defined(__DEFINED_FILE) typedef struct _IO_FILE FILE; #define __DEFINED_FILE #endif # 362 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t) typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t; #define __DEFINED_mbstate_t #endif # 368 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t) typedef struct __locale_struct * locale_t; #define __DEFINED_locale_t #endif # 374 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t) typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t; #define __DEFINED_sigset_t #endif # 380 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec) struct iovec { void *iov_base; size_t iov_len; }; #define __DEFINED_struct_iovec #endif # 386 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t) typedef unsigned socklen_t; #define __DEFINED_socklen_t #endif # 392 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t) typedef unsigned short sa_family_t; #define __DEFINED_sa_family_t #endif # 397 "/usr/local/popcorn/aarch64/include/bits/alltypes.h" 3 #undef _Addr #undef _Int64 #undef _Reg # 12 "/usr/local/popcorn/aarch64/include/strings.h" 2 3 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_SOURCE) \ || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \ || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700) int bcmp (const void *, const void *, size_t); void bcopy (const void *, void *, size_t); void bzero (void *, size_t); char *index (const char *, int); char *rindex (const char *, int); #endif # 22 "/usr/local/popcorn/aarch64/include/strings.h" 3 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) int ffs (int); int ffsl (long); int ffsll (long long); #endif # 28 "/usr/local/popcorn/aarch64/include/strings.h" 3 int strcasecmp (const char *, const char *); int strncasecmp (const char *, const char *, size_t); int strcasecmp_l (const char *, const char *, locale_t); int strncasecmp_l (const char *, const char *, size_t, locale_t); #ifdef __cplusplus } #endif # 38 "/usr/local/popcorn/aarch64/include/strings.h" 3 #endif # 40 "/usr/local/popcorn/aarch64/include/strings.h" 3 # 58 "/usr/local/popcorn/aarch64/include/string.h" 2 3 #endif # 59 "/usr/local/popcorn/aarch64/include/string.h" 3 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) char *strtok_r (char *__restrict, const char *__restrict, char **__restrict); int strerror_r (int, char *, size_t); char *stpcpy(char *__restrict, const char *__restrict); char *stpncpy(char *__restrict, const char *__restrict, size_t); size_t strnlen (const char *, size_t); char *strdup (const char *); char *strndup (const char *, size_t); char *strsignal(int); char *strerror_l (int, locale_t); int strcoll_l (const char *, const char *, locale_t); size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t); #endif # 75 "/usr/local/popcorn/aarch64/include/string.h" 3 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) void *memccpy (void *__restrict, const void *__restrict, int, size_t); #endif # 80 "/usr/local/popcorn/aarch64/include/string.h" 3 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) char *strsep(char **, const char *); size_t strlcat (char *, const char *, size_t); size_t strlcpy (char *, const char *, size_t); #endif # 86 "/usr/local/popcorn/aarch64/include/string.h" 3 #ifdef _GNU_SOURCE #define strdupa(x) strcpy(alloca(strlen(x)+1),x) int strverscmp (const char *, const char *); char *strchrnul(const char *, int); char *strcasestr(const char *, const char *); void *memmem(const void *, size_t, const void *, size_t); void *memrchr(const void *, int, size_t); void *mempcpy(void *, const void *, size_t); #ifndef __cplusplus char *basename(); #endif # 98 "/usr/local/popcorn/aarch64/include/string.h" 3 #endif # 99 "/usr/local/popcorn/aarch64/include/string.h" 3 #ifdef __cplusplus } #endif # 103 "/usr/local/popcorn/aarch64/include/string.h" 3 #endif # 105 "/usr/local/popcorn/aarch64/include/string.h" 3 # 71 "./bzlib_private.h" 2 #endif # 72 "./bzlib_private.h" #if 0 /* expanded by -frewrite-includes */ #include "bzlib.h" #endif /* expanded by -frewrite-includes */ # 73 "./bzlib_private.h" # 1 "./bzlib.h" 1 /*-------------------------------------------------------------*/ /*--- Public header file for the library. ---*/ /*--- bzlib.h ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ #ifndef _BZLIB_H #define _BZLIB_H #ifdef __cplusplus extern "C" { #endif # 68 "./bzlib.h" #ifdef SPEC_CPU #ifndef SPEC_STDIN # define SPEC_STDIN 0 #endif # 73 "./bzlib.h" #ifndef SPEC_STDOUT # define SPEC_STDOUT 1 #endif # 76 "./bzlib.h" #ifndef SPEC_STDERR # define SPEC_STDERR 1 #endif # 79 "./bzlib.h" #ifndef SPEC_NULLCAST # define SPEC_NULLCAST (int) #endif # 82 "./bzlib.h" /* Munge things for SPEC CPU2006 */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 83 "./bzlib.h" # 84 "./bzlib.h" #define SET_BINARY_MODE(fd) /**/ #define NORETURN /**/ /* Fix-up rewind() */ #ifdef rewind #undef rewind #endif # 92 "./bzlib.h" #define rewind(a) spec_rewind(a) /* Fix-up read() */ #ifdef read #undef read #endif # 98 "./bzlib.h" #define read(a,b,c) spec_read(a,b,c) /* Fix-up write() */ #ifdef write #undef write #endif # 104 "./bzlib.h" #define write(a,b,c) spec_write(a,b,c) /* Fix-up fread() */ #ifdef fread #undef fread #endif # 110 "./bzlib.h" #define fread(a,b,c,d) spec_fread(a,b,c,d) /* Fix-up fwrite() */ #ifdef fwrite #undef fwrite #endif # 116 "./bzlib.h" #define fwrite(a,b,c,d) spec_fwrite(a,b,c,d) /* Fix-up ferror() */ #ifdef ferror #undef ferror #endif # 122 "./bzlib.h" #define ferror(x) 0 /* Fix-up fopen() */ #ifdef fopen #undef fopen #endif # 128 "./bzlib.h" #define fopen(x,y) 0 /* Fix-up fflush() */ #ifdef fflush #undef fflush #endif # 134 "./bzlib.h" #define fflush(x) 0 /* Fix-up fclose() */ #ifdef fclose #undef fclose #endif # 140 "./bzlib.h" #define fclose(x) 0 /* Fix-up getc() */ #ifdef getc #undef getc #endif # 146 "./bzlib.h" #define getc(f) spec_getc((int)f) /* Fix-up fgetc() */ #ifdef fgetc #undef fgetc #endif # 152 "./bzlib.h" #define fgetc(f) spec_getc((int)f) /* Fix-up fputc() */ #ifdef fputc #undef fputc #endif # 158 "./bzlib.h" #define fputc(c, f) spec_putc(c, (int)f) /* Fix-up putc() */ #ifdef putc #undef putc #endif # 164 "./bzlib.h" #define putc(c, f) spec_putc(c, (int)f) /* Fix-up ungetc() */ #ifdef ungetc #undef ungetc #endif # 170 "./bzlib.h" #define ungetc(c,f) spec_ungetc(c,(int)f) #else # 173 "./bzlib.h" #ifndef SPEC_STDIN # define SPEC_STDIN stdin #endif # 176 "./bzlib.h" #ifndef SPEC_STDOUT # define SPEC_STDOUT stdout #endif # 179 "./bzlib.h" #ifndef SPEC_NULLCAST # define SPEC_NULLCAST #endif # 182 "./bzlib.h" #endif /* SPEC_CPU */ # 183 "./bzlib.h" #define BZ_RUN 0 #define BZ_FLUSH 1 #define BZ_FINISH 2 #define BZ_OK 0 #define BZ_RUN_OK 1 #define BZ_FLUSH_OK 2 #define BZ_FINISH_OK 3 #define BZ_STREAM_END 4 #define BZ_SEQUENCE_ERROR (-1) #define BZ_PARAM_ERROR (-2) #define BZ_MEM_ERROR (-3) #define BZ_DATA_ERROR (-4) #define BZ_DATA_ERROR_MAGIC (-5) #define BZ_IO_ERROR (-6) #define BZ_UNEXPECTED_EOF (-7) #define BZ_OUTBUFF_FULL (-8) #define BZ_CONFIG_ERROR (-9) typedef struct { char *next_in; unsigned int avail_in; unsigned int total_in_lo32; unsigned int total_in_hi32; char *next_out; unsigned int avail_out; unsigned int total_out_lo32; unsigned int total_out_hi32; void *state; void *(*bzalloc)(void *,int,int); void (*bzfree)(void *,void *); void *opaque; } bz_stream; #ifndef BZ_IMPORT #define BZ_EXPORT #endif # 227 "./bzlib.h" #ifndef BZ_NO_STDIO /* Need a definitition for FILE */ #if 0 /* expanded by -frewrite-includes */ #include #endif /* expanded by -frewrite-includes */ # 230 "./bzlib.h" # 231 "./bzlib.h" #endif # 232 "./bzlib.h" #ifdef _WIN32 #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 234 "./bzlib.h" # 235 "./bzlib.h" # ifdef small /* windows.h define small to char */ # undef small # endif # 239 "./bzlib.h" # ifdef BZ_EXPORT # define BZ_API(func) WINAPI func # define BZ_EXTERN extern # else # 243 "./bzlib.h" /* import windows dll dynamically */ # define BZ_API(func) (WINAPI * func) # define BZ_EXTERN # endif # 247 "./bzlib.h" #else # 248 "./bzlib.h" # define BZ_API(func) func # define BZ_EXTERN extern #endif # 251 "./bzlib.h" /*-- Core (low-level) library functions --*/ BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( bz_stream* strm, int blockSize100k, int verbosity, int workFactor ); BZ_EXTERN int BZ_API(BZ2_bzCompress) ( bz_stream* strm, int action ); BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( bz_stream* strm ); BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( bz_stream *strm, int verbosity, int small ); BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( bz_stream* strm ); BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ); /*-- High(er) level library functions --*/ #ifndef BZ_NO_STDIO #define BZ_MAX_UNUSED 5000 typedef void BZFILE; BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( int* bzerror, #if defined(SPEC_CPU) int f, #else # 299 "./bzlib.h" FILE* f, #endif # 301 "./bzlib.h" int verbosity, int small, void* unused, int nUnused ); BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( int* bzerror, BZFILE* b ); BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( int* bzerror, BZFILE* b, void** unused, int* nUnused ); BZ_EXTERN int BZ_API(BZ2_bzRead) ( int* bzerror, BZFILE* b, void* buf, int len ); BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( int* bzerror, #if defined(SPEC_CPU) int f, #else # 331 "./bzlib.h" FILE* f, #endif # 333 "./bzlib.h" int blockSize100k, int verbosity, int workFactor ); BZ_EXTERN void BZ_API(BZ2_bzWrite) ( int* bzerror, BZFILE* b, void* buf, int len ); BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in, unsigned int* nbytes_out ); BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in_lo32, unsigned int* nbytes_in_hi32, unsigned int* nbytes_out_lo32, unsigned int* nbytes_out_hi32 ); #endif # 363 "./bzlib.h" /*-- Utility functions --*/ BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int blockSize100k, int verbosity, int workFactor ); BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int small, int verbosity ); /*-- Code contributed by Yoshioka Tsuneo (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp), to support better zlib compatibility. This code is not _officially_ part of libbzip2 (yet); I haven't tested it, documented it, or considered the threading-safeness of it. If this code breaks, please contact both Yoshioka and me. --*/ BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( void ); #ifndef BZ_NO_STDIO BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( const char *path, const char *mode ); BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( int fd, const char *mode ); BZ_EXTERN int BZ_API(BZ2_bzread) ( BZFILE* b, void* buf, int len ); BZ_EXTERN int BZ_API(BZ2_bzwrite) ( BZFILE* b, void* buf, int len ); BZ_EXTERN int BZ_API(BZ2_bzflush) ( BZFILE* b ); BZ_EXTERN void BZ_API(BZ2_bzclose) ( BZFILE* b ); BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( BZFILE *b, int *errnum ); #endif # 437 "./bzlib.h" #ifdef __cplusplus } #endif # 441 "./bzlib.h" #endif # 443 "./bzlib.h" /*-------------------------------------------------------------*/ /*--- end bzlib.h ---*/ /*-------------------------------------------------------------*/ # 74 "./bzlib_private.h" 2 /*-- General stuff. --*/ #define BZ_VERSION "1.0.3, 15-Feb-2005" typedef char Char; typedef unsigned char Bool; typedef unsigned char UChar; typedef int Int32; typedef unsigned int UInt32; typedef short Int16; typedef unsigned short UInt16; #define True ((Bool)1) #define False ((Bool)0) #if defined(SPEC_CPU) || !defined(__GNUC__) #define __inline__ /* */ #endif # 95 "./bzlib_private.h" #ifndef BZ_NO_STDIO extern void BZ2_bz__AssertH__fail ( int errcode ); #define AssertH(cond,errcode) \ { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); } #if BZ_DEBUG #define AssertD(cond,msg) \ { if (!(cond)) { \ fprintf ( stderr, \ "\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\ exit(1); \ }} #else # 108 "./bzlib_private.h" #define AssertD(cond,msg) /* */ #endif # 110 "./bzlib_private.h" #define VPrintf0(zf) \ fprintf(stderr,zf) #define VPrintf1(zf,za1) \ fprintf(stderr,zf,za1) #define VPrintf2(zf,za1,za2) \ fprintf(stderr,zf,za1,za2) #define VPrintf3(zf,za1,za2,za3) \ fprintf(stderr,zf,za1,za2,za3) #define VPrintf4(zf,za1,za2,za3,za4) \ fprintf(stderr,zf,za1,za2,za3,za4) #define VPrintf5(zf,za1,za2,za3,za4,za5) \ fprintf(stderr,zf,za1,za2,za3,za4,za5) #else # 123 "./bzlib_private.h" extern void bz_internal_error ( int errcode ); #define AssertH(cond,errcode) \ { if (!(cond)) bz_internal_error ( errcode ); } #define AssertD(cond,msg) /* */ #define VPrintf0(zf) /* */ #define VPrintf1(zf,za1) /* */ #define VPrintf2(zf,za1,za2) /* */ #define VPrintf3(zf,za1,za2,za3) /* */ #define VPrintf4(zf,za1,za2,za3,za4) /* */ #define VPrintf5(zf,za1,za2,za3,za4,za5) /* */ #endif # 134 "./bzlib_private.h" #define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1) #define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp)) /*-- Header bytes. --*/ #define BZ_HDR_B 0x42 /* 'B' */ #define BZ_HDR_Z 0x5a /* 'Z' */ #define BZ_HDR_h 0x68 /* 'h' */ #define BZ_HDR_0 0x30 /* '0' */ /*-- Constants for the back end. --*/ #define BZ_MAX_ALPHA_SIZE 258 #define BZ_MAX_CODE_LEN 23 #define BZ_RUNA 0 #define BZ_RUNB 1 #define BZ_N_GROUPS 6 #define BZ_G_SIZE 50 #define BZ_N_ITERS 4 #define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE)) /*-- Stuff for randomising repetitive blocks. --*/ extern Int32 BZ2_rNums[512]; #define BZ_RAND_DECLS \ Int32 rNToGo; \ Int32 rTPos \ #define BZ_RAND_INIT_MASK \ s->rNToGo = 0; \ s->rTPos = 0 \ #define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0) #define BZ_RAND_UPD_MASK \ if (s->rNToGo == 0) { \ s->rNToGo = BZ2_rNums[s->rTPos]; \ s->rTPos++; \ if (s->rTPos == 512) s->rTPos = 0; \ } \ s->rNToGo--; /*-- Stuff for doing CRCs. --*/ extern UInt32 BZ2_crc32Table[256]; #define BZ_INITIALISE_CRC(crcVar) \ { \ crcVar = 0xffffffffL; \ } #define BZ_FINALISE_CRC(crcVar) \ { \ crcVar = ~(crcVar); \ } #define BZ_UPDATE_CRC(crcVar,cha) \ { \ crcVar = (crcVar << 8) ^ \ BZ2_crc32Table[(crcVar >> 24) ^ \ ((UChar)cha)]; \ } /*-- States and modes for compression. --*/ #define BZ_M_IDLE 1 #define BZ_M_RUNNING 2 #define BZ_M_FLUSHING 3 #define BZ_M_FINISHING 4 #define BZ_S_OUTPUT 1 #define BZ_S_INPUT 2 #define BZ_N_RADIX 2 #define BZ_N_QSORT 12 #define BZ_N_SHELL 18 #define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2) /*-- Structure holding all the compression-side stuff. --*/ typedef struct { /* pointer back to the struct bz_stream */ bz_stream* strm; /* mode this stream is in, and whether inputting */ /* or outputting data */ Int32 mode; Int32 state; /* remembers avail_in when flush/finish requested */ UInt32 avail_in_expect; /* for doing the block sorting */ UInt32* arr1; UInt32* arr2; UInt32* ftab; Int32 origPtr; /* aliases for arr1 and arr2 */ UInt32* ptr; UChar* block; UInt16* mtfv; UChar* zbits; /* for deciding when to use the fallback sorting algorithm */ Int32 workFactor; /* run-length-encoding of the input */ UInt32 state_in_ch; Int32 state_in_len; BZ_RAND_DECLS; /* input and output limits and current posns */ Int32 nblock; Int32 nblockMAX; Int32 numZ; Int32 state_out_pos; /* map of bytes used in block */ Int32 nInUse; Bool inUse[256]; UChar unseqToSeq[256]; /* the buffer for bit stream creation */ UInt32 bsBuff; Int32 bsLive; /* block and combined CRCs */ UInt32 blockCRC; UInt32 combinedCRC; /* misc administratium */ Int32 verbosity; Int32 blockNo; Int32 blockSize100k; /* stuff for coding the MTF values */ Int32 nMTF; Int32 mtfFreq [BZ_MAX_ALPHA_SIZE]; UChar selector [BZ_MAX_SELECTORS]; UChar selectorMtf[BZ_MAX_SELECTORS]; UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; /* second dimension: only 3 needed; 4 makes index calculations faster */ UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4]; } EState; /*-- externs for compression. --*/ extern void BZ2_blockSort ( EState* ); extern void BZ2_compressBlock ( EState*, Bool ); extern void BZ2_bsInitWrite ( EState* ); extern void BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 ); extern void BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 ); /*-- states for decompression. --*/ #define BZ_X_IDLE 1 #define BZ_X_OUTPUT 2 #define BZ_X_MAGIC_1 10 #define BZ_X_MAGIC_2 11 #define BZ_X_MAGIC_3 12 #define BZ_X_MAGIC_4 13 #define BZ_X_BLKHDR_1 14 #define BZ_X_BLKHDR_2 15 #define BZ_X_BLKHDR_3 16 #define BZ_X_BLKHDR_4 17 #define BZ_X_BLKHDR_5 18 #define BZ_X_BLKHDR_6 19 #define BZ_X_BCRC_1 20 #define BZ_X_BCRC_2 21 #define BZ_X_BCRC_3 22 #define BZ_X_BCRC_4 23 #define BZ_X_RANDBIT 24 #define BZ_X_ORIGPTR_1 25 #define BZ_X_ORIGPTR_2 26 #define BZ_X_ORIGPTR_3 27 #define BZ_X_MAPPING_1 28 #define BZ_X_MAPPING_2 29 #define BZ_X_SELECTOR_1 30 #define BZ_X_SELECTOR_2 31 #define BZ_X_SELECTOR_3 32 #define BZ_X_CODING_1 33 #define BZ_X_CODING_2 34 #define BZ_X_CODING_3 35 #define BZ_X_MTF_1 36 #define BZ_X_MTF_2 37 #define BZ_X_MTF_3 38 #define BZ_X_MTF_4 39 #define BZ_X_MTF_5 40 #define BZ_X_MTF_6 41 #define BZ_X_ENDHDR_2 42 #define BZ_X_ENDHDR_3 43 #define BZ_X_ENDHDR_4 44 #define BZ_X_ENDHDR_5 45 #define BZ_X_ENDHDR_6 46 #define BZ_X_CCRC_1 47 #define BZ_X_CCRC_2 48 #define BZ_X_CCRC_3 49 #define BZ_X_CCRC_4 50 /*-- Constants for the fast MTF decoder. --*/ #define MTFA_SIZE 4096 #define MTFL_SIZE 16 /*-- Structure holding all the decompression-side stuff. --*/ typedef struct { /* pointer back to the struct bz_stream */ bz_stream* strm; /* state indicator for this stream */ Int32 state; /* for doing the final run-length decoding */ UChar state_out_ch; Int32 state_out_len; Bool blockRandomised; BZ_RAND_DECLS; /* the buffer for bit stream reading */ UInt32 bsBuff; Int32 bsLive; /* misc administratium */ Int32 blockSize100k; Bool smallDecompress; Int32 currBlockNo; Int32 verbosity; /* for undoing the Burrows-Wheeler transform */ Int32 origPtr; UInt32 tPos; Int32 k0; Int32 unzftab[256]; Int32 nblock_used; Int32 cftab[257]; Int32 cftabCopy[257]; /* for undoing the Burrows-Wheeler transform (FAST) */ UInt32 *tt; /* for undoing the Burrows-Wheeler transform (SMALL) */ UInt16 *ll16; UChar *ll4; /* stored and calculated CRCs */ UInt32 storedBlockCRC; UInt32 storedCombinedCRC; UInt32 calculatedBlockCRC; UInt32 calculatedCombinedCRC; /* map of bytes used in block */ Int32 nInUse; Bool inUse[256]; Bool inUse16[16]; UChar seqToUnseq[256]; /* for decoding the MTF values */ UChar mtfa [MTFA_SIZE]; Int32 mtfbase[256 / MTFL_SIZE]; UChar selector [BZ_MAX_SELECTORS]; UChar selectorMtf[BZ_MAX_SELECTORS]; UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 minLens[BZ_N_GROUPS]; /* save area for scalars in the main decompress code */ Int32 save_i; Int32 save_j; Int32 save_t; Int32 save_alphaSize; Int32 save_nGroups; Int32 save_nSelectors; Int32 save_EOB; Int32 save_groupNo; Int32 save_groupPos; Int32 save_nextSym; Int32 save_nblockMAX; Int32 save_nblock; Int32 save_es; Int32 save_N; Int32 save_curr; Int32 save_zt; Int32 save_zn; Int32 save_zvec; Int32 save_zj; Int32 save_gSel; Int32 save_gMinlen; Int32* save_gLimit; Int32* save_gBase; Int32* save_gPerm; } DState; /*-- Macros for decompression. --*/ #define BZ_GET_FAST(cccc) \ s->tPos = s->tt[s->tPos]; \ cccc = (UChar)(s->tPos & 0xff); \ s->tPos >>= 8; #define BZ_GET_FAST_C(cccc) \ c_tPos = c_tt[c_tPos]; \ cccc = (UChar)(c_tPos & 0xff); \ c_tPos >>= 8; #define SET_LL4(i,n) \ { if (((i) & 0x1) == 0) \ s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \ s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \ } #define GET_LL4(i) \ ((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF) #define SET_LL(i,n) \ { s->ll16[i] = (UInt16)(n & 0x0000ffff); \ SET_LL4(i, n >> 16); \ } #define GET_LL(i) \ (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16)) #define BZ_GET_SMALL(cccc) \ cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \ s->tPos = GET_LL(s->tPos); /*-- externs for decompression. --*/ extern Int32 BZ2_indexIntoF ( Int32, Int32* ); extern Int32 BZ2_decompress ( DState* ); extern void BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, Int32, Int32, Int32 ); #endif # 524 "./bzlib_private.h" /*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/ #ifdef BZ_NO_STDIO #ifndef NULL #define NULL 0 #endif # 532 "./bzlib_private.h" #endif # 533 "./bzlib_private.h" /*-------------------------------------------------------------*/ /*--- end bzlib_private.h ---*/ /*-------------------------------------------------------------*/ # 78 "bzlib.c" 2 /*---------------------------------------------------*/ /*--- Compression stuff ---*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ #ifndef BZ_NO_STDIO void BZ2_bz__AssertH__fail ( int errcode ) { fprintf(stderr, "\n\nbzip2/libbzip2: internal error number %d.\n" #if !defined(SPEC_CPU) "This is a bug in bzip2/libbzip2, %s.\n" "Please report it to me at: jseward@bzip.org. If this happened\n" "when you were using some program which uses libbzip2 as a\n" "component, you should also report this bug to the author(s)\n" "of that program. Please make an effort to report this bug;\n" "timely and accurate bug reports eventually lead to higher\n" "quality software. Thanks. Julian Seward, 15 February 2005.\n\n", #else # 100 "bzlib.c" "This may be a bug in bzip2/libbzip2, %s.\n" "It may also be a bug in your compiler. Please do not bother the\n" "original author of bzip2 with a bug report for this. He\n" "doesn't know anything about bzip2 as it appears in CPU2006.\n\n", #endif /* SPEC_CPU */ # 105 "bzlib.c" errcode, BZ2_bzlibVersion() ); if (errcode == 1007) { fprintf(stderr, "\n*** A special note about internal error number 1007 ***\n" "\n" "Experience suggests that a common cause of i.e. 1007\n" "is unreliable memory or other hardware. The 1007 assertion\n" "just happens to cross-check the results of huge numbers of\n" "memory reads/writes, and so acts (unintendedly) as a stress\n" "test of your memory system.\n" "\n" "I suggest the following: try compressing the file again,\n" "possibly monitoring progress in detail with the -vv flag.\n" "\n" "* If the error cannot be reproduced, and/or happens at different\n" " points in compression, you may have a flaky memory system.\n" " Try a memory-test program. I have used Memtest86\n" " (www.memtest86.com). At the time of writing it is free (GPLd).\n" " Memtest86 tests memory much more thorougly than your BIOSs\n" " power-on test, and may find failures that the BIOS doesn't.\n" "\n" "* If the error can be repeatably reproduced, this is a bug in\n" " bzip2, and I would very much like to hear about it. Please\n" " let me know, and, ideally, save a copy of the file causing the\n" " problem -- without which I will be unable to investigate it.\n" "\n" ); } #if !defined(SPEC_CPU) exit(3); #else # 140 "bzlib.c" exit(0); #endif /* SPEC_CPU */ # 142 "bzlib.c" } #endif # 144 "bzlib.c" /*---------------------------------------------------*/ static int bz_config_ok ( void ) { if (sizeof(int) != 4) return 0; if (sizeof(short) != 2) return 0; if (sizeof(char) != 1) return 0; return 1; } /*---------------------------------------------------*/ static void* default_bzalloc ( void* opaque, Int32 items, Int32 size ) { void* v = malloc ( items * size ); return v; } static void default_bzfree ( void* opaque, void* addr ) { if (addr != NULL) free ( addr ); } /*---------------------------------------------------*/ static void prepare_new_block ( EState* s ) { Int32 i; s->nblock = 0; s->numZ = 0; s->state_out_pos = 0; BZ_INITIALISE_CRC ( s->blockCRC ); for (i = 0; i < 256; i++) s->inUse[i] = False; s->blockNo++; } /*---------------------------------------------------*/ static void init_RL ( EState* s ) { s->state_in_ch = 256; s->state_in_len = 0; } static Bool isempty_RL ( EState* s ) { if (s->state_in_ch < 256 && s->state_in_len > 0) return False; else return True; } /*---------------------------------------------------*/ int BZ_API(BZ2_bzCompressInit) ( bz_stream* strm, int blockSize100k, int verbosity, int workFactor ) { Int32 n; EState* s; if (!bz_config_ok()) return BZ_CONFIG_ERROR; if (strm == NULL || blockSize100k < 1 || blockSize100k > 9 || workFactor < 0 || workFactor > 250) return BZ_PARAM_ERROR; if (workFactor == 0) workFactor = 30; if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; if (strm->bzfree == NULL) strm->bzfree = default_bzfree; s = BZALLOC( sizeof(EState) ); if (s == NULL) return BZ_MEM_ERROR; s->strm = strm; s->arr1 = NULL; s->arr2 = NULL; s->ftab = NULL; n = 100000 * blockSize100k; s->arr1 = BZALLOC( n * sizeof(UInt32) ); s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) ); s->ftab = BZALLOC( 65537 * sizeof(UInt32) ); if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) { if (s->arr1 != NULL) BZFREE(s->arr1); if (s->arr2 != NULL) BZFREE(s->arr2); if (s->ftab != NULL) BZFREE(s->ftab); if (s != NULL) BZFREE(s); return BZ_MEM_ERROR; } s->blockNo = 0; s->state = BZ_S_INPUT; s->mode = BZ_M_RUNNING; s->combinedCRC = 0; s->blockSize100k = blockSize100k; s->nblockMAX = 100000 * blockSize100k - 19; s->verbosity = verbosity; s->workFactor = workFactor; s->block = (UChar*)s->arr2; s->mtfv = (UInt16*)s->arr1; s->zbits = NULL; s->ptr = (UInt32*)s->arr1; strm->state = s; strm->total_in_lo32 = 0; strm->total_in_hi32 = 0; strm->total_out_lo32 = 0; strm->total_out_hi32 = 0; init_RL ( s ); prepare_new_block ( s ); return BZ_OK; } /*---------------------------------------------------*/ static void add_pair_to_block ( EState* s ) { Int32 i; UChar ch = (UChar)(s->state_in_ch); for (i = 0; i < s->state_in_len; i++) { BZ_UPDATE_CRC( s->blockCRC, ch ); } s->inUse[s->state_in_ch] = True; switch (s->state_in_len) { case 1: s->block[s->nblock] = (UChar)ch; s->nblock++; break; case 2: s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; break; case 3: s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; break; default: s->inUse[s->state_in_len-4] = True; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = ((UChar)(s->state_in_len-4)); s->nblock++; break; } } /*---------------------------------------------------*/ static void flush_RL ( EState* s ) { if (s->state_in_ch < 256) add_pair_to_block ( s ); init_RL ( s ); } /*---------------------------------------------------*/ #define ADD_CHAR_TO_BLOCK(zs,zchh0) \ { \ UInt32 zchh = (UInt32)(zchh0); \ /*-- fast track the common case --*/ \ if (zchh != zs->state_in_ch && \ zs->state_in_len == 1) { \ UChar ch = (UChar)(zs->state_in_ch); \ BZ_UPDATE_CRC( zs->blockCRC, ch ); \ zs->inUse[zs->state_in_ch] = True; \ zs->block[zs->nblock] = (UChar)ch; \ zs->nblock++; \ zs->state_in_ch = zchh; \ } \ else \ /*-- general, uncommon cases --*/ \ if (zchh != zs->state_in_ch || \ zs->state_in_len == 255) { \ if (zs->state_in_ch < 256) \ add_pair_to_block ( zs ); \ zs->state_in_ch = zchh; \ zs->state_in_len = 1; \ } else { \ zs->state_in_len++; \ } \ } /*---------------------------------------------------*/ static Bool copy_input_until_stop ( EState* s ) { Bool progress_in = False; if (s->mode == BZ_M_RUNNING) { /*-- fast track the common case --*/ while (True) { /*-- block full? --*/ if (s->nblock >= s->nblockMAX) break; /*-- no input? --*/ if (s->strm->avail_in == 0) break; progress_in = True; ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); s->strm->next_in++; s->strm->avail_in--; s->strm->total_in_lo32++; if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; } } else { /*-- general, uncommon case --*/ while (True) { /*-- block full? --*/ if (s->nblock >= s->nblockMAX) break; /*-- no input? --*/ if (s->strm->avail_in == 0) break; /*-- flush/finish end? --*/ if (s->avail_in_expect == 0) break; progress_in = True; ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); s->strm->next_in++; s->strm->avail_in--; s->strm->total_in_lo32++; if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; s->avail_in_expect--; } } return progress_in; } /*---------------------------------------------------*/ static Bool copy_output_until_stop ( EState* s ) { Bool progress_out = False; while (True) { /*-- no output space? --*/ if (s->strm->avail_out == 0) break; /*-- block done? --*/ if (s->state_out_pos >= s->numZ) break; progress_out = True; *(s->strm->next_out) = s->zbits[s->state_out_pos]; s->state_out_pos++; s->strm->avail_out--; s->strm->next_out++; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } return progress_out; } /*---------------------------------------------------*/ static Bool handle_compress ( bz_stream* strm ) { Bool progress_in = False; Bool progress_out = False; EState* s = strm->state; while (True) { if (s->state == BZ_S_OUTPUT) { progress_out |= copy_output_until_stop ( s ); if (s->state_out_pos < s->numZ) break; if (s->mode == BZ_M_FINISHING && s->avail_in_expect == 0 && isempty_RL(s)) break; prepare_new_block ( s ); s->state = BZ_S_INPUT; if (s->mode == BZ_M_FLUSHING && s->avail_in_expect == 0 && isempty_RL(s)) break; } if (s->state == BZ_S_INPUT) { progress_in |= copy_input_until_stop ( s ); if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) { flush_RL ( s ); BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) ); s->state = BZ_S_OUTPUT; } else if (s->nblock >= s->nblockMAX) { BZ2_compressBlock ( s, False ); s->state = BZ_S_OUTPUT; } else if (s->strm->avail_in == 0) { break; } } } return progress_in || progress_out; } /*---------------------------------------------------*/ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) { Bool progress; EState* s; if (strm == NULL) return BZ_PARAM_ERROR; s = strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; preswitch: switch (s->mode) { case BZ_M_IDLE: return BZ_SEQUENCE_ERROR; case BZ_M_RUNNING: if (action == BZ_RUN) { progress = handle_compress ( strm ); return progress ? BZ_RUN_OK : BZ_PARAM_ERROR; } else if (action == BZ_FLUSH) { s->avail_in_expect = strm->avail_in; s->mode = BZ_M_FLUSHING; goto preswitch; } else if (action == BZ_FINISH) { s->avail_in_expect = strm->avail_in; s->mode = BZ_M_FINISHING; goto preswitch; } else return BZ_PARAM_ERROR; case BZ_M_FLUSHING: if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR; if (s->avail_in_expect != s->strm->avail_in) return BZ_SEQUENCE_ERROR; progress = handle_compress ( strm ); if (s->avail_in_expect > 0 || !isempty_RL(s) || s->state_out_pos < s->numZ) return BZ_FLUSH_OK; s->mode = BZ_M_RUNNING; return BZ_RUN_OK; case BZ_M_FINISHING: if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR; if (s->avail_in_expect != s->strm->avail_in) return BZ_SEQUENCE_ERROR; progress = handle_compress ( strm ); if (!progress) return BZ_SEQUENCE_ERROR; if (s->avail_in_expect > 0 || !isempty_RL(s) || s->state_out_pos < s->numZ) return BZ_FINISH_OK; s->mode = BZ_M_IDLE; return BZ_STREAM_END; } return BZ_OK; /*--not reached--*/ } /*---------------------------------------------------*/ int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) { EState* s; if (strm == NULL) return BZ_PARAM_ERROR; s = strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; if (s->arr1 != NULL) BZFREE(s->arr1); if (s->arr2 != NULL) BZFREE(s->arr2); if (s->ftab != NULL) BZFREE(s->ftab); BZFREE(strm->state); strm->state = NULL; return BZ_OK; } /*---------------------------------------------------*/ /*--- Decompression stuff ---*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ int BZ_API(BZ2_bzDecompressInit) ( bz_stream* strm, int verbosity, int small ) { DState* s; if (!bz_config_ok()) return BZ_CONFIG_ERROR; if (strm == NULL) return BZ_PARAM_ERROR; if (small != 0 && small != 1) return BZ_PARAM_ERROR; if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR; if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; if (strm->bzfree == NULL) strm->bzfree = default_bzfree; s = BZALLOC( sizeof(DState) ); if (s == NULL) return BZ_MEM_ERROR; s->strm = strm; strm->state = s; s->state = BZ_X_MAGIC_1; s->bsLive = 0; s->bsBuff = 0; s->calculatedCombinedCRC = 0; strm->total_in_lo32 = 0; strm->total_in_hi32 = 0; strm->total_out_lo32 = 0; strm->total_out_hi32 = 0; s->smallDecompress = (Bool)small; s->ll4 = NULL; s->ll16 = NULL; s->tt = NULL; s->currBlockNo = 0; s->verbosity = verbosity; return BZ_OK; } /*---------------------------------------------------*/ /* Return True iff data corruption is discovered. Returns False if there is no problem. */ static Bool unRLE_obuf_to_output_FAST ( DState* s ) { UChar k1; if (s->blockRandomised) { while (True) { /* try to finish existing run */ while (True) { if (s->strm->avail_out == 0) return False; if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); s->state_out_len--; s->strm->next_out++; s->strm->avail_out--; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } /* can a new run be started? */ if (s->nblock_used == s->save_nblock+1) return False; /* Only caused by corrupt data stream? */ if (s->nblock_used > s->save_nblock+1) return True; s->state_out_len = 1; s->state_out_ch = s->k0; BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 2; BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 3; BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; s->nblock_used++; } } else { /* restore */ UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC; UChar c_state_out_ch = s->state_out_ch; Int32 c_state_out_len = s->state_out_len; Int32 c_nblock_used = s->nblock_used; Int32 c_k0 = s->k0; UInt32* c_tt = s->tt; UInt32 c_tPos = s->tPos; char* cs_next_out = s->strm->next_out; unsigned int cs_avail_out = s->strm->avail_out; /* end restore */ UInt32 avail_out_INIT = cs_avail_out; Int32 s_save_nblockPP = s->save_nblock+1; unsigned int total_out_lo32_old; while (True) { /* try to finish existing run */ if (c_state_out_len > 0) { while (True) { if (cs_avail_out == 0) goto return_notr; if (c_state_out_len == 1) break; *( (UChar*)(cs_next_out) ) = c_state_out_ch; BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); c_state_out_len--; cs_next_out++; cs_avail_out--; } s_state_out_len_eq_one: { if (cs_avail_out == 0) { c_state_out_len = 1; goto return_notr; }; *( (UChar*)(cs_next_out) ) = c_state_out_ch; BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); cs_next_out++; cs_avail_out--; } } /* Only caused by corrupt data stream? */ if (c_nblock_used > s_save_nblockPP) return True; /* can a new run be started? */ if (c_nblock_used == s_save_nblockPP) { c_state_out_len = 0; goto return_notr; }; c_state_out_ch = c_k0; BZ_GET_FAST_C(k1); c_nblock_used++; if (k1 != c_k0) { c_k0 = k1; goto s_state_out_len_eq_one; }; if (c_nblock_used == s_save_nblockPP) goto s_state_out_len_eq_one; c_state_out_len = 2; BZ_GET_FAST_C(k1); c_nblock_used++; if (c_nblock_used == s_save_nblockPP) continue; if (k1 != c_k0) { c_k0 = k1; continue; }; c_state_out_len = 3; BZ_GET_FAST_C(k1); c_nblock_used++; if (c_nblock_used == s_save_nblockPP) continue; if (k1 != c_k0) { c_k0 = k1; continue; }; BZ_GET_FAST_C(k1); c_nblock_used++; c_state_out_len = ((Int32)k1) + 4; BZ_GET_FAST_C(c_k0); c_nblock_used++; } return_notr: total_out_lo32_old = s->strm->total_out_lo32; s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out); if (s->strm->total_out_lo32 < total_out_lo32_old) s->strm->total_out_hi32++; /* save */ s->calculatedBlockCRC = c_calculatedBlockCRC; s->state_out_ch = c_state_out_ch; s->state_out_len = c_state_out_len; s->nblock_used = c_nblock_used; s->k0 = c_k0; s->tt = c_tt; s->tPos = c_tPos; s->strm->next_out = cs_next_out; s->strm->avail_out = cs_avail_out; /* end save */ } return False; } /*---------------------------------------------------*/ __inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab ) { Int32 nb, na, mid; nb = 0; na = 256; do { mid = (nb + na) >> 1; if (indx >= cftab[mid]) nb = mid; else na = mid; } while (na - nb != 1); return nb; } /*---------------------------------------------------*/ /* Return True iff data corruption is discovered. Returns False if there is no problem. */ static Bool unRLE_obuf_to_output_SMALL ( DState* s ) { UChar k1; if (s->blockRandomised) { while (True) { /* try to finish existing run */ while (True) { if (s->strm->avail_out == 0) return False; if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); s->state_out_len--; s->strm->next_out++; s->strm->avail_out--; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } /* can a new run be started? */ if (s->nblock_used == s->save_nblock+1) return False; /* Only caused by corrupt data stream? */ if (s->nblock_used > s->save_nblock+1) return True; s->state_out_len = 1; s->state_out_ch = s->k0; BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 2; BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 3; BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; s->nblock_used++; } } else { while (True) { /* try to finish existing run */ while (True) { if (s->strm->avail_out == 0) return False; if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); s->state_out_len--; s->strm->next_out++; s->strm->avail_out--; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } /* can a new run be started? */ if (s->nblock_used == s->save_nblock+1) return False; /* Only caused by corrupt data stream? */ if (s->nblock_used > s->save_nblock+1) return True; s->state_out_len = 1; s->state_out_ch = s->k0; BZ_GET_SMALL(k1); s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 2; BZ_GET_SMALL(k1); s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 3; BZ_GET_SMALL(k1); s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; BZ_GET_SMALL(k1); s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; BZ_GET_SMALL(s->k0); s->nblock_used++; } } } /*---------------------------------------------------*/ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) { Bool corrupt; DState* s; if (strm == NULL) return BZ_PARAM_ERROR; s = strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; while (True) { if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR; if (s->state == BZ_X_OUTPUT) { if (s->smallDecompress) corrupt = unRLE_obuf_to_output_SMALL ( s ); else corrupt = unRLE_obuf_to_output_FAST ( s ); if (corrupt) return BZ_DATA_ERROR; if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) { BZ_FINALISE_CRC ( s->calculatedBlockCRC ); if (s->verbosity >= 3) VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC, s->calculatedBlockCRC ); if (s->verbosity >= 2) VPrintf0 ( "]" ); if (s->calculatedBlockCRC != s->storedBlockCRC) return BZ_DATA_ERROR; s->calculatedCombinedCRC = (s->calculatedCombinedCRC << 1) | (s->calculatedCombinedCRC >> 31); s->calculatedCombinedCRC ^= s->calculatedBlockCRC; s->state = BZ_X_BLKHDR_1; } else { return BZ_OK; } } if (s->state >= BZ_X_MAGIC_1) { Int32 r = BZ2_decompress ( s ); if (r == BZ_STREAM_END) { if (s->verbosity >= 3) VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x", s->storedCombinedCRC, s->calculatedCombinedCRC ); if (s->calculatedCombinedCRC != s->storedCombinedCRC) return BZ_DATA_ERROR; return r; } if (s->state != BZ_X_OUTPUT) return r; } } AssertH ( 0, 6001 ); return 0; /*NOTREACHED*/ } /*---------------------------------------------------*/ int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) { DState* s; if (strm == NULL) return BZ_PARAM_ERROR; s = strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; if (s->tt != NULL) BZFREE(s->tt); if (s->ll16 != NULL) BZFREE(s->ll16); if (s->ll4 != NULL) BZFREE(s->ll4); BZFREE(strm->state); strm->state = NULL; return BZ_OK; } #ifndef BZ_NO_STDIO /*---------------------------------------------------*/ /*--- File I/O stuff ---*/ /*---------------------------------------------------*/ #define BZ_SETERR(eee) \ { \ if (bzerror != NULL) *bzerror = eee; \ if (bzf != NULL) bzf->lastErr = eee; \ } typedef struct { #if defined(SPEC_CPU) int handle; #else # 953 "bzlib.c" FILE* handle; #endif # 955 "bzlib.c" Char buf[BZ_MAX_UNUSED]; Int32 bufN; Bool writing; bz_stream strm; Int32 lastErr; Bool initialisedOk; } bzFile; /*---------------------------------------------*/ #if defined(SPEC_CPU) static Bool myfeof ( int f ) #else # 969 "bzlib.c" static Bool myfeof ( FILE* f ) #endif # 971 "bzlib.c" { Int32 c = fgetc ( f ); if (c == EOF) return True; ungetc ( c, f ); return False; } /*---------------------------------------------------*/ BZFILE* BZ_API(BZ2_bzWriteOpen) ( int* bzerror, #if defined(SPEC_CPU) int f, #else # 985 "bzlib.c" FILE* f, #endif # 987 "bzlib.c" int blockSize100k, int verbosity, int workFactor ) { Int32 ret; bzFile* bzf = NULL; BZ_SETERR(BZ_OK); if (f == SPEC_NULLCAST NULL || (blockSize100k < 1 || blockSize100k > 9) || (workFactor < 0 || workFactor > 250) || (verbosity < 0 || verbosity > 4)) { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; if (ferror(f)) { BZ_SETERR(BZ_IO_ERROR); return NULL; }; bzf = malloc ( sizeof(bzFile) ); if (bzf == NULL) { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; BZ_SETERR(BZ_OK); bzf->initialisedOk = False; bzf->bufN = 0; bzf->handle = f; bzf->writing = True; bzf->strm.bzalloc = NULL; bzf->strm.bzfree = NULL; bzf->strm.opaque = NULL; if (workFactor == 0) workFactor = 30; ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, verbosity, workFactor ); if (ret != BZ_OK) { BZ_SETERR(ret); free(bzf); return NULL; }; bzf->strm.avail_in = 0; bzf->initialisedOk = True; return bzf; } /*---------------------------------------------------*/ void BZ_API(BZ2_bzWrite) ( int* bzerror, BZFILE* b, void* buf, int len ) { Int32 n, n2, ret; bzFile* bzf = (bzFile*)b; BZ_SETERR(BZ_OK); if (bzf == NULL || buf == NULL || len < 0) { BZ_SETERR(BZ_PARAM_ERROR); return; }; if (!(bzf->writing)) { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; if (len == 0) { BZ_SETERR(BZ_OK); return; }; bzf->strm.avail_in = len; bzf->strm.next_in = buf; while (True) { bzf->strm.avail_out = BZ_MAX_UNUSED; bzf->strm.next_out = bzf->buf; ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); if (ret != BZ_RUN_OK) { BZ_SETERR(ret); return; }; if (bzf->strm.avail_out < BZ_MAX_UNUSED) { n = BZ_MAX_UNUSED - bzf->strm.avail_out; n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), n, bzf->handle ); if (n != n2 || ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; } if (bzf->strm.avail_in == 0) { BZ_SETERR(BZ_OK); return; }; } } /*---------------------------------------------------*/ void BZ_API(BZ2_bzWriteClose) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in, unsigned int* nbytes_out ) { BZ2_bzWriteClose64 ( bzerror, b, abandon, nbytes_in, NULL, nbytes_out, NULL ); } void BZ_API(BZ2_bzWriteClose64) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in_lo32, unsigned int* nbytes_in_hi32, unsigned int* nbytes_out_lo32, unsigned int* nbytes_out_hi32 ) { Int32 n, n2, ret; bzFile* bzf = (bzFile*)b; if (bzf == NULL) { BZ_SETERR(BZ_OK); return; }; if (!(bzf->writing)) { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0; if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0; if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0; if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0; if ((!abandon) && bzf->lastErr == BZ_OK) { while (True) { bzf->strm.avail_out = BZ_MAX_UNUSED; bzf->strm.next_out = bzf->buf; ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END) { BZ_SETERR(ret); return; }; if (bzf->strm.avail_out < BZ_MAX_UNUSED) { n = BZ_MAX_UNUSED - bzf->strm.avail_out; n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), n, bzf->handle ); if (n != n2 || ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; } if (ret == BZ_STREAM_END) break; } } if ( !abandon && !ferror ( bzf->handle ) ) { fflush ( bzf->handle ); if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; } if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = bzf->strm.total_in_lo32; if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = bzf->strm.total_in_hi32; if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = bzf->strm.total_out_lo32; if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = bzf->strm.total_out_hi32; BZ_SETERR(BZ_OK); BZ2_bzCompressEnd ( &(bzf->strm) ); free ( bzf ); } /*---------------------------------------------------*/ BZFILE* BZ_API(BZ2_bzReadOpen) ( int* bzerror, #if defined(SPEC_CPU) int f, #else # 1160 "bzlib.c" FILE* f, #endif # 1162 "bzlib.c" int verbosity, int small, void* unused, int nUnused ) { bzFile* bzf = NULL; int ret; BZ_SETERR(BZ_OK); if (f == SPEC_NULLCAST NULL || (small != 0 && small != 1) || (verbosity < 0 || verbosity > 4) || (unused == NULL && nUnused != 0) || (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED))) { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; if (ferror(f)) { BZ_SETERR(BZ_IO_ERROR); return NULL; }; bzf = malloc ( sizeof(bzFile) ); if (bzf == NULL) { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; BZ_SETERR(BZ_OK); bzf->initialisedOk = False; bzf->handle = f; bzf->bufN = 0; bzf->writing = False; bzf->strm.bzalloc = NULL; bzf->strm.bzfree = NULL; bzf->strm.opaque = NULL; while (nUnused > 0) { bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; unused = ((void*)( 1 + ((UChar*)(unused)) )); nUnused--; } ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); if (ret != BZ_OK) { BZ_SETERR(ret); free(bzf); return NULL; }; bzf->strm.avail_in = bzf->bufN; bzf->strm.next_in = bzf->buf; bzf->initialisedOk = True; return bzf; } /*---------------------------------------------------*/ void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b ) { bzFile* bzf = (bzFile*)b; BZ_SETERR(BZ_OK); if (bzf == NULL) { BZ_SETERR(BZ_OK); return; }; if (bzf->writing) { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; if (bzf->initialisedOk) (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); free ( bzf ); } /*---------------------------------------------------*/ int BZ_API(BZ2_bzRead) ( int* bzerror, BZFILE* b, void* buf, int len ) { Int32 n, ret; bzFile* bzf = (bzFile*)b; BZ_SETERR(BZ_OK); if (bzf == NULL || buf == NULL || len < 0) { BZ_SETERR(BZ_PARAM_ERROR); return 0; }; if (bzf->writing) { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; }; if (len == 0) { BZ_SETERR(BZ_OK); return 0; }; bzf->strm.avail_out = len; bzf->strm.next_out = buf; while (True) { if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return 0; }; if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { n = fread ( (unsigned char *)bzf->buf, sizeof(UChar), BZ_MAX_UNUSED, bzf->handle ); if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return 0; }; bzf->bufN = n; bzf->strm.avail_in = bzf->bufN; bzf->strm.next_in = bzf->buf; } ret = BZ2_bzDecompress ( &(bzf->strm) ); if (ret != BZ_OK && ret != BZ_STREAM_END) { BZ_SETERR(ret); return 0; }; if (ret == BZ_OK && myfeof(bzf->handle) && bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; }; if (ret == BZ_STREAM_END) { BZ_SETERR(BZ_STREAM_END); return len - bzf->strm.avail_out; }; if (bzf->strm.avail_out == 0) { BZ_SETERR(BZ_OK); return len; }; } return 0; /*not reached*/ } /*---------------------------------------------------*/ void BZ_API(BZ2_bzReadGetUnused) ( int* bzerror, BZFILE* b, void** unused, int* nUnused ) { bzFile* bzf = (bzFile*)b; if (bzf == NULL) { BZ_SETERR(BZ_PARAM_ERROR); return; }; if (bzf->lastErr != BZ_STREAM_END) { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; if (unused == NULL || nUnused == NULL) { BZ_SETERR(BZ_PARAM_ERROR); return; }; BZ_SETERR(BZ_OK); *nUnused = bzf->strm.avail_in; *unused = bzf->strm.next_in; } #endif # 1312 "bzlib.c" /*---------------------------------------------------*/ /*--- Misc convenience stuff ---*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ int BZ_API(BZ2_bzBuffToBuffCompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int blockSize100k, int verbosity, int workFactor ) { bz_stream strm; int ret; if (dest == NULL || destLen == NULL || source == NULL || blockSize100k < 1 || blockSize100k > 9 || verbosity < 0 || verbosity > 4 || workFactor < 0 || workFactor > 250) return BZ_PARAM_ERROR; if (workFactor == 0) workFactor = 30; strm.bzalloc = NULL; strm.bzfree = NULL; strm.opaque = NULL; ret = BZ2_bzCompressInit ( &strm, blockSize100k, verbosity, workFactor ); if (ret != BZ_OK) return ret; strm.next_in = source; strm.next_out = dest; strm.avail_in = sourceLen; strm.avail_out = *destLen; ret = BZ2_bzCompress ( &strm, BZ_FINISH ); if (ret == BZ_FINISH_OK) goto output_overflow; if (ret != BZ_STREAM_END) goto errhandler; /* normal termination */ *destLen -= strm.avail_out; BZ2_bzCompressEnd ( &strm ); return BZ_OK; output_overflow: BZ2_bzCompressEnd ( &strm ); return BZ_OUTBUFF_FULL; errhandler: BZ2_bzCompressEnd ( &strm ); return ret; } /*---------------------------------------------------*/ int BZ_API(BZ2_bzBuffToBuffDecompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int small, int verbosity ) { bz_stream strm; int ret; if (dest == NULL || destLen == NULL || source == NULL || (small != 0 && small != 1) || verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR; strm.bzalloc = NULL; strm.bzfree = NULL; strm.opaque = NULL; ret = BZ2_bzDecompressInit ( &strm, verbosity, small ); if (ret != BZ_OK) return ret; strm.next_in = source; strm.next_out = dest; strm.avail_in = sourceLen; strm.avail_out = *destLen; ret = BZ2_bzDecompress ( &strm ); if (ret == BZ_OK) goto output_overflow_or_eof; if (ret != BZ_STREAM_END) goto errhandler; /* normal termination */ *destLen -= strm.avail_out; BZ2_bzDecompressEnd ( &strm ); return BZ_OK; output_overflow_or_eof: if (strm.avail_out > 0) { BZ2_bzDecompressEnd ( &strm ); return BZ_UNEXPECTED_EOF; } else { BZ2_bzDecompressEnd ( &strm ); return BZ_OUTBUFF_FULL; }; errhandler: BZ2_bzDecompressEnd ( &strm ); return ret; } /*---------------------------------------------------*/ /*-- Code contributed by Yoshioka Tsuneo (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp), to support better zlib compatibility. This code is not _officially_ part of libbzip2 (yet); I haven't tested it, documented it, or considered the threading-safeness of it. If this code breaks, please contact both Yoshioka and me. --*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ /*-- return version like "0.9.0c". --*/ const char * BZ_API(BZ2_bzlibVersion)(void) { return BZ_VERSION; } #ifndef BZ_NO_STDIO /*---------------------------------------------------*/ #if !defined(SPEC_CPU) #if defined(_WIN32) || defined(OS2) || defined(MSDOS) #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 1450 "bzlib.c" # 1451 "bzlib.c" #if 0 /* expanded by -frewrite-includes */ # include #endif /* expanded by -frewrite-includes */ # 1451 "bzlib.c" # 1452 "bzlib.c" # define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY) #else # 1454 "bzlib.c" # define SET_BINARY_MODE(file) #endif # 1456 "bzlib.c" #endif /* !SPEC_CPU */ # 1457 "bzlib.c" static BZFILE * bzopen_or_bzdopen ( const char *path, /* no use when bzdopen */ int fd, /* no use when bzdopen */ const char *mode, int open_mode) /* bzopen: 0, bzdopen:1 */ { int bzerr; char unused[BZ_MAX_UNUSED]; int blockSize100k = 9; int writing = 0; char mode2[10] = ""; #if defined(SPEC_CPU) int fp = 0; #else # 1472 "bzlib.c" FILE *fp = NULL; #endif # 1474 "bzlib.c" BZFILE *bzfp = NULL; int verbosity = 0; int workFactor = 30; int smallMode = 0; int nUnused = 0; if (mode == NULL) return NULL; while (*mode) { switch (*mode) { case 'r': writing = 0; break; case 'w': writing = 1; break; case 's': smallMode = 1; break; default: if (isdigit((int)(*mode))) { blockSize100k = *mode-BZ_HDR_0; } } mode++; } strcat(mode2, writing ? "w" : "r" ); strcat(mode2,"b"); /* binary mode */ if (open_mode==0) { if (path==NULL || strcmp(path,"")==0) { #if defined(SPEC_CPU) fp = (writing ? SPEC_STDOUT : SPEC_STDIN); #else # 1504 "bzlib.c" fp = (writing ? stdout : stdin); #endif # 1506 "bzlib.c" SET_BINARY_MODE(fp); } else { fp = fopen(path,mode2); } } else { #if defined(SPEC_CPU) fp = SPEC_NULLCAST NULL; #else # 1514 "bzlib.c" #ifdef BZ_STRICT_ANSI fp = NULL; #else # 1517 "bzlib.c" fp = fdopen(fd,mode2); #endif # 1519 "bzlib.c" #endif /* !SPEC_CPU */ # 1520 "bzlib.c" } if (fp == SPEC_NULLCAST NULL) return NULL; if (writing) { /* Guard against total chaos and anarchy -- JRS */ if (blockSize100k < 1) blockSize100k = 1; if (blockSize100k > 9) blockSize100k = 9; bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k, verbosity,workFactor); } else { bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode, unused,nUnused); } if (bzfp == NULL) { #if defined(SPEC_CPU) if (fp != SPEC_STDIN && fp != SPEC_STDOUT) fclose(fp); #else # 1537 "bzlib.c" if (fp != stdin && fp != stdout) fclose(fp); #endif # 1539 "bzlib.c" return NULL; } return bzfp; } /*---------------------------------------------------*/ /*-- open file for read or write. ex) bzopen("file","w9") case path="" or NULL => use stdin or stdout. --*/ BZFILE * BZ_API(BZ2_bzopen) ( const char *path, const char *mode ) { return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0); } /*---------------------------------------------------*/ BZFILE * BZ_API(BZ2_bzdopen) ( int fd, const char *mode ) { return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1); } /*---------------------------------------------------*/ int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len ) { int bzerr, nread; if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0; nread = BZ2_bzRead(&bzerr,b,buf,len); if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) { return nread; } else { return -1; } } /*---------------------------------------------------*/ int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len ) { int bzerr; BZ2_bzWrite(&bzerr,b,buf,len); if(bzerr == BZ_OK){ return len; }else{ return -1; } } /*---------------------------------------------------*/ int BZ_API(BZ2_bzflush) (BZFILE *b) { /* do nothing now... */ return 0; } /*---------------------------------------------------*/ void BZ_API(BZ2_bzclose) (BZFILE* b) { int bzerr; #if defined(SPEC_CPU) int fp = ((bzFile *)b)->handle; #else # 1611 "bzlib.c" FILE *fp = ((bzFile *)b)->handle; #endif # 1613 "bzlib.c" if (b==NULL) {return;} if(((bzFile*)b)->writing){ BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL); if(bzerr != BZ_OK){ BZ2_bzWriteClose(NULL,b,1,NULL,NULL); } }else{ BZ2_bzReadClose(&bzerr,b); } #if defined(SPEC_CPU) if(fp!=SPEC_STDIN && fp!=SPEC_STDOUT){ #else # 1626 "bzlib.c" if(fp!=stdin && fp!=stdout){ #endif # 1628 "bzlib.c" fclose(fp); } } /*---------------------------------------------------*/ /*-- return last error code --*/ static char *bzerrorstrings[] = { "OK" ,"SEQUENCE_ERROR" ,"PARAM_ERROR" ,"MEM_ERROR" ,"DATA_ERROR" ,"DATA_ERROR_MAGIC" ,"IO_ERROR" ,"UNEXPECTED_EOF" ,"OUTBUFF_FULL" ,"CONFIG_ERROR" ,"???" /* for future */ ,"???" /* for future */ ,"???" /* for future */ ,"???" /* for future */ ,"???" /* for future */ ,"???" /* for future */ }; const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum) { int err = ((bzFile *)b)->lastErr; if(err>0) err = 0; *errnum = err; return bzerrorstrings[err*-1]; } #endif # 1666 "bzlib.c" /*-------------------------------------------------------------*/ /*--- end bzlib.c ---*/ /*-------------------------------------------------------------*/