blob: a6b39ac418dc11ecb78827cdd5e6c5a43a680e5f [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001//
2// Copyright 2006 The Android Open Source Project
3//
4// Some global defines that don't really merit their own header.
5//
6#ifndef __MAIN_H
7#define __MAIN_H
8
Mathias Agopian3b4062e2009-05-31 19:13:00 -07009#include <utils/Log.h>
10#include <utils/threads.h>
11#include <utils/List.h>
12#include <utils/Errors.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080013#include "Bundle.h"
14#include "AaptAssets.h"
Mathias Agopian55e3d602009-06-05 14:56:35 -070015#include "ZipFile.h"
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080016
Josiah Gaskin8a39da82011-06-06 17:00:35 -070017
18/* Benchmarking Flag */
19//#define BENCHMARK 1
20
21#if BENCHMARK
22 #include <time.h>
23#endif /* BENCHMARK */
24
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025extern int doVersion(Bundle* bundle);
26extern int doList(Bundle* bundle);
27extern int doDump(Bundle* bundle);
28extern int doAdd(Bundle* bundle);
29extern int doRemove(Bundle* bundle);
30extern int doPackage(Bundle* bundle);
Josiah Gaskin8a39da82011-06-06 17:00:35 -070031extern int doCrunch(Bundle* bundle);
Xavier Ducrohetb1f6ad82012-12-21 09:54:02 -080032extern int doSingleCrunch(Bundle* bundle);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033
34extern int calcPercent(long uncompressedLen, long compressedLen);
35
36extern android::status_t writeAPK(Bundle* bundle,
37 const sp<AaptAssets>& assets,
38 const android::String8& outputFile);
39
Josiah Gaskin8a39da82011-06-06 17:00:35 -070040extern android::status_t updatePreProcessedCache(Bundle* bundle);
41
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042extern android::status_t buildResources(Bundle* bundle,
43 const sp<AaptAssets>& assets);
44
45extern android::status_t writeResourceSymbols(Bundle* bundle,
46 const sp<AaptAssets>& assets, const String8& pkgName, bool includePrivate);
47
Joe Onorato1553c822009-08-30 13:36:22 -070048extern android::status_t writeProguardFile(Bundle* bundle, const sp<AaptAssets>& assets);
49
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050extern bool isValidResourceType(const String8& type);
51
52ssize_t processAssets(Bundle* bundle, ZipFile* zip, const sp<AaptAssets>& assets);
53
54extern status_t filterResources(Bundle* bundle, const sp<AaptAssets>& assets);
55
56int dumpResources(Bundle* bundle);
57
Joe Onorato1553c822009-08-30 13:36:22 -070058String8 getAttribute(const ResXMLTree& tree, const char* ns,
59 const char* attr, String8* outError);
60
Josiah Gaskin03589cc2011-06-27 16:26:02 -070061status_t writeDependencyPreReqs(Bundle* bundle, const sp<AaptAssets>& assets,
62 FILE* fp, bool includeRaw);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063#endif // __MAIN_H