summaryrefslogtreecommitdiff
path: root/google/zip_internal.h
diff options
context:
space:
mode:
authoralecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-03 23:02:57 +0000
committeralecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-03 23:02:57 +0000
commitd6d082e35fbdc00123e54a7a1769a437bdfc4391 (patch)
tree31e89f732bf3cee7e74334d50cd9993763e4c57d /google/zip_internal.h
parent5c4b6f610dd3b3294cf81f032de4a5f705e29754 (diff)
downloadzlib-d6d082e35fbdc00123e54a7a1769a437bdfc4391.tar.gz
Move components/zip to third_party/zip
Move components to zip as per the discussion here: https://groups.google.com/a/chromium.org/d/topic/chromium-dev/MgbMTQCNzR0/discussion BUG= R=agl@chromium.org, gavinp@chromium.org, jam@chromium.org, joi@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=197964 Review URL: https://codereview.chromium.org/14021015 Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 4170d3a06feb349153149c05493756bfd3700cd3
Diffstat (limited to 'google/zip_internal.h')
-rw-r--r--google/zip_internal.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/google/zip_internal.h b/google/zip_internal.h
new file mode 100644
index 0000000..57894be
--- /dev/null
+++ b/google/zip_internal.h
@@ -0,0 +1,62 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_INTERNAL_H_
+#define THIRD_PARTY_ZLIB_GOOGLE_ZIP_INTERNAL_H_
+
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
+#include <string>
+
+#if defined(USE_SYSTEM_MINIZIP)
+#include <minizip/unzip.h>
+#include <minizip/zip.h>
+#else
+#include "third_party/zlib/contrib/minizip/unzip.h"
+#include "third_party/zlib/contrib/minizip/zip.h"
+#endif
+
+// Utility functions and constants used internally for the zip file
+// library in the directory. Don't use them outside of the library.
+namespace zip {
+namespace internal {
+
+// Opens the given file name in UTF-8 for unzipping, with some setup for
+// Windows.
+unzFile OpenForUnzipping(const std::string& file_name_utf8);
+
+#if defined(OS_POSIX)
+// Opens the file referred to by |zip_fd| for unzipping.
+unzFile OpenFdForUnzipping(int zip_fd);
+#endif
+
+#if defined(OS_WIN)
+// Opens the file referred to by |zip_handle| for unzipping.
+unzFile OpenHandleForUnzipping(HANDLE zip_handle);
+#endif
+
+// Creates a custom unzFile object which reads data from the specified string.
+// This custom unzFile object overrides the I/O API functions of zlib so it can
+// read data from the specified string.
+unzFile PreprareMemoryForUnzipping(const std::string& data);
+
+// Opens the given file name in UTF-8 for zipping, with some setup for
+// Windows. |append_flag| will be passed to zipOpen2().
+zipFile OpenForZipping(const std::string& file_name_utf8, int append_flag);
+
+#if defined(OS_POSIX)
+// Opens the file referred to by |zip_fd| for zipping. |append_flag| will be
+// passed to zipOpen2().
+zipFile OpenFdForZipping(int zip_fd, int append_flag);
+#endif
+
+const int kZipMaxPath = 256;
+const int kZipBufSize = 8192;
+
+} // namespace internal
+} // namespace zip
+
+#endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_INTERNAL_H_