Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Clang format #842

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions minigzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ int32_t minigzip_banner(void) {
}

int32_t minigzip_help(void) {
printf("Usage: minigzip [-x] [-d] [-0 to -9] [files]\n\n" \
" -x Extract file\n" \
" -d Destination directory\n" \
" -0 Store only\n" \
" -1 Compress faster\n" \
" -9 Compress better\n\n");
printf(
"Usage: minigzip [-x] [-d] [-0 to -9] [files]\n\n"
" -x Extract file\n"
" -d Destination directory\n"
" -0 Store only\n"
" -1 Compress faster\n"
" -9 Compress better\n\n");
return MZ_OK;
}

Expand Down
86 changes: 43 additions & 43 deletions minizip.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,31 @@ int32_t minizip_banner(void) {
}

int32_t minizip_help(void) {
printf("Usage: minizip [-x][-d dir|-l|-e][-o][-f][-y][-c cp][-a][-0 to -9][-b|-m|-t][-k 512][-p pwd][-s] file.zip [files]\n\n" \
" -x Extract files\n" \
" -l List files\n" \
" -d Destination directory\n" \
" -e Erase files\n" \
" -o Overwrite existing files\n" \
" -c File names use cp437 encoding (or specified codepage)\n" \
" -a Append to existing zip file\n" \
" -i Include full path of files\n" \
" -f Follow symbolic links\n" \
" -y Store symbolic links\n" \
" -v Verbose info\n" \
" -0 Store only\n" \
" -1 Compress faster\n" \
" -9 Compress better\n" \
" -k Disk size in KB\n" \
" -z Zip central directory\n" \
" -p Encryption password\n" \
" -s AES encryption\n" \
" -b BZIP2 compression\n" \
" -m LZMA compression\n" \
" -n XZ compression\n" \
" -t ZSTD compression\n\n");
printf(
"Usage: minizip [-x][-d dir|-l|-e][-o][-f][-y][-c cp][-a][-0 to -9][-b|-m|-t][-k 512][-p pwd][-s] file.zip "
"[files]\n\n"
" -x Extract files\n"
" -l List files\n"
" -d Destination directory\n"
" -e Erase files\n"
" -o Overwrite existing files\n"
" -c File names use cp437 encoding (or specified codepage)\n"
" -a Append to existing zip file\n"
" -i Include full path of files\n"
" -f Follow symbolic links\n"
" -y Store symbolic links\n"
" -v Verbose info\n"
" -0 Store only\n"
" -1 Compress faster\n"
" -9 Compress better\n"
" -k Disk size in KB\n"
" -z Zip central directory\n"
" -p Encryption password\n"
" -s AES encryption\n"
" -b BZIP2 compression\n"
" -m LZMA compression\n"
" -n XZ compression\n"
" -t ZSTD compression\n\n");
return MZ_OK;
}

Expand All @@ -103,7 +105,6 @@ int32_t minizip_list(const char *path) {
char crypt = ' ';
void *reader = NULL;


reader = mz_zip_reader_create();
if (!reader)
return MZ_MEM_ERROR;
Expand Down Expand Up @@ -241,7 +242,6 @@ int32_t minizip_add(const char *path, const char *password, minizip_opt *options
int32_t i = 0;
const char *filename_in_zip = NULL;


printf("Archive %s\n", path);

/* Create zip writer */
Expand Down Expand Up @@ -575,35 +575,35 @@ int main(int argc, const char *argv[]) {
if (options.compress_level == 0)
options.compress_method = MZ_COMPRESS_METHOD_STORE;
} else if ((c == 'b') || (c == 'B'))
#ifdef HAVE_BZIP2
# ifdef HAVE_BZIP2
options.compress_method = MZ_COMPRESS_METHOD_BZIP2;
#else
# else
err = MZ_SUPPORT_ERROR;
#endif
# endif
else if ((c == 'm') || (c == 'M'))
#ifdef HAVE_LZMA
# ifdef HAVE_LZMA
options.compress_method = MZ_COMPRESS_METHOD_LZMA;
#else
# else
err = MZ_SUPPORT_ERROR;
#endif
# endif
else if ((c == 'n') || (c == 'N'))
#if defined(HAVE_LZMA) || defined(HAVE_LIBCOMP)
# if defined(HAVE_LZMA) || defined(HAVE_LIBCOMP)
options.compress_method = MZ_COMPRESS_METHOD_XZ;
#else
# else
err = MZ_SUPPORT_ERROR;
#endif
# endif
else if ((c == 't') || (c == 'T'))
#ifdef HAVE_ZSTD
# ifdef HAVE_ZSTD
options.compress_method = MZ_COMPRESS_METHOD_ZSTD;
#else
# else
err = MZ_SUPPORT_ERROR;
#endif
# endif
else if ((c == 's') || (c == 'S'))
#ifdef HAVE_WZAES
# ifdef HAVE_WZAES
options.aes = 1;
#else
# else
err = MZ_SUPPORT_ERROR;
#endif
# endif
else if (((c == 'c') || (c == 'C')) && (i + 1 < argc)) {
options.encoding = (int32_t)atoi(argv[i + 1]);
i += 1;
Expand All @@ -616,12 +616,12 @@ int main(int argc, const char *argv[]) {
printf("%s ", argv[i + 1]);
i += 1;
} else if (((c == 'p') || (c == 'P')) && (i + 1 < argc)) {
#ifndef MZ_ZIP_NO_ENCRYPTION
# ifndef MZ_ZIP_NO_ENCRYPTION
password = argv[i + 1];
printf("*** ");
#else
# else
err = MZ_SUPPORT_ERROR;
#endif
# endif
i += 1;
}
} else if (path_arg == 0)
Expand Down
Loading
Loading