summaryrefslogtreecommitdiffstats
path: root/libdex
diff options
context:
space:
mode:
authorCarl Shapiro <cshapiro@google.com>2011-04-12 19:14:06 -0700
committerCarl Shapiro <cshapiro@google.com>2011-04-12 19:14:06 -0700
commitdb0c9549818d9f6e508d26e45ff9d886802aa1da (patch)
treec03b73dd265520edf1d71c003ad6e689cc2240f8 /libdex
parenta584c50f374d8ba60f306772ff9cc4c46fb5ecf8 (diff)
downloadandroid_dalvik-db0c9549818d9f6e508d26e45ff9d886802aa1da.tar.gz
android_dalvik-db0c9549818d9f6e508d26e45ff9d886802aa1da.tar.bz2
android_dalvik-db0c9549818d9f6e508d26e45ff9d886802aa1da.zip
Convert the internal and in-line natives to C++.
Change-Id: I2ece682bc3b4d3b55ab27c60fd84a0b3243d7ca6
Diffstat (limited to 'libdex')
-rw-r--r--libdex/CmdUtils.h8
-rw-r--r--libdex/DexCatch.h8
-rw-r--r--libdex/DexClass.h8
-rw-r--r--libdex/DexDataMap.h8
-rw-r--r--libdex/DexFile.h8
-rw-r--r--libdex/DexOpcodes.h8
-rw-r--r--libdex/DexOptData.h8
-rw-r--r--libdex/DexProto.h8
-rw-r--r--libdex/DexUtf.h8
-rw-r--r--libdex/InstrUtils.h8
-rw-r--r--libdex/Leb128.h8
-rw-r--r--libdex/ZipArchive.h7
-rw-r--r--libdex/sha1.h8
13 files changed, 102 insertions, 1 deletions
diff --git a/libdex/CmdUtils.h b/libdex/CmdUtils.h
index 7a8528710..3f05affe8 100644
--- a/libdex/CmdUtils.h
+++ b/libdex/CmdUtils.h
@@ -31,6 +31,10 @@
#ifndef _LIBDEX_CMDUTILS
#define _LIBDEX_CMDUTILS
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* encode the result of unzipping to a file */
typedef enum UnzipToFileResult {
kUTFRSuccess = 0,
@@ -70,4 +74,8 @@ UnzipToFileResult dexOpenAndMap(const char* fileName, const char* tempFileName,
UnzipToFileResult dexUnzipToFile(const char* zipFileName,
const char* outFileName, bool quiet);
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_LIBDEX_CMDUTILS*/
diff --git a/libdex/DexCatch.h b/libdex/DexCatch.h
index c0eec7c57..7c40bc57c 100644
--- a/libdex/DexCatch.h
+++ b/libdex/DexCatch.h
@@ -24,6 +24,10 @@
#include "DexFile.h"
#include "Leb128.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Catch handler entry, used while iterating over catch_handler_items.
*/
@@ -159,4 +163,8 @@ DEX_INLINE bool dexFindCatchHandler(DexCatchIterator *pIterator,
}
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/libdex/DexClass.h b/libdex/DexClass.h
index 3d1e11be5..6003fcf2f 100644
--- a/libdex/DexClass.h
+++ b/libdex/DexClass.h
@@ -24,6 +24,10 @@
#include "DexFile.h"
#include "Leb128.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* expanded form of a class_data_item header */
typedef struct DexClassDataHeader {
u4 staticFieldsSize;
@@ -159,4 +163,8 @@ DEX_INLINE void dexReadClassDataMethod(const u1** pData, DexMethod* pMethod,
*lastIndex = index;
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/libdex/DexDataMap.h b/libdex/DexDataMap.h
index fa556d5aa..654933c54 100644
--- a/libdex/DexDataMap.h
+++ b/libdex/DexDataMap.h
@@ -23,6 +23,10 @@
#include "DexFile.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct DexDataMap {
u4 count; /* number of items currently in the map */
u4 max; /* maximum number of items that may be held */
@@ -70,4 +74,8 @@ DEX_INLINE bool dexDataMapVerify0Ok(DexDataMap* map, u4 offset, u2 type) {
return dexDataMapVerify(map, offset, type);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_LIBDEX_DEXDATAMAP*/
diff --git a/libdex/DexFile.h b/libdex/DexFile.h
index 45f9a9119..66522863f 100644
--- a/libdex/DexFile.h
+++ b/libdex/DexFile.h
@@ -36,6 +36,10 @@
#include "vm/Common.h" // basic type defs, e.g. u1/u2/u4/u8, and LOG
#include "libdex/SysUtil.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* gcc-style inline management -- ensures we have a copy of all functions
* in the library, so code that links against us will work whether or not
@@ -960,4 +964,8 @@ const char* dexGetBoxedTypeDescriptor(PrimitiveType type);
*/
PrimitiveType dexGetPrimitiveTypeFromDescriptorChar(char descriptorChar);
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_LIBDEX_DEXFILE*/
diff --git a/libdex/DexOpcodes.h b/libdex/DexOpcodes.h
index 07188b2d0..68b849868 100644
--- a/libdex/DexOpcodes.h
+++ b/libdex/DexOpcodes.h
@@ -30,6 +30,10 @@
#include "DexFile.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* kMaxOpcodeValue: the highest possible raw (unpacked) opcode value
*
@@ -1133,4 +1137,8 @@ DEX_INLINE Opcode dexOpcodeFromCodeUnit(u2 codeUnit) {
*/
const char* dexGetOpcodeName(Opcode op);
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_LIBDEX_DEXOPCODES*/
diff --git a/libdex/DexOptData.h b/libdex/DexOptData.h
index 69eda0142..562553df0 100644
--- a/libdex/DexOptData.h
+++ b/libdex/DexOptData.h
@@ -24,6 +24,10 @@
#include "libdex/DexFile.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Parse the optimized data tables in the given dex file.
*
@@ -39,4 +43,8 @@ bool dexParseOptData(const u1* data, size_t length, DexFile* pDexFile);
*/
u4 dexComputeOptChecksum(const DexOptHeader* pOptHeader);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* def _LIBDEX_DEXOPTDATA */
diff --git a/libdex/DexProto.h b/libdex/DexProto.h
index 50d4bf330..a300d3fde 100644
--- a/libdex/DexProto.h
+++ b/libdex/DexProto.h
@@ -23,6 +23,10 @@
#include "DexFile.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Single-thread single-string cache. This structure holds a pointer to
* a string which is semi-automatically manipulated by some of the
@@ -226,6 +230,8 @@ u4 dexParameterIteratorNextIndex(DexParameterIterator* pIterator);
const char* dexParameterIteratorNextDescriptor(
DexParameterIterator* pIterator);
-
+#ifdef __cplusplus
+}
+#endif
#endif /*_LIBDEX_DEXPROTO*/
diff --git a/libdex/DexUtf.h b/libdex/DexUtf.h
index a7eb28ceb..88d98b011 100644
--- a/libdex/DexUtf.h
+++ b/libdex/DexUtf.h
@@ -23,6 +23,10 @@
#include "DexFile.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Retrieve the next UTF-16 character from a UTF-8 string.
*
@@ -128,4 +132,8 @@ bool dexIsClassDescriptor(const char* s);
* is for anything but "void". */
bool dexIsFieldDescriptor(const char* s);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* def _LIBDEX_DEXUTF */
diff --git a/libdex/InstrUtils.h b/libdex/InstrUtils.h
index f09429cf0..88804cf24 100644
--- a/libdex/InstrUtils.h
+++ b/libdex/InstrUtils.h
@@ -23,6 +23,10 @@
#include "DexFile.h"
#include "DexOpcodes.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Possible instruction formats associated with Dalvik opcodes.
*
@@ -198,4 +202,8 @@ DEX_INLINE InstructionIndexType dexGetIndexTypeFromOpcode(Opcode opcode)
*/
void dexDecodeInstruction(const u2* insns, DecodedInstruction* pDec);
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_LIBDEX_INSTRUTILS*/
diff --git a/libdex/Leb128.h b/libdex/Leb128.h
index 41799fe5e..3287c1623 100644
--- a/libdex/Leb128.h
+++ b/libdex/Leb128.h
@@ -23,6 +23,10 @@
#include "DexFile.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Reads an unsigned LEB128 value, updating the given pointer to point
* just past the end of the read value. This function tolerates
@@ -161,4 +165,8 @@ DEX_INLINE int unsignedLeb128Size(u4 data)
return count;
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/libdex/ZipArchive.h b/libdex/ZipArchive.h
index bf4edf972..872ceedb2 100644
--- a/libdex/ZipArchive.h
+++ b/libdex/ZipArchive.h
@@ -23,6 +23,9 @@
#include "SysUtil.h"
#include "DexFile.h" // need DEX_INLINE
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* Trivial typedef to ensure that ZipEntry is not treated as a simple
@@ -179,4 +182,8 @@ int dexZipExtractEntryToFile(const ZipArchive* pArchive,
u4 dexInitCrc32(void);
u4 dexComputeCrc32(u4 crc, const void* buf, size_t len);
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_LIBDEX_ZIPARCHIVE*/
diff --git a/libdex/sha1.h b/libdex/sha1.h
index 65cf667cd..0cef6234b 100644
--- a/libdex/sha1.h
+++ b/libdex/sha1.h
@@ -4,6 +4,10 @@
#ifndef _DALVIK_SHA1
#define _DALVIK_SHA1
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
unsigned long state[5];
unsigned long count[2];
@@ -17,4 +21,8 @@ void SHA1Update(SHA1_CTX* context, const unsigned char* data,
unsigned long len);
void SHA1Final(unsigned char digest[HASHSIZE], SHA1_CTX* context);
+#ifdef __cplusplus
+}
+#endif
+
#endif /*_DALVIK_SHA1*/