50 fprintf(stderr,
"can't open %s: %s\n",
archive, strerror(errno));
60 if (
fstat(fileno(fp), &st) < 0) {
61 fprintf(stderr,
"can't stat %s: %s\n",
archive, strerror(errno));
66 if ((*datap =
malloc((
size_t)st.st_size)) ==
NULL) {
67 fprintf(stderr,
"can't allocate buffer\n");
72 if (fread(*datap, 1, (
size_t)st.st_size, fp) < (
size_t)st.st_size) {
73 fprintf(stderr,
"can't read %s: %s\n",
archive, strerror(errno));
81 *sizep = (
size_t)st.st_size;
99 fprintf(stderr,
"can't remove %s: %s\n",
archive, strerror(errno));
106 fprintf(stderr,
"can't open %s: %s\n",
archive, strerror(errno));
109 if (fwrite(data, 1,
size, fp) <
size) {
110 fprintf(stderr,
"can't write %s: %s\n",
archive, strerror(errno));
114 if (fclose(fp) < 0) {
115 fprintf(stderr,
"can't write %s: %s\n",
archive, strerror(errno));
133 fprintf(stderr,
"usage: %s archive\n",
argv[0]);
195 fprintf(stderr,
"malloc failed: %s\n", strerror(errno));
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
RZ_API void Ht_() free(HtName_(Ht) *ht)
int main(int argc, char *argv[])
static int get_data(void **datap, size_t *sizep, const char *archive)
static int modify_archive(zip_t *za)
static int use_data(void *data, size_t size, const char *archive)
ZIP_EXTERN int zip_source_close(zip_source_t *_Nonnull)
ZIP_EXTERN int zip_source_is_deleted(zip_source_t *_Nonnull)
ZIP_EXTERN zip_t *_Nullable zip_open_from_source(zip_source_t *_Nonnull, int, zip_error_t *_Nullable)
ZIP_EXTERN zip_int64_t zip_source_read(zip_source_t *_Nonnull, void *_Nonnull, zip_uint64_t)
ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_create(const void *_Nullable, zip_uint64_t, int, zip_error_t *_Nullable)
ZIP_EXTERN void zip_error_init(zip_error_t *_Nonnull)
ZIP_EXTERN zip_error_t *_Nonnull zip_source_error(zip_source_t *_Nonnull)
ZIP_EXTERN int zip_source_stat(zip_source_t *_Nonnull, zip_stat_t *_Nonnull)
ZIP_EXTERN int zip_close(zip_t *_Nonnull)
ZIP_EXTERN int zip_source_open(zip_source_t *_Nonnull)
ZIP_EXTERN void zip_error_fini(zip_error_t *_Nonnull)
ZIP_EXTERN void zip_source_free(zip_source_t *_Nullable)
ZIP_EXTERN const char *_Nonnull zip_error_strerror(zip_error_t *_Nonnull)
ZIP_EXTERN void zip_source_keep(zip_source_t *_Nonnull)
ZIP_EXTERN const char *_Nonnull zip_strerror(zip_t *_Nonnull)
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char argv
void error(const char *msg)