51 #define MY_MIN(a, b) ((a) < (b) ? (a) : (b))
53 #define FRAGMENT_SIZE (8 * 1024)
55 #define MARK_BEGIN "NiH0"
56 #define MARK_DATA "NiH1"
57 #define MARK_NUL "NiH2"
212 if (fread(
b, 20, 1,
f) != 1) {
245 while (i < buffer->nfragments) {
246 if (fread(
b, 4, 1,
f) != 1) {
267 if (fread(
b, 8, 1,
f) != 1) {
286 if (new_offset < 0) {
330 if (fclose(
f) != 0) {
347 if (new_capacity == 0) {
350 while (new_capacity < needed_fragments) {
356 if (fragment ==
NULL) {
418 if (data[
i] !=
'\0') {
449 return fwrite(
b, 8, 1,
f) == 1 ? 0 : -1;
533 (void)remove(
ctx->fname);
571 return zip_source_make_command_bitmap(
ZIP_SOURCE_BEGIN_WRITE,
ZIP_SOURCE_COMMIT_WRITE,
ZIP_SOURCE_CLOSE,
ZIP_SOURCE_ERROR,
ZIP_SOURCE_FREE,
ZIP_SOURCE_OPEN,
ZIP_SOURCE_READ,
ZIP_SOURCE_REMOVE,
ZIP_SOURCE_ROLLBACK_WRITE,
ZIP_SOURCE_SEEK,
ZIP_SOURCE_SEEK_WRITE,
ZIP_SOURCE_STAT,
ZIP_SOURCE_TELL,
ZIP_SOURCE_TELL_WRITE,
ZIP_SOURCE_WRITE, -1);
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)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int)
ZIP_EXTERN zip_int64_t zip_source_seek_compute_offset(zip_uint64_t, zip_uint64_t, void *_Nonnull, zip_uint64_t, zip_error_t *_Nullable)
ZIP_EXTERN void zip_error_init(zip_error_t *_Nonnull)
enum zip_source_cmd zip_source_cmd_t
@ ZIP_SOURCE_ROLLBACK_WRITE
@ ZIP_SOURCE_COMMIT_WRITE
ZIP_EXTERN void zip_error_fini(zip_error_t *_Nonnull)
ZIP_EXTERN zip_source_t *_Nullable zip_source_function_create(zip_source_callback _Nonnull, void *_Nullable, zip_error_t *_Nullable)
ZIP_EXTERN zip_int64_t zip_source_make_command_bitmap(zip_source_cmd_t,...)
ZIP_EXTERN zip_int64_t zip_error_to_data(const zip_error_t *_Nonnull, void *_Nonnull, zip_uint64_t)
#define ZIP_SOURCE_GET_ARGS(type, data, len, error)
void * realloc(void *ptr, size_t size)
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 struct sockaddr static addrlen static backlog const void static flags void flags
static int buffer_to_file(buffer_t *buffer, const char *fname, zip_error_t *error)
static zip_int64_t source_hole_cb(void *ud, void *data, zip_uint64_t length, zip_source_cmd_t command)
static buffer_t * buffer_new(void)
static int only_nul(const zip_uint8_t *data, zip_uint64_t length)
zip_source_t * source_hole_create(const char *, int flags, zip_error_t *)
static zip_uint64_t get_u64(const zip_uint8_t *b)
static int buffer_read_file(buffer_t *buffer, FILE *f, zip_error_t *error)
static int write_u64(zip_uint64_t u64, FILE *f)
static void buffer_free(buffer_t *buffer)
static zip_int64_t buffer_read(buffer_t *buffer, zip_uint8_t *data, zip_uint64_t length, zip_error_t *error)
static buffer_t * buffer_from_file(const char *fname, int flags, zip_error_t *error)
static hole_t * hole_new(const char *fname, int flags, zip_error_t *error)
static int write_nuls(zip_uint64_t n, FILE *f)
static zip_int64_t buffer_write(buffer_t *buffer, const zip_uint8_t *data, zip_uint64_t length, zip_error_t *error)
static void hole_free(hole_t *hole)
static zip_int64_t buffer_seek(buffer_t *buffer, void *data, zip_uint64_t length, zip_error_t *error)
zip_uint64_t fragment_size
void error(const char *msg)
if(dbg->bits==RZ_SYS_BITS_64)