1116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Copyright 2014 The Chromium Authors. All rights reserved.
2116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Use of this source code is governed by a BSD-style license that can be
3116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// found in the LICENSE file.
4116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
5116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#ifndef CRAZY_ZIP_H
6116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#define CRAZY_ZIP_H
7116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
8116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Definitions related to supporting loading libraries from zip files.
9116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
10116680a4aac90f2aa7413d9095a592090648e557Ben Murdochnamespace crazy {
11116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
12116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// Find "filename" in the specified "zip_file" and return the offset
13116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// in the file of the start of the data for the file. Return -1 on error.
14116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// This routine replaces code which used the minizip library, but is about
15116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch// 150 times faster, locating the offset in less than 0.5ms on a Nexus 4.
16116680a4aac90f2aa7413d9095a592090648e557Ben Murdochint FindStartOffsetOfFileInZipFile(const char* zip_file, const char* filename);
17116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
18116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch}
19116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
20116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch#endif  // CRAZY_ZIP_H
21