48 #include <sys/clonefile.h>
51 #ifdef HAVE_FICLONERANGE
53 #include <sys/ioctl.h>
76 _zip_stdio_op_create_temp_output_cloning,
114 if (fclose(
ctx->fout) < 0) {
135 if ((
ctx->fout = fdopen(
fd,
"r+b")) ==
NULL) {
138 (void)remove(
ctx->tmpname);
152 if (
offset > ZIP_OFF_MAX) {
157 #ifdef HAVE_CLONEFILE
163 if (clonefile(
ctx->fname,
ctx->tmpname, 0) < 0) {
171 (void)remove(
ctx->tmpname);
179 struct file_clone_range
range;
182 if (
fstat(fileno(
ctx->f), &st) < 0) {
192 range.src_offset = 0;
193 range.src_length = ((
offset + st.st_blksize - 1) / st.st_blksize) * st.st_blksize;
194 if (
range.src_length > st.st_size) {
195 range.src_length = 0;
197 range.dest_offset = 0;
201 (void)remove(
ctx->tmpname);
207 if ((tfp = fdopen(
fd,
"r+b")) ==
NULL) {
210 (void)remove(
ctx->tmpname);
220 (void)remove(
ctx->tmpname);
228 (void)remove(
ctx->tmpname);
252 if (remove(
ctx->fname) < 0) {
265 (void)remove(
ctx->tmpname);
279 ret = fwrite(data, 1,
len, (
FILE *)
ctx->fout);
280 if (ret !=
len || ferror((
FILE *)
ctx->fout)) {
296 if (
stat(
ctx->fname, &st) == 0) {
303 if ((temp = (
char *)
malloc(strlen(
ctx->fname) + 13)) ==
NULL) {
308 end = temp + strlen(temp) - 5;
316 char digit =
value % 36;
318 *(xs++) = digit +
'0';
321 *(xs++) = digit - 10 +
'a';
345 if (
stat(temp, &st) < 0) {
360 return create_file ?
fd : 0;
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence ftruncate
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count fchmod
static static fork const void static count close
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset fstat
static static sync static getppid static getegid const char static filename ioctl
static static fork const void static count static fd const char const char static newpath const char static path chmod
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
RZ_API void Ht_() free(HtName_(Ht) *ht)
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
void * malloc(size_t size)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync rename
void error(const char *msg)
static const z80_opcode fd[]
zip_uint32_t zip_random_uint32(void)
zip_source_t * zip_source_file_common_new(const char *fname, void *file, zip_uint64_t start, zip_int64_t len, const zip_stat_t *st, zip_source_file_operations_t *ops, void *ops_userdata, zip_error_t *error)
void _zip_stdio_op_close(zip_source_file_context_t *ctx)
zip_int64_t _zip_stdio_op_read(zip_source_file_context_t *ctx, void *buf, zip_uint64_t len)
zip_int64_t _zip_stdio_op_tell(zip_source_file_context_t *ctx, void *f)
bool _zip_stdio_op_stat(zip_source_file_context_t *ctx, zip_source_file_stat_t *st)
FILE * _zip_fopen_close_on_exec(const char *name, bool writeable)
bool _zip_stdio_op_seek(zip_source_file_context_t *ctx, void *f, zip_int64_t offset, int whence)
static void _zip_stdio_op_rollback_write(zip_source_file_context_t *ctx)
static char * _zip_stdio_op_strdup(zip_source_file_context_t *ctx, const char *string)
ZIP_EXTERN zip_source_t * zip_source_file_create(const char *fname, zip_uint64_t start, zip_int64_t length, zip_error_t *error)
static zip_int64_t _zip_stdio_op_commit_write(zip_source_file_context_t *ctx)
static zip_int64_t _zip_stdio_op_remove(zip_source_file_context_t *ctx)
static zip_int64_t _zip_stdio_op_create_temp_output(zip_source_file_context_t *ctx)
ZIP_EXTERN zip_source_t * zip_source_file(zip_t *za, const char *fname, zip_uint64_t start, zip_int64_t len)
static bool _zip_stdio_op_open(zip_source_file_context_t *ctx)
static zip_int64_t _zip_stdio_op_write(zip_source_file_context_t *ctx, const void *data, zip_uint64_t len)
static int create_temp_file(zip_source_file_context_t *ctx, bool create_file)
static zip_source_file_operations_t ops_stdio_named