diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:28:47 -0800 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 19:28:47 -0800 |
| commit | f6c387128427e121477c1b32ad35cdcaa5101ba3 (patch) | |
| tree | 2aa25fa8c8c3a9caeecf98fd8ac4cd9b12717997 /vm/RawDexFile.h | |
| parent | f72d5de56a522ac3be03873bdde26f23a5eeeb3c (diff) | |
| download | android_dalvik-f6c387128427e121477c1b32ad35cdcaa5101ba3.tar.gz android_dalvik-f6c387128427e121477c1b32ad35cdcaa5101ba3.tar.bz2 android_dalvik-f6c387128427e121477c1b32ad35cdcaa5101ba3.zip | |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'vm/RawDexFile.h')
| -rw-r--r-- | vm/RawDexFile.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/vm/RawDexFile.h b/vm/RawDexFile.h new file mode 100644 index 000000000..b7c5b331b --- /dev/null +++ b/vm/RawDexFile.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * This represents a "raw" unswapped, unoptimized DEX file. We don't open + * them directly, except to create the optimized version that we tuck in + * the cache area. + */ +#ifndef _DALVIK_RAWDEXFILE +#define _DALVIK_RAWDEXFILE + +/* + * Structure representing a "raw" DEX file, in its unswapped unoptimized + * state. + */ +typedef struct RawDexFile { + char* cacheFileName; + DvmDex* pDvmDex; +} RawDexFile; + +/* + * Open a raw ".dex" file, optimize it, and load it. + * + * On success, returns 0 and sets "*ppDexFile" to a newly-allocated DexFile. + * On failure, returns a meaningful error code [currently just -1]. + */ +int dvmRawDexFileOpen(const char* fileName, const char* odexOutputName, + RawDexFile** ppDexFile, bool isBootstrap); + +/* + * Free a RawDexFile structure, along with any associated structures. + */ +void dvmRawDexFileFree(RawDexFile* pRawDexFile); + +/* + * Pry the DexFile out of a RawDexFile. + */ +INLINE DvmDex* dvmGetRawDexFileDex(RawDexFile* pRawDexFile) { + return pRawDexFile->pDvmDex; +} + +/* get full path of optimized DEX file */ +INLINE const char* dvmGetRawDexFileCacheFileName(RawDexFile* pRawDexFile) { + return pRawDexFile->cacheFileName; +} + +#endif /*_DALVIK_RAWDEXFILE*/ |
