├── 0_build-debug.bat ├── 0_build-prod.bat ├── 0_setname.bsh ├── 1_aapt.bsh ├── 2_compile-main.bsh ├── 3_dx.bsh ├── AndroidManifest.xml ├── JavaIDEdroid.jip ├── README.TXT ├── _ToDo.txt ├── bsh-samples ├── 0_build.bsh ├── 1_aapt.bat ├── 2_compile-main.bsh ├── 3_dx.bsh ├── 4_apkbuilder.bsh └── 5_signjar.bsh ├── build.bsh ├── gen └── com │ └── t_arn │ └── JavaIDEdroid │ ├── R.java │ └── R.java.ori ├── jni ├── Android.mk ├── Application.mk ├── JNImain.c ├── _dependencies.txt ├── aapt │ ├── README.TXT │ ├── jni │ │ ├── AaptAssets.cpp │ │ ├── AaptAssets.h │ │ ├── Android.mk │ │ ├── Android.mk.original │ │ ├── Application.mk │ │ ├── Bundle.h │ │ ├── Command.cpp │ │ ├── Images.cpp │ │ ├── Images.h │ │ ├── Main.cpp │ │ ├── Main.h │ │ ├── Package.cpp │ │ ├── Resource.cpp │ │ ├── ResourceTable.cpp │ │ ├── ResourceTable.h │ │ ├── SourcePos.cpp │ │ ├── SourcePos.h │ │ ├── StringPool.cpp │ │ ├── StringPool.h │ │ ├── XMLNode.cpp │ │ ├── XMLNode.h │ │ ├── ZipEntry.cpp │ │ ├── ZipEntry.h │ │ ├── ZipFile.cpp │ │ ├── ZipFile.h │ │ ├── printapk.cpp │ │ └── tests │ │ │ └── plurals │ │ │ ├── AndroidManifest.xml │ │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ │ └── run.sh │ ├── ndk-build.sh │ └── source.txt ├── expat │ ├── jni │ │ ├── Android.mk │ │ ├── Android.mk.original │ │ ├── Changes │ │ ├── CleanSpec.mk │ │ ├── MANIFEST │ │ ├── MODULE_LICENSE_BSD_LIKE │ │ ├── Makefile.in │ │ ├── NOTICE │ │ ├── README │ │ ├── ThirdPartyProject.prop │ │ ├── configure │ │ ├── configure.in │ │ ├── expat.dsw │ │ ├── expat_config.h │ │ ├── expat_config.h.in │ │ └── lib │ │ │ ├── Makefile.MPW │ │ │ ├── amigaconfig.h │ │ │ ├── ascii.h │ │ │ ├── asciitab.h │ │ │ ├── expat.dsp │ │ │ ├── expat.h │ │ │ ├── expat_config.h │ │ │ ├── expat_external.h │ │ │ ├── expat_static.dsp │ │ │ ├── expatw.dsp │ │ │ ├── expatw_static.dsp │ │ │ ├── iasciitab.h │ │ │ ├── internal.h │ │ │ ├── latin1tab.h │ │ │ ├── libexpat.def │ │ │ ├── libexpatw.def │ │ │ ├── macconfig.h │ │ │ ├── nametab.h │ │ │ ├── utf8tab.h │ │ │ ├── winconfig.h │ │ │ ├── xmlparse.c │ │ │ ├── xmlrole.c │ │ │ ├── xmlrole.h │ │ │ ├── xmltok.c │ │ │ ├── xmltok.h │ │ │ ├── xmltok_impl.c │ │ │ ├── xmltok_impl.h │ │ │ └── xmltok_ns.c │ ├── ndk-build.sh │ └── source.txt ├── libcutils │ ├── jni │ │ ├── Android.mk │ │ ├── Android.mk.original │ │ ├── Application.mk │ │ ├── MODULE_LICENSE_APACHE2 │ │ ├── NOTICE │ │ ├── abort_socket.c │ │ ├── arch-arm │ │ │ └── memset32.S │ │ ├── arch-x86 │ │ │ ├── android_memset16.S │ │ │ ├── android_memset32.S │ │ │ ├── cache_wrapper.S │ │ │ ├── sse2-memset16-atom.S │ │ │ └── sse2-memset32-atom.S │ │ ├── array.c │ │ ├── ashmem-dev.c │ │ ├── ashmem-host.c │ │ ├── atomic-android-sh.c │ │ ├── atomic.c │ │ ├── buffer.c │ │ ├── buffer.h │ │ ├── config_utils.c │ │ ├── cpu_info.c │ │ ├── dir_hash.c │ │ ├── dlmalloc_stubs.c │ │ ├── hashmap.c │ │ ├── include │ │ │ ├── acc │ │ │ │ └── acc.h │ │ │ ├── android │ │ │ │ └── log.h │ │ │ ├── arch │ │ │ │ ├── darwin-x86 │ │ │ │ │ └── AndroidConfig.h │ │ │ │ ├── freebsd-x86 │ │ │ │ │ └── AndroidConfig.h │ │ │ │ ├── linux-arm │ │ │ │ │ └── AndroidConfig.h │ │ │ │ ├── linux-ppc │ │ │ │ │ └── AndroidConfig.h │ │ │ │ ├── linux-sh │ │ │ │ │ └── AndroidConfig.h │ │ │ │ ├── linux-x86 │ │ │ │ │ └── AndroidConfig.h │ │ │ │ ├── target_linux-x86 │ │ │ │ │ └── AndroidConfig.h │ │ │ │ └── windows │ │ │ │ │ └── AndroidConfig.h │ │ │ ├── ctest │ │ │ │ └── ctest.h │ │ │ ├── cutils │ │ │ │ ├── abort_socket.h │ │ │ │ ├── array.h │ │ │ │ ├── ashmem.h │ │ │ │ ├── atomic-arm.h │ │ │ │ ├── atomic-inline.h │ │ │ │ ├── atomic-x86.h │ │ │ │ ├── atomic.h │ │ │ │ ├── bitops.h │ │ │ │ ├── compiler.h │ │ │ │ ├── config_utils.h │ │ │ │ ├── cpu_info.h │ │ │ │ ├── dir_hash.h │ │ │ │ ├── event_tag_map.h │ │ │ │ ├── hashmap.h │ │ │ │ ├── iosched_policy.h │ │ │ │ ├── jstring.h │ │ │ │ ├── log.h │ │ │ │ ├── logd.h │ │ │ │ ├── logger.h │ │ │ │ ├── logprint.h │ │ │ │ ├── memory.h │ │ │ │ ├── misc.h │ │ │ │ ├── mq.h │ │ │ │ ├── mspace.h │ │ │ │ ├── native_handle.h │ │ │ │ ├── open_memstream.h │ │ │ │ ├── process_name.h │ │ │ │ ├── properties.h │ │ │ │ ├── record_stream.h │ │ │ │ ├── sched_policy.h │ │ │ │ ├── selector.h │ │ │ │ ├── sockets.h │ │ │ │ ├── str_parms.h │ │ │ │ ├── threads.h │ │ │ │ ├── tztime.h │ │ │ │ ├── uevent.h │ │ │ │ ├── uio.h │ │ │ │ └── zygote.h │ │ │ ├── diskconfig │ │ │ │ └── diskconfig.h │ │ │ ├── mincrypt │ │ │ │ ├── rsa.h │ │ │ │ └── sha.h │ │ │ ├── netutils │ │ │ │ ├── dhcp.h │ │ │ │ └── ifc.h │ │ │ ├── pixelflinger │ │ │ │ ├── format.h │ │ │ │ └── pixelflinger.h │ │ │ ├── private │ │ │ │ ├── android_filesystem_config.h │ │ │ │ └── pixelflinger │ │ │ │ │ ├── ggl_context.h │ │ │ │ │ └── ggl_fixed.h │ │ │ ├── system │ │ │ │ └── audio.h │ │ │ ├── sysutils │ │ │ │ ├── FrameworkClient.h │ │ │ │ ├── FrameworkCommand.h │ │ │ │ ├── FrameworkListener.h │ │ │ │ ├── NetlinkEvent.h │ │ │ │ ├── NetlinkListener.h │ │ │ │ ├── ServiceManager.h │ │ │ │ ├── SocketClient.h │ │ │ │ └── SocketListener.h │ │ │ └── zipfile │ │ │ │ └── zipfile.h │ │ ├── iosched_policy.c │ │ ├── load_file.c │ │ ├── loghack.h │ │ ├── memory.c │ │ ├── mq.c │ │ ├── mspace.c │ │ ├── native_handle.c │ │ ├── open_memstream.c │ │ ├── private.h │ │ ├── process_name.c │ │ ├── properties.c │ │ ├── record_stream.c │ │ ├── sched_policy.c │ │ ├── selector.c │ │ ├── socket_inaddr_any_server.c │ │ ├── socket_local.h │ │ ├── socket_local_client.c │ │ ├── socket_local_server.c │ │ ├── socket_loopback_client.c │ │ ├── socket_loopback_server.c │ │ ├── socket_network_client.c │ │ ├── str_parms.c │ │ ├── strdup16to8.c │ │ ├── strdup8to16.c │ │ ├── threads.c │ │ ├── tzfile.h │ │ ├── tzstrftime.c │ │ ├── tztime.c │ │ ├── uevent.c │ │ ├── uio.c │ │ └── zygote.c │ ├── ndk-build.sh │ └── source.txt ├── libhost │ ├── jni │ │ ├── Android.mk │ │ ├── Android.mk.original │ │ ├── Application.mk │ │ ├── CopyFile.c │ │ ├── include │ │ │ └── host │ │ │ │ ├── CopyFile.h │ │ │ │ ├── Directories.h │ │ │ │ └── pseudolocalize.h │ │ ├── list.java │ │ └── pseudolocalize.cpp │ ├── ndk-build.sh │ └── source.txt ├── liblog │ ├── jni │ │ ├── Android.mk │ │ ├── Android.mk.original │ │ ├── Application.mk │ │ ├── NOTICE │ │ ├── event_tag_map.c │ │ ├── fake_log_device.c │ │ ├── logd_write.c │ │ └── logprint.c │ ├── ndk-build.sh │ └── source.txt ├── libpng │ ├── jni │ │ ├── ANNOUNCE │ │ ├── Android.mk │ │ ├── Android.mk.original │ │ ├── CHANGES │ │ ├── CMakeLists.txt │ │ ├── CleanSpec.mk │ │ ├── INSTALL │ │ ├── KNOWNBUG │ │ ├── LICENSE │ │ ├── MODULE_LICENSE_BSD_LIKE │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── NOTICE │ │ ├── README │ │ ├── TODO │ │ ├── ThirdPartyProject.prop │ │ ├── Y2KINFO │ │ ├── aclocal.m4 │ │ ├── autogen.sh │ │ ├── config.guess │ │ ├── config.h.in │ │ ├── config.sub │ │ ├── configure │ │ ├── configure.ac │ │ ├── depcomp │ │ ├── example.c │ │ ├── install-sh │ │ ├── libpng-1.2.44.txt │ │ ├── libpng.3 │ │ ├── libpngpf.3 │ │ ├── ltmain.sh │ │ ├── missing │ │ ├── mkinstalldirs │ │ ├── png.5 │ │ ├── png.c │ │ ├── png.h │ │ ├── pngbar.jpg │ │ ├── pngbar.png │ │ ├── pngconf.h │ │ ├── pngerror.c │ │ ├── pnggccrd.c │ │ ├── pngget.c │ │ ├── pngmem.c │ │ ├── pngnow.png │ │ ├── pngpread.c │ │ ├── pngread.c │ │ ├── pngrio.c │ │ ├── pngrtran.c │ │ ├── pngrutil.c │ │ ├── pngset.c │ │ ├── pngtest.c │ │ ├── pngtest.png │ │ ├── pngtrans.c │ │ ├── pngusr.h │ │ ├── pngvcrd.c │ │ ├── pngwio.c │ │ ├── pngwrite.c │ │ ├── pngwtran.c │ │ ├── pngwutil.c │ │ └── test-pngtest.sh │ ├── ndk-build.sh │ └── source.txt ├── libutils │ ├── README.TXT │ ├── jni │ │ ├── Android.mk │ │ ├── Android.mk.original │ │ ├── Application.mk │ │ ├── Asset.cpp │ │ ├── AssetDir.cpp │ │ ├── AssetManager.cpp │ │ ├── BackupData.cpp │ │ ├── BackupHelpers.cpp │ │ ├── BufferedTextOutput.cpp │ │ ├── CallStack.cpp │ │ ├── Debug.cpp │ │ ├── FileMap.cpp │ │ ├── Flattenable.cpp │ │ ├── Looper.cpp │ │ ├── MODULE_LICENSE_APACHE2 │ │ ├── NOTICE │ │ ├── ObbFile.cpp │ │ ├── Pool.cpp │ │ ├── README │ │ ├── RefBase.cpp │ │ ├── ResourceTypes.cpp │ │ ├── SharedBuffer.cpp │ │ ├── Static.cpp │ │ ├── StopWatch.cpp │ │ ├── StreamingZipInflater.cpp │ │ ├── String16.cpp │ │ ├── String8.cpp │ │ ├── StringArray.cpp │ │ ├── SystemClock.cpp │ │ ├── TextOutput.cpp │ │ ├── Threads.cpp │ │ ├── Timers.cpp │ │ ├── VectorImpl.cpp │ │ ├── ZipFileCRO.cpp │ │ ├── ZipFileRO.cpp │ │ ├── ZipUtils.cpp │ │ ├── include │ │ │ ├── private │ │ │ │ └── utils │ │ │ │ │ └── Static.h │ │ │ └── utils │ │ │ │ ├── Asset.h │ │ │ │ ├── AssetDir.h │ │ │ │ ├── AssetManager.h │ │ │ │ ├── Atomic.h │ │ │ │ ├── BackupHelpers.h │ │ │ │ ├── BitSet.h │ │ │ │ ├── BufferedTextOutput.h │ │ │ │ ├── ByteOrder.h │ │ │ │ ├── CallStack.h │ │ │ │ ├── Debug.h │ │ │ │ ├── Endian.h │ │ │ │ ├── Errors.h │ │ │ │ ├── FileMap.h │ │ │ │ ├── Flattenable.h │ │ │ │ ├── Functor.h │ │ │ │ ├── KeyedVector.h │ │ │ │ ├── List.h │ │ │ │ ├── Log.h │ │ │ │ ├── Looper.h │ │ │ │ ├── ObbFile.h │ │ │ │ ├── Pool.h │ │ │ │ ├── RefBase.h │ │ │ │ ├── ResourceTypes.h │ │ │ │ ├── SharedBuffer.h │ │ │ │ ├── Singleton.h │ │ │ │ ├── SortedVector.h │ │ │ │ ├── StopWatch.h │ │ │ │ ├── StreamingZipInflater.h │ │ │ │ ├── String16.h │ │ │ │ ├── String8.h │ │ │ │ ├── StringArray.h │ │ │ │ ├── SystemClock.h │ │ │ │ ├── TextOutput.h │ │ │ │ ├── Timers.h │ │ │ │ ├── TypeHelpers.h │ │ │ │ ├── Vector.h │ │ │ │ ├── VectorImpl.h │ │ │ │ ├── ZipFileCRO.h │ │ │ │ ├── ZipFileRO.h │ │ │ │ ├── ZipUtils.h │ │ │ │ ├── ashmem.h │ │ │ │ ├── misc.h │ │ │ │ └── threads.h │ │ └── misc.cpp │ ├── ndk-build.sh │ └── source.txt ├── materials │ ├── Android.mkDocumentation.pdf │ ├── JNI-objtypes.html │ ├── aapt-port-android_1-0-0.zip │ ├── linking_existing_static_lib.txt │ ├── making_static_lib.txt │ ├── multi_android_mk.txt │ ├── redirection.txt │ └── stringSplit.c └── zlib │ ├── README.TXT │ └── source.txt ├── libs ├── armeabi │ └── libaaptcomplete.so ├── bsh.jar ├── dx_ta.jar ├── ecj.jar ├── sdklib_ta.jar └── zipsigner-lib_all.jar ├── materials ├── dx │ └── dx_ta_src.zip └── sdklib │ └── sdklib_ta_src.zip ├── ndk-build-aaptcomplete.sh ├── res ├── drawable-hdpi │ ├── ic_menu_login.png │ ├── ic_menu_money.png │ └── icon.png ├── drawable-ldpi │ └── icon.png ├── drawable-mdpi │ ├── ic_menu_close_clear_cancel.png │ ├── ic_menu_login.png │ ├── ic_menu_money.png │ └── icon.png ├── drawable │ ├── ic_launcher_folder.png │ └── ic_launcher_folder_small.png ├── layout │ ├── filebrowserlist.xml │ ├── filelist_item.xml │ ├── help.xml │ ├── info.xml │ ├── main.xml │ ├── password.xml │ └── upgrade.xml ├── menu │ └── mainmenu.xml ├── raw-de │ ├── help.html │ └── upgrade.html ├── raw │ ├── help.html │ └── upgrade.html ├── values-de │ ├── arrays.xml │ └── strings.xml ├── values │ ├── arrays.xml │ └── strings.xml └── xml │ └── settings.xml └── src └── com └── t_arn ├── JavaIDEdroid ├── Aapt.java ├── BeanShellTask.java ├── FileBrowserActivity.java ├── G.java ├── HelpActivity.java ├── IDE.java ├── InfoActivity.java ├── MainActivity.java ├── PasswordActivity.java ├── SettingActivity.java ├── SignApk.java ├── ToolTask.java └── UpgradeActivity.java └── lib └── io ├── FileBrowser.java ├── StringWriterOutputStream.java └── taGetOpt.java /0_setname.bsh: -------------------------------------------------------------------------------- 1 | // Beanshell script 2 | name = "JavaIDEdroid"; 3 | -------------------------------------------------------------------------------- /1_aapt.bsh: -------------------------------------------------------------------------------- 1 | 2 | // BeanShell aapt script for JavaIDEdroid 3 | // 4 | 5 | stScriptPath = dirname(pathToFile(getSourceFileInfo()).getAbsolutePath())+"/"; 6 | stScriptPath=stScriptPath.replace('\\','/'); 7 | 8 | source (stScriptPath+"0_setname.bsh"); 9 | outdir=stScriptPath+"bin/test/"+name; 10 | System.out.println("***** Calling Aapt ..."); 11 | G.bshTask.fnPublishProgress("Running Aapt..."); 12 | 13 | args = "p -m -J "+stScriptPath+"gen"; 14 | args += " -M "+stScriptPath+"AndroidManifest.xml"; 15 | args += " -v -S "+stScriptPath+"res"; 16 | args += " -I /sdcard/!Programme/win32/Programs/android-sdk/platforms/android-8/android.jar"; 17 | args += " -f -F "+outdir+"/"+name+".apk.res"; 18 | G.iScriptResultCode = G.ide.fnAapt(args); 19 | 20 | if (G.iScriptResultCode>0) G.bshTask.fnToast("aapt failed!",10000); 21 | -------------------------------------------------------------------------------- /2_compile-main.bsh: -------------------------------------------------------------------------------- 1 | 2 | // BeanShell compile script for JavaIDEdroid 3 | // 4 | // The global class G of JavaIDEdroid is 5 | // mapped to the bsh variable G 6 | // 7 | 8 | stScriptPath = dirname(pathToFile(getSourceFileInfo()).getAbsolutePath())+"/"; 9 | stScriptPath = stScriptPath.replace('\\','/'); 10 | 11 | source (stScriptPath+"0_setname.bsh"); 12 | outdir=stScriptPath+"bin/test/"+name; 13 | stJavafile = "src/com/t_arn/"+name+"/MainActivity.java"; 14 | 15 | System.out.println("***** Compiling "+stJavafile+" ..."); 16 | G.bshTask.fnPublishProgress("Compiling..."); 17 | 18 | args = "-verbose -deprecation -extdirs \"\" -1.5"; 19 | args += " -bootclasspath "+G.oSet.stAndroidJarPath+":"+stScriptPath+"libs/ecj.jar:"+stScriptPath+"libs/dx_ta.jar:"+stScriptPath+"libs/bsh.jar:"+stScriptPath+"libs/sdklib_ta.jar:"+stScriptPath+"libs/androidprefs.jar:"+stScriptPath+"libs/zipsigner-lib_all.jar"; 20 | args += " -classpath "+stScriptPath+"src"; 21 | args +=":"+stScriptPath+"gen"; 22 | args += " -d "+outdir; 23 | args += " "+stScriptPath+stJavafile; 24 | G.iScriptResultCode = G.ide.fnCompile(args); 25 | 26 | if (G.iScriptResultCode>=2) G.bshTask.fnToast("Compilation failed!",10000); 27 | else if (G.iScriptResultCode==1) G.bshTask.fnToast("Compilation with warnings",10000); 28 | else G.bshTask.fnToast("Compilation succeeded.",10000); 29 | -------------------------------------------------------------------------------- /3_dx.bsh: -------------------------------------------------------------------------------- 1 | 2 | // BeanShell compile script for JavaIDEdroid 3 | // 4 | // The global class G of JavaIDEdroid is 5 | // mapped to the bsh variable G 6 | // 7 | 8 | stScriptPath = dirname(pathToFile(getSourceFileInfo()).getAbsolutePath())+"/"; 9 | stScriptPath=stScriptPath.replace('\\','/'); 10 | 11 | source (stScriptPath+"0_setname.bsh"); 12 | outdir=stScriptPath+"bin/test/"+name; 13 | 14 | System.out.println("***** Calling dx ..."); 15 | G.bshTask.fnPublishProgress("Running dx..."); 16 | 17 | args = "--dex --output="+outdir+"/classes.dex"; 18 | args += " "+outdir; 19 | args += " "+stScriptPath+"libs"; 20 | G.iScriptResultCode = G.ide.fnDx(args); 21 | 22 | if (G.iScriptResultCode>0) G.bshTask.fnToast("dx failed!",10000); 23 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 35 | 38 | 41 | 44 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /JavaIDEdroid.jip: -------------------------------------------------------------------------------- 1 | {"stMainJava":"src\/com\/t_arn\/JavaIDEdroid\/MainActivity.java","stName":"JavaIDEdroid","stLibsDir":"libs\/","stAssetsDir":"","stExcludeDirs":"\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/Archiv\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/bsh-samples\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/gen\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/jni\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/libs\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/materials\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/obj\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/out\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/drawable-hdpi\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/drawable-ldpi\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/drawable-mdpi\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/drawable\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/layout\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/menu\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/raw-de\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/raw\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/values-de\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/values\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/res\/xml\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/src\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/src\/com\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/src\/com\/t_arn\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/src\/com\/t_arn\/JavaIDEdroid\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/src\/com\/t_arn\/lib\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/src\/com\/t_arn\/lib\/io\/.svn\/\t\/sdcard\/!Daten\/Android\/com\/t_arn\/JavaIDEdroid\/bin\/test\/JavaIDEdroid\/com\/","stAndroidJarPath":""} -------------------------------------------------------------------------------- /README.TXT: -------------------------------------------------------------------------------- 1 | How to build JavaIDEdroid 2 | ========================= 3 | 4 | 1. Adjust ndk-build-aaptcomplete.sh to call the ndk-build script of the Android NDK 5 | 6 | 2. Execute ndk-build-aaptcomplete.sh 7 | This step creates the shared library libaaptcomplete.so in libs/armeabi 8 | 9 | 3. Adjust 0_build-debug.bat and 0_build-prod.bat to match your environment. 10 | Adjust following variables: JSDK, ASDK, KS, KEY 11 | 12 | 4. Execute 0_build-debug.bat or 0_build-prod.bat and choose "do it all" 13 | This creates JavaIDEdroid.apk in out/test/JavaIDEdroid/ or out/production/JavaIDEdroid/ 14 | 15 | The slightly modified source code of dx (libs/dx_ta.jar) and sdklib (libs/sdklib_ta.jar) can be found in /materials/ 16 | 17 | Tom Arn, 2011-09-21 18 | -------------------------------------------------------------------------------- /_ToDo.txt: -------------------------------------------------------------------------------- 1 | ToDo 2 | ==== 3 | 4 | - add french language ? 5 | -------------------------------------------------------------------------------- /bsh-samples/0_build.bsh: -------------------------------------------------------------------------------- 1 | 2 | // BeanShell compile script 3 | // 4 | // The main activity of JavaIDEdroid is 5 | // mapped to the variable mainActivity 6 | // 7 | 8 | String stSourcePath = dirname(pathToFile(getSourceFileInfo()).getAbsolutePath())+"/"; 9 | String stSourcePath = stSourcePath.replace('\\','/'); 10 | int iResult = 0; 11 | 12 | System.out.println(""); 13 | source (stSourcePath+"2_compile-main.bsh"); 14 | 15 | if (iResult < 2) 16 | { 17 | System.out.println(""); 18 | source (stSourcePath+"3_dx.bsh"); 19 | } 20 | 21 | if (iResult == 0) 22 | { 23 | System.out.println(""); 24 | source (stSourcePath+"4_apkbuilder.bsh"); 25 | } 26 | 27 | if (iResult == 0) 28 | { 29 | System.out.println(""); 30 | source (stSourcePath+"5_signjar.bsh"); 31 | } 32 | -------------------------------------------------------------------------------- /bsh-samples/1_aapt.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem aapt atch for HelloAndroid 4 | rem 5 | :start 6 | cls 7 | echo aapt for HelloAndroid 8 | echo.====================== 9 | echo. 10 | 11 | rem set project name and directory and output directory 12 | set PNAME=HelloAndroid 13 | set PDIR=%~dp0 14 | set OUTDIR=%PDIR%out\test\%PNAME% 15 | 16 | rem change to project directory 17 | cd /d %PDIR% 18 | 19 | rem set android sdk tool dir 20 | set ANDROID_SDK_HOME=u:\Programs\android-sdk 21 | 22 | :aapt 23 | rem generate resource java code and packaged resources 24 | echo ***** Generating R.java and packaged resources ***** 25 | %ANDROID_SDK_HOME%\platform-tools\aapt p -m -J gen -M AndroidManifest.xml -S res -I %ANDROID_SDK_HOME%\platforms\android-8\android.jar -f -F %OUTDIR%\%PNAME%.apk.res 26 | pause 27 | 28 | -------------------------------------------------------------------------------- /bsh-samples/2_compile-main.bsh: -------------------------------------------------------------------------------- 1 | 2 | // BeanShell compile script 3 | // 4 | // The main activity of JavaIDEdroid is 5 | // mapped to the variable mainActivity 6 | // 7 | 8 | stSourcePath = dirname(pathToFile(getSourceFileInfo()).getAbsolutePath())+"/"; 9 | stSourcePath = stSourcePath.replace('\\','/'); 10 | 11 | name = "HelloAndroid"; 12 | stJavafile = "src/com/t_arn/HelloAndroid/MainActivity.java"; 13 | 14 | System.out.println("***** Compiling "+stJavafile+" ..."); 15 | mainActivity.bshTask.fnPublishProgress("Compiling..."); 16 | 17 | // mainActivity.bshTask.fnClear(); 18 | 19 | args = "-verbose -deprecation -extdirs \"\" -1.5"; 20 | args += " -bootclasspath /mnt/sdcard/!Programme/win32/Programs/android-sdk/platforms/android-8/android.jar"; 21 | args += " -classpath "+stSourcePath+"src"; 22 | args +=":"+stSourcePath+"gen"; 23 | args += " -d "+stSourcePath+"out/test/"+name; 24 | args += " "+stSourcePath+stJavafile; 25 | iResult = mainActivity.ide.fnCompile(args); 26 | 27 | if (iResult==0) mainActivity.bshTask.fnToast("Compilation succeeded!",10000); 28 | else mainActivity.bshTask.fnToast("Compilation failed!",10000); 29 | -------------------------------------------------------------------------------- /bsh-samples/3_dx.bsh: -------------------------------------------------------------------------------- 1 | 2 | // BeanShell dx script for JavaIDEdroid 3 | // 4 | // The main activity of JavaIDEdroid is 5 | // mapped to the variable mainActivity 6 | // 7 | 8 | stScriptPath = dirname(pathToFile(getSourceFileInfo()).getAbsolutePath())+"/"; 9 | stScriptPath=stScriptPath.replace('\\','/'); 10 | 11 | outdir=stScriptPath+"out/test/HelloAndroid"; 12 | 13 | print("***** Calling dx ..."); 14 | mainActivity.bshTask.fnPublishProgress("Running dx..."); 15 | 16 | args = "--dex --output="+outdir+"/classes.dex"; 17 | args += " "+outdir; 18 | // args += " "+stSourcePath+"libs\*.jar"; 19 | iResult = mainActivity.ide.fnDx(args); 20 | 21 | if (iResult==0) mainActivity.bshTask.fnToast("dx succeeded!",10000); 22 | else mainActivity.bshTask.fnToast("dx failed!",10000); 23 | -------------------------------------------------------------------------------- /bsh-samples/4_apkbuilder.bsh: -------------------------------------------------------------------------------- 1 | 2 | // BeanShell apkbuilder script for JavaIDEdroid 3 | // 4 | // The main activity of JavaIDEdroid is 5 | // mapped to the variable mainActivity 6 | // 7 | 8 | stScriptPath = dirname(pathToFile(getSourceFileInfo()).getAbsolutePath())+"/"; 9 | stScriptPath=stScriptPath.replace('\\','/'); 10 | 11 | name = "HelloAndroid"; 12 | outdir=stScriptPath+"out/test/"+name; 13 | print("***** Calling ApkBuilder ..."); 14 | mainActivity.bshTask.fnPublishProgress("Running Apkbuilder..."); 15 | 16 | args = outdir+"/"+name+".apk.unsigned"; 17 | args += " -u -z "+outdir+"/"+name+".apk.res"; // signing is not working with apkbuilder 18 | args += " -f "+outdir+"/classes.dex"; 19 | args += " -rf "+stScriptPath+"src"; 20 | // args += " -rj "+stSourcePath+"libs"; 21 | iResult = mainActivity.ide.fnApkBuilder(args); 22 | 23 | if (iResult==0) mainActivity.bshTask.fnToast("apkbuilder succeeded!",10000); 24 | else mainActivity.bshTask.fnToast("apkbuilder failed!",10000); 25 | -------------------------------------------------------------------------------- /bsh-samples/5_signjar.bsh: -------------------------------------------------------------------------------- 1 | 2 | // BeanShell signjar script for JavaIDEdroid 3 | // 4 | // The main activity of JavaIDEdroid is 5 | // mapped to the variable mainActivity 6 | // 7 | 8 | stScriptPath = dirname(pathToFile(getSourceFileInfo()).getAbsolutePath())+"/"; 9 | stScriptPath=stScriptPath.replace('\\','/'); 10 | 11 | name = "HelloAndroid"; 12 | outdir=stScriptPath+"out/test/"+name; 13 | print("***** Calling ZipSigner ..."); 14 | mainActivity.bshTask.fnPublishProgress("Running ZipSigner..."); 15 | 16 | args = "-M testkey"; 17 | args += " -I "+outdir+"/"+name+".apk.unsigned"; 18 | args += " -O "+outdir+"/"+name+".apk"; 19 | iResult = mainActivity.ide.fnSignApk(args); 20 | System.out.println("iResult = "+iResult); 21 | 22 | if (iResult==0) mainActivity.bshTask.fnToast("Signing succeeded!",10000); 23 | else mainActivity.bshTask.fnToast("Signing failed!",10000); 24 | -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | APP_PLATFORM := android-9 3 | -------------------------------------------------------------------------------- /jni/JNImain.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define DEBUG_TAG "JavaIDEdroid" 7 | 8 | // any underscore you use in a package/method name must 9 | // be translated into _1 on the native side. 10 | // So, com.t_arn.JavaIDEdroid becomes com_t_1arn_JavaIDEdroid 11 | 12 | //=================================================================== 13 | jint Java_com_t_1arn_JavaIDEdroid_Aapt_JNImain(JNIEnv * env, jobject this, jstring args) 14 | //=================================================================== 15 | { 16 | jboolean isCopy; 17 | const char * szArgs = (*env)->GetStringUTFChars(env, args, &isCopy); 18 | char *ptr1, *ptr2; 19 | int i, idx, argc=1, len; 20 | jint rc = 99; 21 | 22 | __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "Native method call: JNImain (%s)", szArgs); 23 | len=strlen(szArgs); 24 | for (i=0; i tags. 12 | 13 | Tom Arn, 2011-08-22 14 | -------------------------------------------------------------------------------- /jni/aapt/jni/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2006 The Android Open Source Project 3 | # 4 | # Android Asset Packaging Tool 5 | # 6 | 7 | LOCAL_PATH:= $(call my-dir) 8 | include $(CLEAR_VARS) 9 | 10 | LOCAL_SRC_FILES := \ 11 | StringPool.cpp \ 12 | ZipFile.cpp \ 13 | ZipEntry.cpp \ 14 | Images.cpp \ 15 | SourcePos.cpp \ 16 | ResourceTable.cpp \ 17 | Resource.cpp \ 18 | AaptAssets.cpp \ 19 | Main.cpp \ 20 | Package.cpp \ 21 | Command.cpp \ 22 | XMLNode.cpp \ 23 | 24 | LOCAL_CFLAGS += -Wno-format-y2k 25 | LOCAL_CFLAGS += -DHAVE_ENDIAN_H -DHAVE_ANDROID_OS -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP 26 | LOCAL_CFLAGS += -DHAVE_SCHED_H -DHAVE_SYS_UIO_H -DHAVE_IOCTL -DHAVE_TM_GMTOFF 27 | LOCAL_CFLAGS += -DHAVE_EXPAT_CONFIG_H 28 | 29 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../libpng/jni 30 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../expat/jni/lib 31 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../libhost/jni/include 32 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../libcutils/jni/include 33 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../libutils/jni/include 34 | 35 | ifeq ($(HOST_OS),linux) 36 | LOCAL_LDLIBS += -lrt -lpthread 37 | endif 38 | 39 | # Statically link libz for MinGW (Win SDK under Linux), 40 | # and dynamically link for all others. 41 | ifneq ($(strip $(USE_MINGW)),) 42 | LOCAL_STATIC_LIBRARIES += libz 43 | else 44 | LOCAL_LDLIBS += -lz -llog 45 | endif 46 | 47 | LOCAL_MODULE := aapt 48 | 49 | include $(BUILD_SHARED_LIBRARY) 50 | -------------------------------------------------------------------------------- /jni/aapt/jni/Android.mk.original: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2006 The Android Open Source Project 3 | # 4 | # Android Asset Packaging Tool 5 | # 6 | 7 | # This tool is prebuilt if we're doing an app-only build. 8 | ifeq ($(TARGET_BUILD_APPS),) 9 | 10 | LOCAL_PATH:= $(call my-dir) 11 | include $(CLEAR_VARS) 12 | 13 | LOCAL_SRC_FILES := \ 14 | AaptAssets.cpp \ 15 | Command.cpp \ 16 | Main.cpp \ 17 | Package.cpp \ 18 | StringPool.cpp \ 19 | XMLNode.cpp \ 20 | ResourceTable.cpp \ 21 | Images.cpp \ 22 | Resource.cpp \ 23 | SourcePos.cpp \ 24 | ZipEntry.cpp \ 25 | ZipFile.cpp 26 | 27 | 28 | LOCAL_CFLAGS += -Wno-format-y2k 29 | 30 | LOCAL_C_INCLUDES += external/expat/lib 31 | LOCAL_C_INCLUDES += external/libpng 32 | LOCAL_C_INCLUDES += external/zlib 33 | LOCAL_C_INCLUDES += build/libs/host/include 34 | 35 | #LOCAL_WHOLE_STATIC_LIBRARIES := 36 | LOCAL_STATIC_LIBRARIES := \ 37 | libhost \ 38 | libutils \ 39 | libcutils \ 40 | libexpat \ 41 | libpng 42 | 43 | ifeq ($(HOST_OS),linux) 44 | LOCAL_LDLIBS += -lrt -lpthread 45 | endif 46 | 47 | # Statically link libz for MinGW (Win SDK under Linux), 48 | # and dynamically link for all others. 49 | ifneq ($(strip $(USE_MINGW)),) 50 | LOCAL_STATIC_LIBRARIES += libz 51 | else 52 | LOCAL_LDLIBS += -lz 53 | endif 54 | 55 | LOCAL_MODULE := aapt 56 | 57 | include $(BUILD_HOST_EXECUTABLE) 58 | 59 | endif # TARGET_BUILD_APPS 60 | -------------------------------------------------------------------------------- /jni/aapt/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | APP_PLATFORM := android-9 3 | -------------------------------------------------------------------------------- /jni/aapt/jni/Images.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2006 The Android Open Source Project 3 | // 4 | // Build resource files from raw assets. 5 | // 6 | 7 | #ifndef IMAGES_H 8 | #define IMAGES_H 9 | 10 | #include "ResourceTable.h" 11 | 12 | status_t preProcessImage(Bundle* bundle, const sp& assets, 13 | const sp& file, String8* outNewLeafName); 14 | 15 | status_t postProcessImage(const sp& assets, 16 | ResourceTable* table, const sp& file); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /jni/aapt/jni/Main.h: -------------------------------------------------------------------------------- 1 | // 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 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "Bundle.h" 14 | #include "AaptAssets.h" 15 | #include "ZipFile.h" 16 | 17 | extern int doVersion(Bundle* bundle); 18 | extern int doList(Bundle* bundle); 19 | extern int doDump(Bundle* bundle); 20 | extern int doAdd(Bundle* bundle); 21 | extern int doRemove(Bundle* bundle); 22 | extern int doPackage(Bundle* bundle); 23 | 24 | extern int calcPercent(long uncompressedLen, long compressedLen); 25 | 26 | extern android::status_t writeAPK(Bundle* bundle, 27 | const sp& assets, 28 | const android::String8& outputFile); 29 | 30 | extern android::status_t buildResources(Bundle* bundle, 31 | const sp& assets); 32 | 33 | extern android::status_t writeResourceSymbols(Bundle* bundle, 34 | const sp& assets, const String8& pkgName, bool includePrivate); 35 | 36 | extern android::status_t writeProguardFile(Bundle* bundle, const sp& assets); 37 | 38 | extern bool isValidResourceType(const String8& type); 39 | 40 | ssize_t processAssets(Bundle* bundle, ZipFile* zip, const sp& assets); 41 | 42 | extern status_t filterResources(Bundle* bundle, const sp& assets); 43 | 44 | int dumpResources(Bundle* bundle); 45 | 46 | String8 getAttribute(const ResXMLTree& tree, const char* ns, 47 | const char* attr, String8* outError); 48 | 49 | #endif // __MAIN_H 50 | -------------------------------------------------------------------------------- /jni/aapt/jni/SourcePos.h: -------------------------------------------------------------------------------- 1 | // modified by Tom Arn, www.t-arn.com 2 | 3 | #ifndef SOURCEPOS_H 4 | #define SOURCEPOS_H 5 | 6 | #include 7 | #include 8 | 9 | using namespace android; 10 | 11 | class SourcePos 12 | { 13 | public: 14 | String8 file; 15 | int line; 16 | 17 | SourcePos(const String8& f, int l); 18 | SourcePos(const SourcePos& that); 19 | SourcePos(); 20 | ~SourcePos(); 21 | 22 | int error(const char* fmt, ...) const; 23 | int warning(const char* fmt, ...) const; 24 | 25 | static bool hasErrors(); 26 | static void printErrors(FILE* to); 27 | 28 | //ta 29 | static void clear(); 30 | // 31 | }; 32 | 33 | 34 | #endif // SOURCEPOS_H 35 | -------------------------------------------------------------------------------- /jni/aapt/jni/tests/plurals/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /jni/aapt/jni/tests/plurals/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | OK 3 | 4 | A dog 5 | Some dogs 6 | 7 | 8 | -------------------------------------------------------------------------------- /jni/aapt/jni/tests/plurals/run.sh: -------------------------------------------------------------------------------- 1 | TEST_DIR=tools/aapt/tests/plurals 2 | TEST_OUT_DIR=out/plurals_test 3 | 4 | rm -rf $TEST_OUT_DIR 5 | mkdir -p $TEST_OUT_DIR 6 | mkdir -p $TEST_OUT_DIR/java 7 | 8 | #gdb --args \ 9 | aapt package -v -x -m -z -J $TEST_OUT_DIR/java -M $TEST_DIR/AndroidManifest.xml \ 10 | -I out/target/common/obj/APPS/framework-res_intermediates/package-export.apk \ 11 | -P $TEST_OUT_DIR/public_resources.xml \ 12 | -S $TEST_DIR/res 13 | 14 | echo 15 | echo "==================== FILES CREATED ==================== " 16 | find $TEST_OUT_DIR -type f 17 | -------------------------------------------------------------------------------- /jni/aapt/ndk-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | export NDK_PROJECT_PATH=. 4 | /cygdrive/u/Programs/android-ndk/ndk-build 5 | -------------------------------------------------------------------------------- /jni/aapt/source.txt: -------------------------------------------------------------------------------- 1 | http://android.git.kernel.org/ 2 | 3 | [platform/frameworks/base.git] / tools / aapt / Android.mk 4 | -------------------------------------------------------------------------------- /jni/expat/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | # We need to build this for both the device (as a shared library) 4 | # and the host (as a static library for tools to use). 5 | 6 | common_SRC_FILES := \ 7 | lib/xmlparse.c \ 8 | lib/xmlrole.c \ 9 | lib/xmltok.c 10 | 11 | common_CFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H 12 | 13 | common_C_INCLUDES += \ 14 | $(LOCAL_PATH)/lib 15 | 16 | common_COPY_HEADERS_TO := libexpat 17 | common_COPY_HEADERS := \ 18 | lib/expat.h \ 19 | lib/expat_external.h 20 | 21 | # For the device 22 | # ===================================================== 23 | 24 | include $(CLEAR_VARS) 25 | 26 | LOCAL_SRC_FILES := $(common_SRC_FILES) 27 | LOCAL_CFLAGS += $(common_CFLAGS) 28 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) 29 | 30 | LOCAL_MODULE:= libexpat 31 | LOCAL_MODULE_TAGS := optional 32 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 33 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 34 | 35 | include $(BUILD_SHARED_LIBRARY) 36 | -------------------------------------------------------------------------------- /jni/expat/jni/Android.mk.original: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | # We need to build this for both the device (as a shared library) 4 | # and the host (as a static library for tools to use). 5 | 6 | common_SRC_FILES := \ 7 | lib/xmlparse.c \ 8 | lib/xmlrole.c \ 9 | lib/xmltok.c 10 | 11 | common_CFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H 12 | 13 | common_C_INCLUDES += \ 14 | $(LOCAL_PATH)/lib 15 | 16 | common_COPY_HEADERS_TO := libexpat 17 | common_COPY_HEADERS := \ 18 | lib/expat.h \ 19 | lib/expat_external.h 20 | 21 | # For the host 22 | # ===================================================== 23 | 24 | include $(CLEAR_VARS) 25 | 26 | LOCAL_SRC_FILES := $(common_SRC_FILES) 27 | LOCAL_CFLAGS += $(common_CFLAGS) 28 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) 29 | 30 | ifeq ($(HOST_OS),darwin) 31 | LOCAL_CFLAGS += -fno-common 32 | endif 33 | 34 | LOCAL_MODULE:= libexpat 35 | LOCAL_MODULE_TAGS := optional 36 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 37 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 38 | 39 | include $(BUILD_HOST_STATIC_LIBRARY) 40 | 41 | 42 | # For the device 43 | # ===================================================== 44 | 45 | include $(CLEAR_VARS) 46 | 47 | LOCAL_SRC_FILES := $(common_SRC_FILES) 48 | LOCAL_CFLAGS += $(common_CFLAGS) 49 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) 50 | 51 | LOCAL_MODULE:= libexpat 52 | LOCAL_MODULE_TAGS := optional 53 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 54 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 55 | 56 | include $(BUILD_SHARED_LIBRARY) 57 | 58 | -------------------------------------------------------------------------------- /jni/expat/jni/CleanSpec.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # If you don't need to do a full clean build but would like to touch 17 | # a file or delete some intermediate files, add a clean step to the end 18 | # of the list. These steps will only be run once, if they haven't been 19 | # run before. 20 | # 21 | # E.g.: 22 | # $(call add-clean-step, touch -c external/sqlite/sqlite3.h) 23 | # $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) 24 | # 25 | # Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with 26 | # files that are missing or have been moved. 27 | # 28 | # Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. 29 | # Use $(OUT_DIR) to refer to the "out" directory. 30 | # 31 | # If you need to re-do something that's already mentioned, just copy 32 | # the command and add it to the bottom of the list. E.g., if a change 33 | # that you made last week required touching a file and a change you 34 | # made today requires touching the same file, just copy the old 35 | # touch step and add it to the end of the list. 36 | # 37 | # ************************************************ 38 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 39 | # ************************************************ 40 | 41 | # For example: 42 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) 43 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) 44 | #$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) 45 | #$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) 46 | 47 | # ************************************************ 48 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 49 | # ************************************************ 50 | -------------------------------------------------------------------------------- /jni/expat/jni/MODULE_LICENSE_BSD_LIKE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/expat/jni/MODULE_LICENSE_BSD_LIKE -------------------------------------------------------------------------------- /jni/expat/jni/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd 2 | and Clark Cooper 3 | Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /jni/expat/jni/ThirdPartyProject.prop: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Google Inc. All Rights Reserved. 2 | #Fri Jul 16 10:03:09 PDT 2010 3 | currentVersion=2.0.1 4 | version=2.0.1 5 | isNative=true 6 | feedurl=http\://expat.sourceforge.net/ 7 | name=expat 8 | keywords=expat 9 | onDevice=true 10 | homepage=http\://expat.sourceforge.net/ 11 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/Makefile.MPW: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/expat/jni/lib/Makefile.MPW -------------------------------------------------------------------------------- /jni/expat/jni/lib/amigaconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef AMIGACONFIG_H 2 | #define AMIGACONFIG_H 3 | 4 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 5 | #define BYTEORDER 4321 6 | 7 | /* Define to 1 if you have the `bcopy' function. */ 8 | #define HAVE_BCOPY 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #undef HAVE_CHECK_H 12 | 13 | /* Define to 1 if you have the `memmove' function. */ 14 | #define HAVE_MEMMOVE 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_UNISTD_H 1 18 | 19 | /* whether byteorder is bigendian */ 20 | #define WORDS_BIGENDIAN 21 | 22 | /* Define to specify how much context to retain around the current parse 23 | point. */ 24 | #define XML_CONTEXT_BYTES 1024 25 | 26 | /* Define to make parameter entity parsing functionality available. */ 27 | #define XML_DTD 28 | 29 | /* Define to make XML Namespaces functionality available. */ 30 | #define XML_NS 31 | 32 | #endif /* AMIGACONFIG_H */ 33 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/ascii.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | #define ASCII_A 0x41 6 | #define ASCII_B 0x42 7 | #define ASCII_C 0x43 8 | #define ASCII_D 0x44 9 | #define ASCII_E 0x45 10 | #define ASCII_F 0x46 11 | #define ASCII_G 0x47 12 | #define ASCII_H 0x48 13 | #define ASCII_I 0x49 14 | #define ASCII_J 0x4A 15 | #define ASCII_K 0x4B 16 | #define ASCII_L 0x4C 17 | #define ASCII_M 0x4D 18 | #define ASCII_N 0x4E 19 | #define ASCII_O 0x4F 20 | #define ASCII_P 0x50 21 | #define ASCII_Q 0x51 22 | #define ASCII_R 0x52 23 | #define ASCII_S 0x53 24 | #define ASCII_T 0x54 25 | #define ASCII_U 0x55 26 | #define ASCII_V 0x56 27 | #define ASCII_W 0x57 28 | #define ASCII_X 0x58 29 | #define ASCII_Y 0x59 30 | #define ASCII_Z 0x5A 31 | 32 | #define ASCII_a 0x61 33 | #define ASCII_b 0x62 34 | #define ASCII_c 0x63 35 | #define ASCII_d 0x64 36 | #define ASCII_e 0x65 37 | #define ASCII_f 0x66 38 | #define ASCII_g 0x67 39 | #define ASCII_h 0x68 40 | #define ASCII_i 0x69 41 | #define ASCII_j 0x6A 42 | #define ASCII_k 0x6B 43 | #define ASCII_l 0x6C 44 | #define ASCII_m 0x6D 45 | #define ASCII_n 0x6E 46 | #define ASCII_o 0x6F 47 | #define ASCII_p 0x70 48 | #define ASCII_q 0x71 49 | #define ASCII_r 0x72 50 | #define ASCII_s 0x73 51 | #define ASCII_t 0x74 52 | #define ASCII_u 0x75 53 | #define ASCII_v 0x76 54 | #define ASCII_w 0x77 55 | #define ASCII_x 0x78 56 | #define ASCII_y 0x79 57 | #define ASCII_z 0x7A 58 | 59 | #define ASCII_0 0x30 60 | #define ASCII_1 0x31 61 | #define ASCII_2 0x32 62 | #define ASCII_3 0x33 63 | #define ASCII_4 0x34 64 | #define ASCII_5 0x35 65 | #define ASCII_6 0x36 66 | #define ASCII_7 0x37 67 | #define ASCII_8 0x38 68 | #define ASCII_9 0x39 69 | 70 | #define ASCII_TAB 0x09 71 | #define ASCII_SPACE 0x20 72 | #define ASCII_EXCL 0x21 73 | #define ASCII_QUOT 0x22 74 | #define ASCII_AMP 0x26 75 | #define ASCII_APOS 0x27 76 | #define ASCII_MINUS 0x2D 77 | #define ASCII_PERIOD 0x2E 78 | #define ASCII_COLON 0x3A 79 | #define ASCII_SEMI 0x3B 80 | #define ASCII_LT 0x3C 81 | #define ASCII_EQUALS 0x3D 82 | #define ASCII_GT 0x3E 83 | #define ASCII_LSQB 0x5B 84 | #define ASCII_RSQB 0x5D 85 | #define ASCII_UNDERSCORE 0x5F 86 | #define ASCII_LPAREN 0x28 87 | #define ASCII_RPAREN 0x29 88 | #define ASCII_FF 0x0C 89 | #define ASCII_SLASH 0x2F 90 | #define ASCII_HASH 0x23 91 | #define ASCII_PIPE 0x7C 92 | #define ASCII_COMMA 0x2C 93 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/asciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 6 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 8 | /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, 9 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 10 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 14 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 15 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 16 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 17 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 18 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 20 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 21 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 22 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 23 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 28 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 29 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 30 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 31 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 36 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 37 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/iasciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ 6 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 8 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 9 | /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, 10 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 14 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 15 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 16 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 17 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 18 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 20 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 21 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 22 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 23 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 24 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 29 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 30 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 31 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 32 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 37 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 38 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/internal.h: -------------------------------------------------------------------------------- 1 | /* internal.h 2 | 3 | Internal definitions used by Expat. This is not needed to compile 4 | client code. 5 | 6 | The following calling convention macros are defined for frequently 7 | called functions: 8 | 9 | FASTCALL - Used for those internal functions that have a simple 10 | body and a low number of arguments and local variables. 11 | 12 | PTRCALL - Used for functions called though function pointers. 13 | 14 | PTRFASTCALL - Like PTRCALL, but for low number of arguments. 15 | 16 | inline - Used for selected internal functions for which inlining 17 | may improve performance on some platforms. 18 | 19 | Note: Use of these macros is based on judgement, not hard rules, 20 | and therefore subject to change. 21 | */ 22 | 23 | #if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__) 24 | /* We'll use this version by default only where we know it helps. 25 | 26 | regparm() generates warnings on Solaris boxes. See SF bug #692878. 27 | 28 | Instability reported with egcs on a RedHat Linux 7.3. 29 | Let's comment out: 30 | #define FASTCALL __attribute__((stdcall, regparm(3))) 31 | and let's try this: 32 | */ 33 | #define FASTCALL __attribute__((regparm(3))) 34 | #define PTRFASTCALL __attribute__((regparm(3))) 35 | #endif 36 | 37 | /* Using __fastcall seems to have an unexpected negative effect under 38 | MS VC++, especially for function pointers, so we won't use it for 39 | now on that platform. It may be reconsidered for a future release 40 | if it can be made more effective. 41 | Likely reason: __fastcall on Windows is like stdcall, therefore 42 | the compiler cannot perform stack optimizations for call clusters. 43 | */ 44 | 45 | /* Make sure all of these are defined if they aren't already. */ 46 | 47 | #ifndef FASTCALL 48 | #define FASTCALL 49 | #endif 50 | 51 | #ifndef PTRCALL 52 | #define PTRCALL 53 | #endif 54 | 55 | #ifndef PTRFASTCALL 56 | #define PTRFASTCALL 57 | #endif 58 | 59 | #ifndef XML_MIN_SIZE 60 | #if !defined(__cplusplus) && !defined(inline) 61 | #ifdef __GNUC__ 62 | #define inline __inline 63 | #endif /* __GNUC__ */ 64 | #endif 65 | #endif /* XML_MIN_SIZE */ 66 | 67 | #ifdef __cplusplus 68 | #define inline inline 69 | #else 70 | #ifndef inline 71 | #define inline 72 | #endif 73 | #endif 74 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/latin1tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 6 | /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 7 | /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 8 | /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 9 | /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 10 | /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 11 | /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 12 | /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 13 | /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 14 | /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 15 | /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 16 | /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 17 | /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 18 | /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, 19 | /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, 20 | /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, 21 | /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 22 | /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 23 | /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 27 | /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 28 | /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 29 | /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 30 | /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 31 | /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 35 | /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 36 | /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 37 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/libexpat.def: -------------------------------------------------------------------------------- 1 | ; DEF file for MS VC++ 2 | 3 | LIBRARY 4 | EXPORTS 5 | XML_DefaultCurrent @1 6 | XML_ErrorString @2 7 | XML_ExpatVersion @3 8 | XML_ExpatVersionInfo @4 9 | XML_ExternalEntityParserCreate @5 10 | XML_GetBase @6 11 | XML_GetBuffer @7 12 | XML_GetCurrentByteCount @8 13 | XML_GetCurrentByteIndex @9 14 | XML_GetCurrentColumnNumber @10 15 | XML_GetCurrentLineNumber @11 16 | XML_GetErrorCode @12 17 | XML_GetIdAttributeIndex @13 18 | XML_GetInputContext @14 19 | XML_GetSpecifiedAttributeCount @15 20 | XML_Parse @16 21 | XML_ParseBuffer @17 22 | XML_ParserCreate @18 23 | XML_ParserCreateNS @19 24 | XML_ParserCreate_MM @20 25 | XML_ParserFree @21 26 | XML_SetAttlistDeclHandler @22 27 | XML_SetBase @23 28 | XML_SetCdataSectionHandler @24 29 | XML_SetCharacterDataHandler @25 30 | XML_SetCommentHandler @26 31 | XML_SetDefaultHandler @27 32 | XML_SetDefaultHandlerExpand @28 33 | XML_SetDoctypeDeclHandler @29 34 | XML_SetElementDeclHandler @30 35 | XML_SetElementHandler @31 36 | XML_SetEncoding @32 37 | XML_SetEndCdataSectionHandler @33 38 | XML_SetEndDoctypeDeclHandler @34 39 | XML_SetEndElementHandler @35 40 | XML_SetEndNamespaceDeclHandler @36 41 | XML_SetEntityDeclHandler @37 42 | XML_SetExternalEntityRefHandler @38 43 | XML_SetExternalEntityRefHandlerArg @39 44 | XML_SetNamespaceDeclHandler @40 45 | XML_SetNotStandaloneHandler @41 46 | XML_SetNotationDeclHandler @42 47 | XML_SetParamEntityParsing @43 48 | XML_SetProcessingInstructionHandler @44 49 | XML_SetReturnNSTriplet @45 50 | XML_SetStartCdataSectionHandler @46 51 | XML_SetStartDoctypeDeclHandler @47 52 | XML_SetStartElementHandler @48 53 | XML_SetStartNamespaceDeclHandler @49 54 | XML_SetUnknownEncodingHandler @50 55 | XML_SetUnparsedEntityDeclHandler @51 56 | XML_SetUserData @52 57 | XML_SetXmlDeclHandler @53 58 | XML_UseParserAsHandlerArg @54 59 | ; added with version 1.95.3 60 | XML_ParserReset @55 61 | XML_SetSkippedEntityHandler @56 62 | ; added with version 1.95.5 63 | XML_GetFeatureList @57 64 | XML_UseForeignDTD @58 65 | ; added with version 1.95.6 66 | XML_FreeContentModel @59 67 | XML_MemMalloc @60 68 | XML_MemRealloc @61 69 | XML_MemFree @62 70 | ; added with version 1.95.8 71 | XML_StopParser @63 72 | XML_ResumeParser @64 73 | XML_GetParsingStatus @65 74 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/libexpatw.def: -------------------------------------------------------------------------------- 1 | ; DEF file for MS VC++ 2 | 3 | LIBRARY 4 | EXPORTS 5 | XML_DefaultCurrent @1 6 | XML_ErrorString @2 7 | XML_ExpatVersion @3 8 | XML_ExpatVersionInfo @4 9 | XML_ExternalEntityParserCreate @5 10 | XML_GetBase @6 11 | XML_GetBuffer @7 12 | XML_GetCurrentByteCount @8 13 | XML_GetCurrentByteIndex @9 14 | XML_GetCurrentColumnNumber @10 15 | XML_GetCurrentLineNumber @11 16 | XML_GetErrorCode @12 17 | XML_GetIdAttributeIndex @13 18 | XML_GetInputContext @14 19 | XML_GetSpecifiedAttributeCount @15 20 | XML_Parse @16 21 | XML_ParseBuffer @17 22 | XML_ParserCreate @18 23 | XML_ParserCreateNS @19 24 | XML_ParserCreate_MM @20 25 | XML_ParserFree @21 26 | XML_SetAttlistDeclHandler @22 27 | XML_SetBase @23 28 | XML_SetCdataSectionHandler @24 29 | XML_SetCharacterDataHandler @25 30 | XML_SetCommentHandler @26 31 | XML_SetDefaultHandler @27 32 | XML_SetDefaultHandlerExpand @28 33 | XML_SetDoctypeDeclHandler @29 34 | XML_SetElementDeclHandler @30 35 | XML_SetElementHandler @31 36 | XML_SetEncoding @32 37 | XML_SetEndCdataSectionHandler @33 38 | XML_SetEndDoctypeDeclHandler @34 39 | XML_SetEndElementHandler @35 40 | XML_SetEndNamespaceDeclHandler @36 41 | XML_SetEntityDeclHandler @37 42 | XML_SetExternalEntityRefHandler @38 43 | XML_SetExternalEntityRefHandlerArg @39 44 | XML_SetNamespaceDeclHandler @40 45 | XML_SetNotStandaloneHandler @41 46 | XML_SetNotationDeclHandler @42 47 | XML_SetParamEntityParsing @43 48 | XML_SetProcessingInstructionHandler @44 49 | XML_SetReturnNSTriplet @45 50 | XML_SetStartCdataSectionHandler @46 51 | XML_SetStartDoctypeDeclHandler @47 52 | XML_SetStartElementHandler @48 53 | XML_SetStartNamespaceDeclHandler @49 54 | XML_SetUnknownEncodingHandler @50 55 | XML_SetUnparsedEntityDeclHandler @51 56 | XML_SetUserData @52 57 | XML_SetXmlDeclHandler @53 58 | XML_UseParserAsHandlerArg @54 59 | ; added with version 1.95.3 60 | XML_ParserReset @55 61 | XML_SetSkippedEntityHandler @56 62 | ; added with version 1.95.5 63 | XML_GetFeatureList @57 64 | XML_UseForeignDTD @58 65 | ; added with version 1.95.6 66 | XML_FreeContentModel @59 67 | XML_MemMalloc @60 68 | XML_MemRealloc @61 69 | XML_MemFree @62 70 | ; added with version 1.95.8 71 | XML_StopParser @63 72 | XML_ResumeParser @64 73 | XML_GetParsingStatus @65 74 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/macconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | ** 9 | */ 10 | 11 | #ifndef MACCONFIG_H 12 | #define MACCONFIG_H 13 | 14 | 15 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 16 | #define BYTEORDER 4321 17 | 18 | /* Define to 1 if you have the `bcopy' function. */ 19 | #undef HAVE_BCOPY 20 | 21 | /* Define to 1 if you have the `memmove' function. */ 22 | #define HAVE_MEMMOVE 23 | 24 | /* Define to 1 if you have a working `mmap' system call. */ 25 | #undef HAVE_MMAP 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_UNISTD_H 29 | 30 | /* whether byteorder is bigendian */ 31 | #define WORDS_BIGENDIAN 32 | 33 | /* Define to specify how much context to retain around the current parse 34 | point. */ 35 | #undef XML_CONTEXT_BYTES 36 | 37 | /* Define to make parameter entity parsing functionality available. */ 38 | #define XML_DTD 39 | 40 | /* Define to make XML Namespaces functionality available. */ 41 | #define XML_NS 42 | 43 | /* Define to empty if `const' does not conform to ANSI C. */ 44 | #undef const 45 | 46 | /* Define to `long' if does not define. */ 47 | #define off_t long 48 | 49 | /* Define to `unsigned' if does not define. */ 50 | #undef size_t 51 | 52 | 53 | #endif /* ifndef MACCONFIG_H */ 54 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/utf8tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | 6 | /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 7 | /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 8 | /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 9 | /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 10 | /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 11 | /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 12 | /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 13 | /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 14 | /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 15 | /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 16 | /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 17 | /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 18 | /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 19 | /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 20 | /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 21 | /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 22 | /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 23 | /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 24 | /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 25 | /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 26 | /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 27 | /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 28 | /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 29 | /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 30 | /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 31 | /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 32 | /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 33 | /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 34 | /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, 35 | /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, 36 | /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 37 | /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, 38 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/winconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | */ 9 | 10 | #ifndef WINCONFIG_H 11 | #define WINCONFIG_H 12 | 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #undef WIN32_LEAN_AND_MEAN 16 | 17 | #include 18 | #include 19 | 20 | #define XML_NS 1 21 | #define XML_DTD 1 22 | #define XML_CONTEXT_BYTES 1024 23 | 24 | /* we will assume all Windows platforms are little endian */ 25 | #define BYTEORDER 1234 26 | 27 | /* Windows has memmove() available. */ 28 | #define HAVE_MEMMOVE 29 | 30 | #endif /* ndef WINCONFIG_H */ 31 | -------------------------------------------------------------------------------- /jni/expat/jni/lib/xmltok_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 3 | See the file COPYING for copying permission. 4 | */ 5 | 6 | enum { 7 | BT_NONXML, 8 | BT_MALFORM, 9 | BT_LT, 10 | BT_AMP, 11 | BT_RSQB, 12 | BT_LEAD2, 13 | BT_LEAD3, 14 | BT_LEAD4, 15 | BT_TRAIL, 16 | BT_CR, 17 | BT_LF, 18 | BT_GT, 19 | BT_QUOT, 20 | BT_APOS, 21 | BT_EQUALS, 22 | BT_QUEST, 23 | BT_EXCL, 24 | BT_SOL, 25 | BT_SEMI, 26 | BT_NUM, 27 | BT_LSQB, 28 | BT_S, 29 | BT_NMSTRT, 30 | BT_COLON, 31 | BT_HEX, 32 | BT_DIGIT, 33 | BT_NAME, 34 | BT_MINUS, 35 | BT_OTHER, /* known not to be a name or name start character */ 36 | BT_NONASCII, /* might be a name or name start character */ 37 | BT_PERCNT, 38 | BT_LPAR, 39 | BT_RPAR, 40 | BT_AST, 41 | BT_PLUS, 42 | BT_COMMA, 43 | BT_VERBAR 44 | }; 45 | 46 | #include 47 | -------------------------------------------------------------------------------- /jni/expat/ndk-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | export NDK_PROJECT_PATH=. 4 | /cygdrive/u/Programs/android-ndk/ndk-build 5 | -------------------------------------------------------------------------------- /jni/expat/source.txt: -------------------------------------------------------------------------------- 1 | http://android.git.kernel.org/ 2 | 3 | [platform/external/expat.git] / Android.mk 4 | -------------------------------------------------------------------------------- /jni/libcutils/jni/Application.mk: -------------------------------------------------------------------------------- 1 | # needed for compiling libhost 2 | APP_STL := gnustl_static 3 | APP_PLATFORM := android-9 4 | -------------------------------------------------------------------------------- /jni/libcutils/jni/MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/libcutils/jni/MODULE_LICENSE_APACHE2 -------------------------------------------------------------------------------- /jni/libcutils/jni/arch-x86/android_memset16.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * Contributed by: Intel Corporation 18 | */ 19 | 20 | #if defined(USE_SSE2) 21 | 22 | # include "cache_wrapper.S" 23 | # undef __i686 24 | # define USE_AS_ANDROID 25 | # define sse2_memset16_atom android_memset16 26 | # include "sse2-memset16-atom.S" 27 | 28 | #else 29 | 30 | # include "memset16.S" 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /jni/libcutils/jni/arch-x86/android_memset32.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * Contributed by: Intel Corporation 18 | */ 19 | 20 | #if defined(USE_SSE2) 21 | 22 | # include "cache_wrapper.S" 23 | # undef __i686 24 | # define USE_AS_ANDROID 25 | # define sse2_memset32_atom android_memset32 26 | # include "sse2-memset32-atom.S" 27 | 28 | #else 29 | 30 | # include "memset32.S" 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /jni/libcutils/jni/arch-x86/cache_wrapper.S: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* 17 | * Contributed by: Intel Corporation 18 | */ 19 | 20 | /* Values are optimized for Atom */ 21 | #define SHARED_CACHE_SIZE (512*1024) /* Atom L2 Cache */ 22 | #define DATA_CACHE_SIZE (24*1024) /* Atom L1 Data Cache */ 23 | #define SHARED_CACHE_SIZE_HALF (SHARED_CACHE_SIZE / 2) 24 | #define DATA_CACHE_SIZE_HALF (DATA_CACHE_SIZE / 2) 25 | -------------------------------------------------------------------------------- /jni/libcutils/jni/atomic.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define inline 18 | 19 | #include 20 | -------------------------------------------------------------------------------- /jni/libcutils/jni/dlmalloc_stubs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* No-op stubs for functions defined in system/bionic/bionic/dlmalloc.c. 18 | */ 19 | void dlmalloc_walk_free_pages() 20 | { 21 | } 22 | 23 | void dlmalloc_walk_heap() 24 | { 25 | } 26 | 27 | void dlmalloc_trim() 28 | { 29 | } 30 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/ctest/ctest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Very simple unit testing framework. 19 | */ 20 | 21 | #ifndef __CUTILS_TEST_H 22 | #define __CUTILS_TEST_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /** 29 | * Adds a test to the test suite. 30 | */ 31 | #define addTest(test) addNamedTest(#test, &test) 32 | 33 | /** 34 | * Asserts that a condition is true. The test fails if it isn't. 35 | */ 36 | #define assertTrue(value, message) assertTrueWithSource(value, __FILE__, __LINE__, message); 37 | 38 | /** 39 | * Asserts that a condition is false. The test fails if the value is true. 40 | */ 41 | #define assertFalse(value, message) assertTrueWithSource(!value, __FILE__, __LINE__, message); 42 | 43 | /** Fails a test with the given message. */ 44 | #define fail(message) assertTrueWithSource(0, __FILE__, __LINE__, message); 45 | 46 | /** 47 | * Asserts that two values are ==. 48 | */ 49 | #define assertSame(a, b) assertTrueWithSource(a == b, __FILE__, __LINE__, "Expected same value."); 50 | 51 | /** 52 | * Asserts that two values are !=. 53 | */ 54 | #define assertNotSame(a, b) assertTrueWithSource(a != b, __FILE__, __LINE__,\ 55 | "Expected different values"); 56 | 57 | /** 58 | * Runs a test suite. 59 | */ 60 | void runTests(void); 61 | 62 | // Do not call these functions directly. Use macros above instead. 63 | void addNamedTest(const char* name, void (*test)(void)); 64 | void assertTrueWithSource(int value, const char* file, int line, char* message); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* __CUTILS_TEST_H */ 71 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * A pointer array which intelligently expands its capacity ad needed. 19 | */ 20 | 21 | #ifndef __ARRAY_H 22 | #define __ARRAY_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | #include 29 | 30 | /** An array. */ 31 | typedef struct Array Array; 32 | 33 | /** Constructs a new array. Returns NULL if we ran out of memory. */ 34 | Array* arrayCreate(); 35 | 36 | /** Frees an array. Does not free elements themselves. */ 37 | void arrayFree(Array* array); 38 | 39 | /** Adds a pointer. Returns 0 is successful, < 0 otherwise. */ 40 | int arrayAdd(Array* array, void* pointer); 41 | 42 | /** Gets the pointer at the specified index. */ 43 | void* arrayGet(Array* array, int index); 44 | 45 | /** Removes the pointer at the given index and returns it. */ 46 | void* arrayRemove(Array* array, int index); 47 | 48 | /** Sets pointer at the given index. Returns old pointer. */ 49 | void* arraySet(Array* array, int index, void* pointer); 50 | 51 | /** Sets the array size. Sets new pointers to NULL. Returns 0 if successful, < 0 otherwise . */ 52 | int arraySetSize(Array* array, int size); 53 | 54 | /** Returns the size of the given array. */ 55 | int arraySize(Array* array); 56 | 57 | /** 58 | * Returns a pointer to a C-style array which will be valid until this array 59 | * changes. 60 | */ 61 | const void** arrayUnwrap(Array* array); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* __ARRAY_H */ 68 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/ashmem.h: -------------------------------------------------------------------------------- 1 | /* cutils/ashmem.h 2 | ** 3 | ** Copyright 2008 The Android Open Source Project 4 | ** 5 | ** This file is dual licensed. It may be redistributed and/or modified 6 | ** under the terms of the Apache 2.0 License OR version 2 of the GNU 7 | ** General Public License. 8 | */ 9 | 10 | #ifndef _CUTILS_ASHMEM_H 11 | #define _CUTILS_ASHMEM_H 12 | 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int ashmem_create_region(const char *name, size_t size); 20 | int ashmem_set_prot_region(int fd, int prot); 21 | int ashmem_pin_region(int fd, size_t offset, size_t len); 22 | int ashmem_unpin_region(int fd, size_t offset, size_t len); 23 | int ashmem_get_size_region(int fd); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #ifndef __ASHMEMIOC /* in case someone included too */ 30 | 31 | #define ASHMEM_NAME_LEN 256 32 | 33 | #define ASHMEM_NAME_DEF "dev/ashmem" 34 | 35 | /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ 36 | #define ASHMEM_NOT_PURGED 0 37 | #define ASHMEM_WAS_PURGED 1 38 | 39 | /* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ 40 | #define ASHMEM_IS_UNPINNED 0 41 | #define ASHMEM_IS_PINNED 1 42 | 43 | #endif /* ! __ASHMEMIOC */ 44 | 45 | #endif /* _CUTILS_ASHMEM_H */ 46 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/atomic-inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CUTILS_ATOMIC_INLINE_H 18 | #define ANDROID_CUTILS_ATOMIC_INLINE_H 19 | 20 | /* 21 | * Inline declarations and macros for some special-purpose atomic 22 | * operations. These are intended for rare circumstances where a 23 | * memory barrier needs to be issued inline rather than as a function 24 | * call. 25 | * 26 | * Most code should not use these. 27 | * 28 | * Anything that does include this file must set ANDROID_SMP to either 29 | * 0 or 1, indicating compilation for UP or SMP, respectively. 30 | * 31 | * Macros defined in this header: 32 | * 33 | * void ANDROID_MEMBAR_FULL(void) 34 | * Full memory barrier. Provides a compiler reordering barrier, and 35 | * on SMP systems emits an appropriate instruction. 36 | */ 37 | 38 | #if !defined(ANDROID_SMP) 39 | # error "Must define ANDROID_SMP before including atomic-inline.h" 40 | #endif 41 | 42 | #if defined(__arm__) 43 | #include 44 | #elif defined(__i386__) || defined(__x86_64__) 45 | #include 46 | #elif defined(__sh__) 47 | /* implementation is in atomic-android-sh.c */ 48 | #else 49 | #error atomic operations are unsupported 50 | #endif 51 | 52 | #if ANDROID_SMP == 0 53 | #define ANDROID_MEMBAR_FULL android_compiler_barrier 54 | #else 55 | #define ANDROID_MEMBAR_FULL android_memory_barrier 56 | #endif 57 | 58 | #endif /* ANDROID_CUTILS_ATOMIC_INLINE_H */ 59 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/bitops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_BITOPS_H 18 | #define __CUTILS_BITOPS_H 19 | 20 | #include 21 | 22 | __BEGIN_DECLS 23 | 24 | static inline int popcount(unsigned int x) 25 | { 26 | return __builtin_popcount(x); 27 | } 28 | 29 | static inline int popcountl(unsigned long x) 30 | { 31 | return __builtin_popcountl(x); 32 | } 33 | 34 | static inline int popcountll(unsigned long long x) 35 | { 36 | return __builtin_popcountll(x); 37 | } 38 | 39 | __END_DECLS 40 | 41 | #endif /* __CUTILS_BITOPS_H */ 42 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/compiler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CUTILS_COMPILER_H 18 | #define ANDROID_CUTILS_COMPILER_H 19 | 20 | /* 21 | * helps the compiler's optimizer predicting branches 22 | */ 23 | 24 | #ifdef __cplusplus 25 | # define CC_LIKELY( exp ) (__builtin_expect( !!(exp), true )) 26 | # define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), false )) 27 | #else 28 | # define CC_LIKELY( exp ) (__builtin_expect( !!(exp), 1 )) 29 | # define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 )) 30 | #endif 31 | 32 | #endif // ANDROID_CUTILS_COMPILER_H 33 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/config_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_CONFIG_UTILS_H 18 | #define __CUTILS_CONFIG_UTILS_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct cnode cnode; 25 | 26 | 27 | struct cnode 28 | { 29 | cnode *next; 30 | cnode *first_child; 31 | cnode *last_child; 32 | const char *name; 33 | const char *value; 34 | }; 35 | 36 | /* parse a text string into a config node tree */ 37 | void config_load(cnode *root, char *data); 38 | 39 | /* parse a file into a config node tree */ 40 | void config_load_file(cnode *root, const char *fn); 41 | 42 | /* create a single config node */ 43 | cnode* config_node(const char *name, const char *value); 44 | 45 | /* locate a named child of a config node */ 46 | cnode* config_find(cnode *root, const char *name); 47 | 48 | /* look up a child by name and return the boolean value */ 49 | int config_bool(cnode *root, const char *name, int _default); 50 | 51 | /* look up a child by name and return the string value */ 52 | const char* config_str(cnode *root, const char *name, const char *_default); 53 | 54 | /* add a named child to a config node (or modify it if it already exists) */ 55 | void config_set(cnode *root, const char *name, const char *value); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/cpu_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_CPU_INFO_H 18 | #define __CUTILS_CPU_INFO_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* returns a string contiaining an ASCII representation of the CPU serial number, 25 | ** or NULL if cpu info not available. 26 | ** The string is a static variable, so don't call free() on it. 27 | */ 28 | extern const char* get_cpu_serial_number(void); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /* __CUTILS_CPU_INFO_H */ 35 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/dir_hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | typedef enum { 18 | SHA_1, 19 | } HashAlgorithm; 20 | 21 | int get_file_hash(HashAlgorithm algorithm, const char *path, 22 | char *output_string, size_t max_output_string); 23 | 24 | int get_recursive_hash_manifest(HashAlgorithm algorithm, 25 | const char *directory_path, 26 | char **output_string); 27 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/event_tag_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _LIBS_CUTILS_EVENTTAGMAP_H 18 | #define _LIBS_CUTILS_EVENTTAGMAP_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #define EVENT_TAG_MAP_FILE "/system/etc/event-log-tags" 25 | 26 | struct EventTagMap; 27 | typedef struct EventTagMap EventTagMap; 28 | 29 | /* 30 | * Open the specified file as an event log tag map. 31 | * 32 | * Returns NULL on failure. 33 | */ 34 | EventTagMap* android_openEventTagMap(const char* fileName); 35 | 36 | /* 37 | * Close the map. 38 | */ 39 | void android_closeEventTagMap(EventTagMap* map); 40 | 41 | /* 42 | * Look up a tag by index. Returns the tag string, or NULL if not found. 43 | */ 44 | const char* android_lookupEventTag(const EventTagMap* map, int tag); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /*_LIBS_CUTILS_EVENTTAGMAP_H*/ 51 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/iosched_policy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_IOSCHED_POLICY_H 18 | #define __CUTILS_IOSCHED_POLICY_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef enum { 25 | IoSchedClass_NONE, 26 | IoSchedClass_RT, 27 | IoSchedClass_BE, 28 | IoSchedClass_IDLE, 29 | } IoSchedClass; 30 | 31 | extern int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio); 32 | extern int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* __CUTILS_IOSCHED_POLICY_H */ 39 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/jstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_STRING16_H 18 | #define __CUTILS_STRING16_H 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | typedef uint16_t char16_t; 28 | 29 | extern char * strndup16to8 (const char16_t* s, size_t n); 30 | extern size_t strnlen16to8 (const char16_t* s, size_t n); 31 | extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); 32 | 33 | extern char16_t * strdup8to16 (const char* s, size_t *out_len); 34 | extern size_t strlen8to16 (const char* utf8Str); 35 | extern char16_t * strcpy8to16 (char16_t *dest, const char*s, size_t *out_len); 36 | extern char16_t * strcpylen8to16 (char16_t *dest, const char*s, int length, 37 | size_t *out_len); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* __CUTILS_STRING16_H */ 44 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/logd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _ANDROID_CUTILS_LOGD_H 18 | #define _ANDROID_CUTILS_LOGD_H 19 | 20 | /* the stable/frozen log-related definitions have been 21 | * moved to this header, which is exposed by the NDK 22 | */ 23 | #include 24 | 25 | /* the rest is only used internally by the system */ 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #ifdef HAVE_PTHREADS 32 | #include 33 | #endif 34 | #include 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | int __android_log_bwrite(int32_t tag, const void *payload, size_t len); 42 | int __android_log_btwrite(int32_t tag, char type, const void *payload, 43 | size_t len); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* _LOGD_H */ 50 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/logger.h: -------------------------------------------------------------------------------- 1 | /* utils/logger.h 2 | ** 3 | ** Copyright 2007, The Android Open Source Project 4 | ** 5 | ** This file is dual licensed. It may be redistributed and/or modified 6 | ** under the terms of the Apache 2.0 License OR version 2 of the GNU 7 | ** General Public License. 8 | */ 9 | 10 | #ifndef _UTILS_LOGGER_H 11 | #define _UTILS_LOGGER_H 12 | 13 | #include 14 | 15 | struct logger_entry { 16 | uint16_t len; /* length of the payload */ 17 | uint16_t __pad; /* no matter what, we get 2 bytes of padding */ 18 | int32_t pid; /* generating process's pid */ 19 | int32_t tid; /* generating process's tid */ 20 | int32_t sec; /* seconds since Epoch */ 21 | int32_t nsec; /* nanoseconds */ 22 | char msg[0]; /* the entry's payload */ 23 | }; 24 | 25 | #define LOGGER_LOG_MAIN "log/main" 26 | #define LOGGER_LOG_RADIO "log/radio" 27 | #define LOGGER_LOG_EVENTS "log/events" 28 | #define LOGGER_LOG_SYSTEM "log/system" 29 | 30 | #define LOGGER_ENTRY_MAX_LEN (4*1024) 31 | #define LOGGER_ENTRY_MAX_PAYLOAD \ 32 | (LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry)) 33 | 34 | #ifdef HAVE_IOCTL 35 | 36 | #include 37 | 38 | #define __LOGGERIO 0xAE 39 | 40 | #define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */ 41 | #define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */ 42 | #define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */ 43 | #define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */ 44 | 45 | #endif // HAVE_IOCTL 46 | 47 | #endif /* _UTILS_LOGGER_H */ 48 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CUTILS_MEMORY_H 18 | #define ANDROID_CUTILS_MEMORY_H 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* size is given in bytes and must be multiple of 2 */ 28 | void android_memset16(uint16_t* dst, uint16_t value, size_t size); 29 | 30 | /* size is given in bytes and must be multiple of 4 */ 31 | void android_memset32(uint32_t* dst, uint32_t value, size_t size); 32 | 33 | #if !HAVE_STRLCPY 34 | /* Declaration of strlcpy() for platforms that don't already have it. */ 35 | size_t strlcpy(char *dst, const char *src, size_t size); 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | } // extern "C" 40 | #endif 41 | 42 | #endif // ANDROID_CUTILS_MEMORY_H 43 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_MISC_H 18 | #define __CUTILS_MISC_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* Load an entire file into a malloc'd chunk of memory 25 | * that is length_of_file + 1 (null terminator). If 26 | * sz is non-zero, return the size of the file via sz. 27 | * Returns 0 on failure. 28 | */ 29 | extern void *load_file(const char *fn, unsigned *sz); 30 | 31 | /* Connects your process to the system debugger daemon 32 | * so that on a crash it may be logged or interactively 33 | * debugged (depending on system settings). 34 | */ 35 | extern void debuggerd_connect(void); 36 | 37 | 38 | /* This is the range of UIDs (and GIDs) that are reserved 39 | * for assigning to applications. 40 | */ 41 | #define FIRST_APPLICATION_UID 10000 42 | #define LAST_APPLICATION_UID 99999 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif /* __CUTILS_MISC_H */ 49 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/native_handle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef NATIVE_HANDLE_H_ 18 | #define NATIVE_HANDLE_H_ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct 25 | { 26 | int version; /* sizeof(native_handle_t) */ 27 | int numFds; /* number of file-descriptors at &data[0] */ 28 | int numInts; /* number of ints at &data[numFds] */ 29 | int data[0]; /* numFds + numInts ints */ 30 | } native_handle_t; 31 | 32 | 33 | /* keep the old definition for backward source-compatibility */ 34 | typedef native_handle_t native_handle; 35 | 36 | /* 37 | * native_handle_close 38 | * 39 | * closes the file descriptors contained in this native_handle_t 40 | * 41 | * return 0 on success, or a negative error code on failure 42 | * 43 | */ 44 | int native_handle_close(const native_handle_t* h); 45 | 46 | 47 | /* 48 | * native_handle_create 49 | * 50 | * creates a native_handle_t and initializes it. must be destroyed with 51 | * native_handle_delete(). 52 | * 53 | */ 54 | native_handle_t* native_handle_create(int numFds, int numInts); 55 | 56 | /* 57 | * native_handle_delete 58 | * 59 | * frees a native_handle_t allocated with native_handle_create(). 60 | * This ONLY frees the memory allocated for the native_handle_t, but doesn't 61 | * close the file descriptors; which can be achieved with native_handle_close(). 62 | * 63 | * return 0 on success, or a negative error code on failure 64 | * 65 | */ 66 | int native_handle_delete(native_handle_t* h); 67 | 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif /* NATIVE_HANDLE_H_ */ 74 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/open_memstream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_OPEN_MEMSTREAM_H__ 18 | #define __CUTILS_OPEN_MEMSTREAM_H__ 19 | 20 | #include 21 | 22 | #ifndef HAVE_OPEN_MEMSTREAM 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | FILE* open_memstream(char** bufp, size_t* sizep); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /*!HAVE_OPEN_MEMSTREAM*/ 35 | 36 | #endif /*__CUTILS_OPEN_MEMSTREAM_H__*/ 37 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/process_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Gives the current process a name. 19 | */ 20 | 21 | #ifndef __PROCESS_NAME_H 22 | #define __PROCESS_NAME_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /** 29 | * Sets the current process name. 30 | * 31 | * Warning: This leaks a string every time you call it. Use judiciously! 32 | */ 33 | void set_process_name(const char* process_name); 34 | 35 | /** Gets the current process name. */ 36 | const char* get_process_name(void); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* __PROCESS_NAME_H */ 43 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/properties.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_PROPERTIES_H 18 | #define __CUTILS_PROPERTIES_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* System properties are *small* name value pairs managed by the 25 | ** property service. If your data doesn't fit in the provided 26 | ** space it is not appropriate for a system property. 27 | ** 28 | ** WARNING: system/bionic/include/sys/system_properties.h also defines 29 | ** these, but with different names. (TODO: fix that) 30 | */ 31 | #define PROPERTY_KEY_MAX 32 32 | #define PROPERTY_VALUE_MAX 92 33 | 34 | /* property_get: returns the length of the value which will never be 35 | ** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. 36 | ** (the length does not include the terminating zero). 37 | ** 38 | ** If the property read fails or returns an empty value, the default 39 | ** value is used (if nonnull). 40 | */ 41 | int property_get(const char *key, char *value, const char *default_value); 42 | 43 | /* property_set: returns 0 on success, < 0 on failure 44 | */ 45 | int property_set(const char *key, const char *value); 46 | 47 | int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie); 48 | 49 | 50 | #ifdef HAVE_SYSTEM_PROPERTY_SERVER 51 | /* 52 | * We have an external property server instead of built-in libc support. 53 | * Used by the simulator. 54 | */ 55 | #define SYSTEM_PROPERTY_PIPE_NAME "/tmp/android-sysprop" 56 | 57 | enum { 58 | kSystemPropertyUnknown = 0, 59 | kSystemPropertyGet, 60 | kSystemPropertySet, 61 | kSystemPropertyList 62 | }; 63 | #endif /*HAVE_SYSTEM_PROPERTY_SERVER*/ 64 | 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/record_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * A simple utility for reading fixed records out of a stream fd 19 | */ 20 | 21 | #ifndef _CUTILS_RECORD_STREAM_H 22 | #define _CUTILS_RECORD_STREAM_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | 29 | typedef struct RecordStream RecordStream; 30 | 31 | extern RecordStream *record_stream_new(int fd, size_t maxRecordLen); 32 | extern void record_stream_free(RecordStream *p_rs); 33 | 34 | extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord, 35 | size_t *p_outRecordLen); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | 42 | #endif /*_CUTILS_RECORD_STREAM_H*/ 43 | 44 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/sched_policy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_SCHED_POLICY_H 18 | #define __CUTILS_SCHED_POLICY_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef enum { 25 | SP_BACKGROUND = 0, 26 | SP_FOREGROUND = 1, 27 | } SchedPolicy; 28 | 29 | extern int set_sched_policy(int tid, SchedPolicy policy); 30 | extern int get_sched_policy(int tid, SchedPolicy *policy); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* __CUTILS_SCHED_POLICY_H */ 37 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/str_parms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_STR_PARMS_H 18 | #define __CUTILS_STR_PARMS_H 19 | 20 | #include 21 | 22 | struct str_parms; 23 | 24 | struct str_parms *str_parms_create(void); 25 | struct str_parms *str_parms_create_str(const char *_string); 26 | void str_parms_destroy(struct str_parms *str_parms); 27 | 28 | void str_parms_del(struct str_parms *str_parms, const char *key); 29 | 30 | int str_parms_add_str(struct str_parms *str_parms, const char *key, 31 | const char *value); 32 | int str_parms_add_int(struct str_parms *str_parms, const char *key, int value); 33 | 34 | int str_parms_add_float(struct str_parms *str_parms, const char *key, 35 | float value); 36 | 37 | int str_parms_get_str(struct str_parms *str_parms, const char *key, 38 | char *out_val, int len); 39 | int str_parms_get_int(struct str_parms *str_parms, const char *key, 40 | int *out_val); 41 | int str_parms_get_float(struct str_parms *str_parms, const char *key, 42 | float *out_val); 43 | 44 | char *str_parms_to_str(struct str_parms *str_parms); 45 | 46 | /* debug */ 47 | void str_parms_dump(struct str_parms *str_parms); 48 | 49 | #endif /* __CUTILS_STR_PARMS_H */ 50 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/tztime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _CUTILS_TZTIME_H 18 | #define _CUTILS_TZTIME_H 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | time_t mktime_tz(struct tm * const tmp, char const * tz); 27 | void localtime_tz(const time_t * const timep, struct tm * tmp, const char* tz); 28 | 29 | #ifndef HAVE_ANDROID_OS 30 | /* the following is defined in in Bionic */ 31 | 32 | struct strftime_locale { 33 | const char *mon[12]; /* short names */ 34 | const char *month[12]; /* long names */ 35 | const char *standalone_month[12]; /* long standalone names */ 36 | const char *wday[7]; /* short names */ 37 | const char *weekday[7]; /* long names */ 38 | const char *X_fmt; 39 | const char *x_fmt; 40 | const char *c_fmt; 41 | const char *am; 42 | const char *pm; 43 | const char *date_fmt; 44 | }; 45 | 46 | size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale *locale); 47 | 48 | #endif /* !HAVE_ANDROID_OS */ 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* __CUTILS_TZTIME_H */ 55 | 56 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/uevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_UEVENT_H 18 | #define __CUTILS_UEVENT_H 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | ssize_t uevent_checked_recv(int socket, void *buffer, size_t length); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* __CUTILS_UEVENT_H */ 33 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/uio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // implementation of sys/uio.h for platforms that don't have it (Win32) 19 | // 20 | #ifndef _LIBS_CUTILS_UIO_H 21 | #define _LIBS_CUTILS_UIO_H 22 | 23 | #ifdef HAVE_SYS_UIO_H 24 | #include 25 | #else 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | #include 32 | 33 | struct iovec { 34 | const void* iov_base; 35 | size_t iov_len; 36 | }; 37 | 38 | extern int readv( int fd, struct iovec* vecs, int count ); 39 | extern int writev( int fd, const struct iovec* vecs, int count ); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* !HAVE_SYS_UIO_H */ 46 | 47 | #endif /* _LIBS_UTILS_UIO_H */ 48 | 49 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/cutils/zygote.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __CUTILS_ZYGOTE_H 18 | #define __CUTILS_ZYGOTE_H 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | int zygote_run_oneshot(int sendStdio, int argc, const char **argv); 25 | int zygote_run(int argc, const char **argv); 26 | int zygote_run_wait(int argc, const char **argv, void (*post_run_func)(int)); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* __CUTILS_ZYGOTE_H */ 33 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/netutils/dhcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _NETUTILS_DHCP_H_ 18 | #define _NETUTILS_DHCP_H_ 19 | 20 | #include 21 | #include 22 | 23 | __BEGIN_DECLS 24 | 25 | extern int do_dhcp(char *iname); 26 | extern int dhcp_do_request(const char *ifname, 27 | in_addr_t *ipaddr, 28 | in_addr_t *gateway, 29 | in_addr_t *mask, 30 | in_addr_t *dns1, 31 | in_addr_t *dns2, 32 | in_addr_t *server, 33 | uint32_t *lease); 34 | extern int dhcp_stop(const char *ifname); 35 | extern int dhcp_release_lease(const char *ifname); 36 | extern char *dhcp_get_errmsg(); 37 | 38 | __END_DECLS 39 | 40 | #endif /* _NETUTILS_DHCP_H_ */ 41 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/sysutils/FrameworkClient.h: -------------------------------------------------------------------------------- 1 | #ifndef _FRAMEWORK_CLIENT_H 2 | #define _FRAMEWORK_CLIENT_H 3 | 4 | #include "../../../frameworks/base/include/utils/List.h" 5 | 6 | #include 7 | 8 | class FrameworkClient { 9 | int mSocket; 10 | pthread_mutex_t mWriteMutex; 11 | 12 | public: 13 | FrameworkClient(int sock); 14 | virtual ~FrameworkClient() {} 15 | 16 | int sendMsg(const char *msg); 17 | int sendMsg(const char *msg, const char *data); 18 | }; 19 | 20 | typedef android::List FrameworkClientCollection; 21 | #endif 22 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/sysutils/FrameworkCommand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef __FRAMEWORK_CMD_HANDLER_H 17 | #define __FRAMEWORK_CMD_HANDLER_H 18 | 19 | #include "../../../frameworks/base/include/utils/List.h" 20 | 21 | class SocketClient; 22 | 23 | class FrameworkCommand { 24 | private: 25 | const char *mCommand; 26 | 27 | public: 28 | 29 | FrameworkCommand(const char *cmd); 30 | virtual ~FrameworkCommand() { } 31 | 32 | virtual int runCommand(SocketClient *c, int argc, char **argv) = 0; 33 | 34 | const char *getCommand() { return mCommand; } 35 | }; 36 | 37 | typedef android::List FrameworkCommandCollection; 38 | #endif 39 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/sysutils/FrameworkListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef _FRAMEWORKSOCKETLISTENER_H 17 | #define _FRAMEWORKSOCKETLISTENER_H 18 | 19 | #include "SocketListener.h" 20 | #include "FrameworkCommand.h" 21 | 22 | class SocketClient; 23 | 24 | class FrameworkListener : public SocketListener { 25 | public: 26 | static const int CMD_ARGS_MAX = 16; 27 | private: 28 | FrameworkCommandCollection *mCommands; 29 | 30 | public: 31 | FrameworkListener(const char *socketName); 32 | virtual ~FrameworkListener() {} 33 | 34 | protected: 35 | void registerCmd(FrameworkCommand *cmd); 36 | virtual bool onDataAvailable(SocketClient *c); 37 | 38 | private: 39 | void dispatchCommand(SocketClient *c, char *data); 40 | }; 41 | #endif 42 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/sysutils/NetlinkEvent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef _NETLINKEVENT_H 17 | #define _NETLINKEVENT_H 18 | 19 | #define NL_PARAMS_MAX 32 20 | 21 | class NetlinkEvent { 22 | int mSeq; 23 | char *mPath; 24 | int mAction; 25 | char *mSubsystem; 26 | char *mParams[NL_PARAMS_MAX]; 27 | 28 | public: 29 | const static int NlActionUnknown; 30 | const static int NlActionAdd; 31 | const static int NlActionRemove; 32 | const static int NlActionChange; 33 | 34 | NetlinkEvent(); 35 | virtual ~NetlinkEvent(); 36 | 37 | bool decode(char *buffer, int size); 38 | const char *findParam(const char *paramName); 39 | 40 | const char *getSubsystem() { return mSubsystem; } 41 | int getAction() { return mAction; } 42 | 43 | void dump(); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/sysutils/NetlinkListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef _NETLINKLISTENER_H 17 | #define _NETLINKLISTENER_H 18 | 19 | #include "SocketListener.h" 20 | 21 | class NetlinkEvent; 22 | 23 | class NetlinkListener : public SocketListener { 24 | char mBuffer[64 * 1024]; 25 | 26 | public: 27 | NetlinkListener(int socket); 28 | virtual ~NetlinkListener() {} 29 | 30 | protected: 31 | virtual bool onDataAvailable(SocketClient *cli); 32 | virtual void onEvent(NetlinkEvent *evt) = 0; 33 | }; 34 | #endif 35 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/sysutils/ServiceManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _SERVICE_MANAGER_H 18 | #define _SERVICE_MANAGER_H 19 | 20 | class ServiceManager { 21 | public: 22 | ServiceManager(); 23 | virtual ~ServiceManager() {} 24 | 25 | int start(const char *name); 26 | int stop(const char *name); 27 | bool isRunning(const char *name); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/sysutils/SocketClient.h: -------------------------------------------------------------------------------- 1 | #ifndef _SOCKET_CLIENT_H 2 | #define _SOCKET_CLIENT_H 3 | 4 | #include "../../../frameworks/base/include/utils/List.h" 5 | 6 | #include 7 | #include 8 | 9 | class SocketClient { 10 | int mSocket; 11 | pthread_mutex_t mWriteMutex; 12 | 13 | /* Peer process ID */ 14 | pid_t mPid; 15 | 16 | /* Peer user ID */ 17 | uid_t mUid; 18 | 19 | /* Peer group ID */ 20 | gid_t mGid; 21 | 22 | /* Reference count (starts at 1) */ 23 | pthread_mutex_t mRefCountMutex; 24 | int mRefCount; 25 | 26 | public: 27 | SocketClient(int sock); 28 | virtual ~SocketClient() {} 29 | 30 | int getSocket() { return mSocket; } 31 | pid_t getPid() const { return mPid; } 32 | uid_t getUid() const { return mUid; } 33 | gid_t getGid() const { return mGid; } 34 | 35 | // Send null-terminated C strings: 36 | int sendMsg(int code, const char *msg, bool addErrno); 37 | int sendMsg(const char *msg); 38 | 39 | // Sending binary data: 40 | int sendData(const void *data, int len); 41 | 42 | // Optional reference counting. Reference count starts at 1. If 43 | // it's decremented to 0, it deletes itself. 44 | // SocketListener creates a SocketClient (at refcount 1) and calls 45 | // decRef() when it's done with the client. 46 | void incRef(); 47 | bool decRef(); // returns true at 0 (but note: SocketClient already deleted) 48 | }; 49 | 50 | typedef android::List SocketClientCollection; 51 | #endif 52 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/sysutils/SocketListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef _SOCKETLISTENER_H 17 | #define _SOCKETLISTENER_H 18 | 19 | #include 20 | 21 | #include 22 | 23 | class SocketListener { 24 | int mSock; 25 | const char *mSocketName; 26 | SocketClientCollection *mClients; 27 | pthread_mutex_t mClientsLock; 28 | bool mListen; 29 | int mCtrlPipe[2]; 30 | pthread_t mThread; 31 | 32 | public: 33 | SocketListener(const char *socketName, bool listen); 34 | SocketListener(int socketFd, bool listen); 35 | 36 | virtual ~SocketListener(); 37 | int startListener(); 38 | int stopListener(); 39 | 40 | void sendBroadcast(int code, const char *msg, bool addErrno); 41 | void sendBroadcast(const char *msg); 42 | 43 | protected: 44 | virtual bool onDataAvailable(SocketClient *c) = 0; 45 | 46 | private: 47 | static void *threadStart(void *obj); 48 | void runListener(); 49 | }; 50 | #endif 51 | -------------------------------------------------------------------------------- /jni/libcutils/jni/include/zipfile/zipfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _ZIPFILE_ZIPFILE_H 18 | #define _ZIPFILE_ZIPFILE_H 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | typedef void* zipfile_t; 27 | typedef void* zipentry_t; 28 | 29 | // Provide a buffer. Returns NULL on failure. 30 | zipfile_t init_zipfile(const void* data, size_t size); 31 | 32 | // Release the zipfile resources. 33 | void release_zipfile(zipfile_t file); 34 | 35 | // Get a named entry object. Returns NULL if it doesn't exist 36 | // or if we won't be able to decompress it. The zipentry_t is 37 | // freed by release_zipfile() 38 | zipentry_t lookup_zipentry(zipfile_t file, const char* entryName); 39 | 40 | // Return the size of the entry. 41 | size_t get_zipentry_size(zipentry_t entry); 42 | 43 | // return the filename of this entry, you own the memory returned 44 | char* get_zipentry_name(zipentry_t entry); 45 | 46 | // The buffer must be 1.001 times the buffer size returned 47 | // by get_zipentry_size. Returns nonzero on failure. 48 | int decompress_zipentry(zipentry_t entry, void* buf, int bufsize); 49 | 50 | // iterate through the entries in the zip file. pass a pointer to 51 | // a void* initialized to NULL to start. Returns NULL when done 52 | zipentry_t iterate_zipfile(zipfile_t file, void** cookie); 53 | 54 | #ifdef __cplusplus 55 | } // extern "C" 56 | #endif 57 | 58 | #endif // _ZIPFILE_ZIPFILE_H 59 | -------------------------------------------------------------------------------- /jni/libcutils/jni/iosched_policy.c: -------------------------------------------------------------------------------- 1 | 2 | /* libs/cutils/iosched_policy.c 3 | ** 4 | ** Copyright 2007, The Android Open Source Project 5 | ** 6 | ** Licensed under the Apache License, Version 2.0 (the "License"); 7 | ** you may not use this file except in compliance with the License. 8 | ** You may obtain a copy of the License at 9 | ** 10 | ** http://www.apache.org/licenses/LICENSE-2.0 11 | ** 12 | ** Unless required by applicable law or agreed to in writing, software 13 | ** distributed under the License is distributed on an "AS IS" BASIS, 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ** See the License for the specific language governing permissions and 16 | ** limitations under the License. 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #ifdef HAVE_SCHED_H 27 | 28 | #include 29 | 30 | extern int ioprio_set(int which, int who, int ioprio); 31 | 32 | enum { 33 | WHO_PROCESS = 1, 34 | WHO_PGRP, 35 | WHO_USER, 36 | }; 37 | 38 | #define CLASS_SHIFT 13 39 | #define IOPRIO_NORM 4 40 | 41 | int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio) { 42 | #ifdef HAVE_ANDROID_OS 43 | if (ioprio_set(WHO_PROCESS, pid, ioprio | (clazz << CLASS_SHIFT))) { 44 | return -1; 45 | } 46 | #endif 47 | return 0; 48 | } 49 | 50 | int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio) { 51 | #ifdef HAVE_ANDROID_OS 52 | int rc; 53 | 54 | if ((rc = ioprio_get(WHO_PROCESS, pid)) < 0) { 55 | return -1; 56 | } 57 | 58 | *clazz = (rc >> CLASS_SHIFT); 59 | *ioprio = (rc & 0xff); 60 | #else 61 | *clazz = IoSchedClass_NONE; 62 | *ioprio = 0; 63 | #endif 64 | return 0; 65 | } 66 | 67 | #endif /* HAVE_SCHED_H */ 68 | -------------------------------------------------------------------------------- /jni/libcutils/jni/load_file.c: -------------------------------------------------------------------------------- 1 | /* libs/cutils/load_file.c 2 | ** 3 | ** Copyright 2006, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | void *load_file(const char *fn, unsigned *_sz) 23 | { 24 | char *data; 25 | int sz; 26 | int fd; 27 | 28 | data = 0; 29 | fd = open(fn, O_RDONLY); 30 | if(fd < 0) return 0; 31 | 32 | sz = lseek(fd, 0, SEEK_END); 33 | if(sz < 0) goto oops; 34 | 35 | if(lseek(fd, 0, SEEK_SET) != 0) goto oops; 36 | 37 | data = (char*) malloc(sz + 1); 38 | if(data == 0) goto oops; 39 | 40 | if(read(fd, data, sz) != sz) goto oops; 41 | close(fd); 42 | data[sz] = 0; 43 | 44 | if(_sz) *_sz = sz; 45 | return data; 46 | 47 | oops: 48 | close(fd); 49 | if(data != 0) free(data); 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /jni/libcutils/jni/loghack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This is a temporary hack to enable logging from cutils. 19 | */ 20 | 21 | #ifndef _CUTILS_LOGHACK_H 22 | #define _CUTILS_LOGHACK_H 23 | 24 | #ifdef HAVE_ANDROID_OS 25 | #include 26 | #else 27 | #include 28 | #define LOG(level, ...) \ 29 | ((void)printf("cutils:" level "/" LOG_TAG ": " __VA_ARGS__)) 30 | #define LOGV(...) LOG("V", __VA_ARGS__) 31 | #define LOGD(...) LOG("D", __VA_ARGS__) 32 | #define LOGI(...) LOG("I", __VA_ARGS__) 33 | #define LOGW(...) LOG("W", __VA_ARGS__) 34 | #define LOGE(...) LOG("E", __VA_ARGS__) 35 | #define LOG_ALWAYS_FATAL(...) do { LOGE(__VA_ARGS__); exit(1); } while (0) 36 | #endif 37 | 38 | #endif // _CUTILS_LOGHACK_H 39 | -------------------------------------------------------------------------------- /jni/libcutils/jni/native_handle.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define LOG_TAG "NativeHandle" 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | native_handle_t* native_handle_create(int numFds, int numInts) 29 | { 30 | native_handle_t* h = malloc( 31 | sizeof(native_handle_t) + sizeof(int)*(numFds+numInts)); 32 | 33 | h->version = sizeof(native_handle_t); 34 | h->numFds = numFds; 35 | h->numInts = numInts; 36 | return h; 37 | } 38 | 39 | int native_handle_delete(native_handle_t* h) 40 | { 41 | if (h) { 42 | if (h->version != sizeof(native_handle_t)) 43 | return -EINVAL; 44 | free(h); 45 | } 46 | return 0; 47 | } 48 | 49 | int native_handle_close(const native_handle_t* h) 50 | { 51 | if (h->version != sizeof(native_handle_t)) 52 | return -EINVAL; 53 | 54 | const int numFds = h->numFds; 55 | int i; 56 | for (i=0 ; idata[i]); 58 | } 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /jni/libcutils/jni/socket_inaddr_any_server.c: -------------------------------------------------------------------------------- 1 | /* libs/cutils/socket_inaddr_any_server.c 2 | ** 3 | ** Copyright 2006, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #ifndef HAVE_WINSOCK 27 | #include 28 | #include 29 | #include 30 | #include 31 | #endif 32 | 33 | #define LISTEN_BACKLOG 4 34 | 35 | /* open listen() port on any interface */ 36 | int socket_inaddr_any_server(int port, int type) 37 | { 38 | struct sockaddr_in addr; 39 | size_t alen; 40 | int s, n; 41 | 42 | memset(&addr, 0, sizeof(addr)); 43 | addr.sin_family = AF_INET; 44 | addr.sin_port = htons(port); 45 | addr.sin_addr.s_addr = htonl(INADDR_ANY); 46 | 47 | s = socket(AF_INET, type, 0); 48 | if(s < 0) return -1; 49 | 50 | n = 1; 51 | setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n)); 52 | 53 | if(bind(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) { 54 | close(s); 55 | return -1; 56 | } 57 | 58 | if (type == SOCK_STREAM) { 59 | int ret; 60 | 61 | ret = listen(s, LISTEN_BACKLOG); 62 | 63 | if (ret < 0) { 64 | close(s); 65 | return -1; 66 | } 67 | } 68 | 69 | return s; 70 | } 71 | -------------------------------------------------------------------------------- /jni/libcutils/jni/socket_local.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __SOCKET_LOCAL_H 18 | #define __SOCKET_LOCAL_H 19 | 20 | #define FILESYSTEM_SOCKET_PREFIX "/tmp/" 21 | #define ANDROID_RESERVED_SOCKET_PREFIX "/dev/socket/" 22 | 23 | /* 24 | * Set up a given sockaddr_un, to have it refer to the given 25 | * name in the given namespace. The namespace must be one 26 | * of ANDROID_SOCKET_NAMESPACE_ABSTRACT, 27 | * ANDROID_SOCKET_NAMESPACE_RESERVED, or 28 | * ANDROID_SOCKET_NAMESPACE_FILESYSTEM. Upon success, 29 | * the pointed at sockaddr_un is filled in and the pointed at 30 | * socklen_t is set to indicate the final length. This function 31 | * will fail if the namespace is invalid (not one of the indicated 32 | * constants) or if the name is too long. 33 | * 34 | * @return 0 on success or -1 on failure 35 | */ 36 | int socket_make_sockaddr_un(const char *name, int namespaceId, 37 | struct sockaddr_un *p_addr, socklen_t *alen); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /jni/libcutils/jni/socket_loopback_client.c: -------------------------------------------------------------------------------- 1 | /* libs/cutils/socket_loopback_client.c 2 | ** 3 | ** Copyright 2006, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #ifndef HAVE_WINSOCK 27 | #include 28 | #include 29 | #include 30 | #include 31 | #endif 32 | 33 | /* Connect to port on the loopback IP interface. type is 34 | * SOCK_STREAM or SOCK_DGRAM. 35 | * return is a file descriptor or -1 on error 36 | */ 37 | int socket_loopback_client(int port, int type) 38 | { 39 | struct sockaddr_in addr; 40 | socklen_t alen; 41 | int s; 42 | 43 | memset(&addr, 0, sizeof(addr)); 44 | addr.sin_family = AF_INET; 45 | addr.sin_port = htons(port); 46 | addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); 47 | 48 | s = socket(AF_INET, type, 0); 49 | if(s < 0) return -1; 50 | 51 | if(connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) { 52 | close(s); 53 | return -1; 54 | } 55 | 56 | return s; 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /jni/libcutils/jni/socket_loopback_server.c: -------------------------------------------------------------------------------- 1 | /* libs/cutils/socket_loopback_server.c 2 | ** 3 | ** Copyright 2006, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #define LISTEN_BACKLOG 4 27 | 28 | #ifndef HAVE_WINSOCK 29 | #include 30 | #include 31 | #include 32 | #include 33 | #endif 34 | 35 | /* open listen() port on loopback interface */ 36 | int socket_loopback_server(int port, int type) 37 | { 38 | struct sockaddr_in addr; 39 | size_t alen; 40 | int s, n; 41 | 42 | memset(&addr, 0, sizeof(addr)); 43 | addr.sin_family = AF_INET; 44 | addr.sin_port = htons(port); 45 | addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); 46 | 47 | s = socket(AF_INET, type, 0); 48 | if(s < 0) return -1; 49 | 50 | n = 1; 51 | setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n)); 52 | 53 | if(bind(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) { 54 | close(s); 55 | return -1; 56 | } 57 | 58 | if (type == SOCK_STREAM) { 59 | int ret; 60 | 61 | ret = listen(s, LISTEN_BACKLOG); 62 | 63 | if (ret < 0) { 64 | close(s); 65 | return -1; 66 | } 67 | } 68 | 69 | return s; 70 | } 71 | 72 | -------------------------------------------------------------------------------- /jni/libcutils/jni/socket_network_client.c: -------------------------------------------------------------------------------- 1 | /* libs/cutils/socket_network_client.c 2 | ** 3 | ** Copyright 2006, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #ifndef HAVE_WINSOCK 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #endif 33 | 34 | 35 | /* Connect to port on the IP interface. type is 36 | * SOCK_STREAM or SOCK_DGRAM. 37 | * return is a file descriptor or -1 on error 38 | */ 39 | int socket_network_client(const char *host, int port, int type) 40 | { 41 | struct hostent *hp; 42 | struct sockaddr_in addr; 43 | socklen_t alen; 44 | int s; 45 | 46 | hp = gethostbyname(host); 47 | if(hp == 0) return -1; 48 | 49 | memset(&addr, 0, sizeof(addr)); 50 | addr.sin_family = hp->h_addrtype; 51 | addr.sin_port = htons(port); 52 | memcpy(&addr.sin_addr, hp->h_addr, hp->h_length); 53 | 54 | s = socket(hp->h_addrtype, type, 0); 55 | if(s < 0) return -1; 56 | 57 | if(connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) { 58 | close(s); 59 | return -1; 60 | } 61 | 62 | return s; 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /jni/libcutils/jni/uevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | /** 25 | * Like recv(), but checks that messages actually originate from the kernel. 26 | */ 27 | ssize_t uevent_checked_recv(int socket, void *buffer, size_t length) { 28 | struct iovec iov = { buffer, length }; 29 | struct sockaddr_nl addr; 30 | char control[CMSG_SPACE(sizeof(struct ucred))]; 31 | struct msghdr hdr = { 32 | &addr, 33 | sizeof(addr), 34 | &iov, 35 | 1, 36 | control, 37 | sizeof(control), 38 | 0, 39 | }; 40 | 41 | ssize_t n = recvmsg(socket, &hdr, 0); 42 | if (n <= 0) { 43 | return n; 44 | } 45 | 46 | if (addr.nl_groups == 0 || addr.nl_pid != 0) { 47 | /* ignoring non-kernel or unicast netlink message */ 48 | goto out; 49 | } 50 | 51 | struct cmsghdr *cmsg = CMSG_FIRSTHDR(&hdr); 52 | if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) { 53 | /* ignoring netlink message with no sender credentials */ 54 | goto out; 55 | } 56 | 57 | struct ucred *cred = (struct ucred *)CMSG_DATA(cmsg); 58 | if (cred->uid != 0) { 59 | /* ignoring netlink message from non-root user */ 60 | goto out; 61 | } 62 | 63 | return n; 64 | 65 | out: 66 | /* clear residual potentially malicious data */ 67 | bzero(buffer, length); 68 | errno = EIO; 69 | return -1; 70 | } 71 | -------------------------------------------------------------------------------- /jni/libcutils/jni/uio.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef HAVE_SYS_UIO_H 18 | 19 | #include 20 | #include 21 | 22 | int readv( int fd, struct iovec* vecs, int count ) 23 | { 24 | int total = 0; 25 | 26 | for ( ; count > 0; count--, vecs++ ) { 27 | const char* buf = vecs->iov_base; 28 | int len = vecs->iov_len; 29 | 30 | while (len > 0) { 31 | int ret = read( fd, buf, len ); 32 | if (ret < 0) { 33 | if (total == 0) 34 | total = -1; 35 | goto Exit; 36 | } 37 | if (ret == 0) 38 | goto Exit; 39 | 40 | total += ret; 41 | buf += ret; 42 | len -= ret; 43 | } 44 | } 45 | Exit: 46 | return total; 47 | } 48 | 49 | int writev( int fd, const struct iovec* vecs, int count ) 50 | { 51 | int total = 0; 52 | 53 | for ( ; count > 0; count--, vecs++ ) { 54 | const char* buf = (const char*)vecs->iov_base; 55 | int len = (int)vecs->iov_len; 56 | 57 | while (len > 0) { 58 | int ret = write( fd, buf, len ); 59 | if (ret < 0) { 60 | if (total == 0) 61 | total = -1; 62 | goto Exit; 63 | } 64 | if (ret == 0) 65 | goto Exit; 66 | 67 | total += ret; 68 | buf += ret; 69 | len -= ret; 70 | } 71 | } 72 | Exit: 73 | return total; 74 | } 75 | 76 | #endif /* !HAVE_SYS_UIO_H */ 77 | -------------------------------------------------------------------------------- /jni/libcutils/ndk-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | export NDK_PROJECT_PATH=. 4 | /cygdrive/u/Programs/android-ndk/ndk-build 5 | -------------------------------------------------------------------------------- /jni/libcutils/source.txt: -------------------------------------------------------------------------------- 1 | http://android.git.kernel.org/ 2 | 3 | [platform/system/core.git] / libcutils / Android.mk 4 | [platform/system/core.git] / liblog / Android.mk 5 | 6 | -------------------------------------------------------------------------------- /jni/libhost/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_SRC_FILES:= \ 5 | CopyFile.c \ 6 | pseudolocalize.cpp 7 | 8 | ifeq ($(HOST_OS),cygwin) 9 | LOCAL_CFLAGS += -DWIN32_EXE 10 | endif 11 | ifeq ($(HOST_OS),windows) 12 | ifeq ($(USE_MINGW),) 13 | # Case where we're building windows but not under linux (so it must be cygwin) 14 | LOCAL_CFLAGS += -DUSE_MINGW 15 | endif 16 | endif 17 | ifeq ($(HOST_OS),darwin) 18 | LOCAL_CFLAGS += -DMACOSX_RSRC 19 | endif 20 | ifeq ($(HOST_OS),linux) 21 | endif 22 | 23 | LOCAL_MODULE:= libhost 24 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include 25 | 26 | include $(BUILD_SHARED_LIBRARY) 27 | 28 | -------------------------------------------------------------------------------- /jni/libhost/jni/Android.mk.original: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_SRC_FILES:= \ 5 | CopyFile.c \ 6 | pseudolocalize.cpp 7 | 8 | ifeq ($(HOST_OS),cygwin) 9 | LOCAL_CFLAGS += -DWIN32_EXE 10 | endif 11 | ifeq ($(HOST_OS),darwin) 12 | LOCAL_CFLAGS += -DMACOSX_RSRC 13 | endif 14 | ifeq ($(HOST_OS),linux) 15 | endif 16 | 17 | LOCAL_MODULE:= libhost 18 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include 19 | 20 | # acp uses libhost, so we can't use 21 | # acp to install libhost. 22 | LOCAL_ACP_UNAVAILABLE:= true 23 | 24 | include $(BUILD_HOST_STATIC_LIBRARY) 25 | 26 | -------------------------------------------------------------------------------- /jni/libhost/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | -------------------------------------------------------------------------------- /jni/libhost/jni/include/host/CopyFile.h: -------------------------------------------------------------------------------- 1 | #ifndef _HOST_COPYFILE_H 2 | #define _HOST_COPYFILE_H 3 | 4 | #include 5 | #include 6 | 7 | #if __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | // command line options 12 | enum { 13 | COPY_NO_DEREFERENCE = 0x00010000, // copy symlink link instead of target 14 | COPY_TRY_EXE = 0x00020000, // on Win32, try adding '.exe' to filename 15 | COPY_FORCE = 0x00040000, // override access permissions 16 | COPY_PERMISSIONS = 0x00080000, // preserve mode, ownership, timestamps 17 | COPY_TIMESTAMPS = 0x00100000, // preserve mode, ownership, timestamps 18 | COPY_RECURSIVE = 0x00200000, // copy directories 19 | COPY_UPDATE_ONLY = 0x00400000, // only copy if source file is newer 20 | COPY_VERBOSE_MASK = 0x000000ff // talk lots 21 | }; 22 | 23 | int copyFile(const char* src, const char* dst, unsigned int options); 24 | 25 | #if __cplusplus 26 | } // extern "C" 27 | #endif 28 | 29 | #endif // _HOST_COPYFILE_H 30 | 31 | -------------------------------------------------------------------------------- /jni/libhost/jni/include/host/Directories.h: -------------------------------------------------------------------------------- 1 | #ifndef HOST_MKDIRS_H 2 | #define HOST_MKDIRS_H 3 | 4 | #include 5 | 6 | std::string parent_dir(const std::string& path); 7 | 8 | extern "C" int mkdirs(const char* path); 9 | 10 | #endif // HOST_MKDIRS_H 11 | -------------------------------------------------------------------------------- /jni/libhost/jni/include/host/pseudolocalize.h: -------------------------------------------------------------------------------- 1 | #ifndef HOST_PSEUDOLOCALIZE_H 2 | #define HOST_PSEUDOLOCALIZE_H 3 | 4 | #include 5 | 6 | std::string pseudolocalize_string(const std::string& source); 7 | 8 | #endif // HOST_PSEUDOLOCALIZE_H 9 | 10 | -------------------------------------------------------------------------------- /jni/libhost/jni/list.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | public class list { 4 | private static char nibble(int c) { 5 | return (char)(c < 10 ? ('0' + c) : ('a' + (c-10))); 6 | } 7 | public static void main(String[] argv) 8 | { 9 | ByteArrayOutputStream stream = new ByteArrayOutputStream(100); 10 | OutputStreamWriter writer = null; 11 | try { 12 | writer = new OutputStreamWriter(stream, "utf-8"); 13 | } catch (UnsupportedEncodingException e) { 14 | e.printStackTrace(System.err); 15 | } 16 | 17 | int n = Integer.parseInt(argv[1], 16); 18 | try { 19 | writer.write(n); 20 | writer.close(); 21 | } catch (IOException e) { 22 | e.printStackTrace(System.err); 23 | } 24 | 25 | byte[] array = stream.toByteArray(); 26 | 27 | System.out.print(" case '" + argv[0] + "': return \""); 28 | for (int i=0; i> 4) & 0x0f) + nibble(b & 0xf)); 31 | } 32 | System.out.println("\";"); 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /jni/libhost/ndk-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | export NDK_PROJECT_PATH=. 4 | /cygdrive/u/Programs/android-ndk/ndk-build 5 | -------------------------------------------------------------------------------- /jni/libhost/source.txt: -------------------------------------------------------------------------------- 1 | http://android.git.kernel.org/ 2 | 3 | [platform/build.git] / libs / host / Android.mk 4 | 5 | -------------------------------------------------------------------------------- /jni/liblog/jni/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2008 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | LOCAL_PATH := $(my-dir) 17 | include $(CLEAR_VARS) 18 | 19 | liblog_sources := logd_write.c 20 | 21 | # some files must not be compiled when building against Mingw 22 | # they correspond to features not used by our host development tools 23 | # which are also hard or even impossible to port to native Win32 24 | WITH_MINGW := 25 | ifeq ($(HOST_OS),windows) 26 | ifeq ($(strip $(USE_CYGWIN)),) 27 | WITH_MINGW := true 28 | endif 29 | endif 30 | # USE_MINGW is defined when we build against Mingw on Linux 31 | ifneq ($(strip $(USE_MINGW)),) 32 | WITH_MINGW := true 33 | endif 34 | 35 | ifndef WITH_MINGW 36 | liblog_sources += \ 37 | logprint.c \ 38 | event_tag_map.c 39 | endif 40 | 41 | # Shared library for target 42 | # ========================= 43 | 44 | LOCAL_MODULE := liblog 45 | LOCAL_SRC_FILES := $(liblog_sources) 46 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../libcutils/jni/include 47 | LOCAL_CFLAGS += -DHAVE_PTHREADS 48 | include $(BUILD_SHARED_LIBRARY) 49 | -------------------------------------------------------------------------------- /jni/liblog/jni/Application.mk: -------------------------------------------------------------------------------- 1 | # needed for compiling libhost 2 | APP_STL := gnustl_static 3 | APP_PLATFORM := android-9 4 | -------------------------------------------------------------------------------- /jni/liblog/ndk-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | export NDK_PROJECT_PATH=. 4 | /cygdrive/u/Programs/android-ndk/ndk-build 5 | -------------------------------------------------------------------------------- /jni/liblog/source.txt: -------------------------------------------------------------------------------- 1 | http://android.git.kernel.org/ 2 | 3 | [platform/system/core.git] / liblog / 4 | 5 | 6 | -------------------------------------------------------------------------------- /jni/libpng/jni/ANNOUNCE: -------------------------------------------------------------------------------- 1 | 2 | Libpng 1.2.44 - June 26, 2010 3 | 4 | This is a public release of libpng, intended for use in production codes. 5 | 6 | Files available for download: 7 | 8 | Source files with LF line endings (for Unix/Linux) and with a 9 | "configure" script 10 | 11 | libpng-1.2.44.tar.xz (LZMA-compressed, recommended) 12 | libpng-1.2.44.tar.gz 13 | libpng-1.2.44.tar.bz2 14 | 15 | Source files with LF line endings (for Unix/Linux) without the 16 | "configure" script 17 | 18 | libpng-1.2.44-no-config.tar.xz (LZMA-compressed, recommended) 19 | libpng-1.2.44-no-config.tar.gz 20 | libpng-1.2.44-no-config.tar.bz2 21 | 22 | Source files with CRLF line endings (for Windows), without the 23 | "configure" script 24 | 25 | lpng1244.zip 26 | lpng1244.7z 27 | lpng1244.tar.bz2 28 | 29 | Project files 30 | 31 | libpng-1.2.44-project-netware.zip 32 | libpng-1.2.44-project-wince.zip 33 | 34 | Other information: 35 | 36 | libpng-1.2.44-README.txt 37 | libpng-1.2.44-KNOWNBUGS.txt 38 | libpng-1.2.44-LICENSE.txt 39 | libpng-1.2.44-Y2K-compliance.txt 40 | libpng-1.2.44-[previous version]-diff.txt 41 | 42 | Changes since the last public release (1.2.43): 43 | 44 | version 1.2.44 [June 26, 2010] 45 | 46 | Rewrote png_process_IDAT_data to consistently treat extra data as warnings 47 | and handle end conditions more cleanly. 48 | Removed the now-redundant check for out-of-bounds new_row from example.c 49 | 50 | 51 | Send comments/corrections/commendations to png-mng-implement at lists.sf.net 52 | 53 | (subscription required; visit 54 | https://lists.sourceforge.net/lists/listinfo/png-mng-implement 55 | to subscribe) or to glennrp at users.sourceforge.net 56 | 57 | Glenn R-P 58 | -------------------------------------------------------------------------------- /jni/libpng/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | # We need to build this for both the device (as a shared library) 4 | # and the host (as a static library for tools to use). 5 | 6 | common_SRC_FILES := \ 7 | png.c \ 8 | pngerror.c \ 9 | pnggccrd.c \ 10 | pngget.c \ 11 | pngmem.c \ 12 | pngpread.c \ 13 | pngread.c \ 14 | pngrio.c \ 15 | pngrtran.c \ 16 | pngrutil.c \ 17 | pngset.c \ 18 | pngtrans.c \ 19 | pngvcrd.c \ 20 | pngwio.c \ 21 | pngwrite.c \ 22 | pngwtran.c \ 23 | pngwutil.c 24 | 25 | ifeq ($(HOST_OS),windows) 26 | ifeq ($(USE_MINGW),) 27 | # Case where we're building windows but not under linux (so it must be cygwin) 28 | # In this case, gcc cygwin doesn't recognize -fvisibility=hidden 29 | $(info libpng: Ignoring gcc flag $(common_CFLAGS) on Cygwin) 30 | common_CFLAGS := 31 | endif 32 | endif 33 | 34 | common_C_INCLUDES += 35 | 36 | common_COPY_HEADERS_TO := libpng 37 | common_COPY_HEADERS := png.h pngconf.h pngusr.h 38 | 39 | # For the device 40 | # ===================================================== 41 | 42 | include $(CLEAR_VARS) 43 | 44 | LOCAL_SRC_FILES := $(common_SRC_FILES) 45 | LOCAL_CFLAGS += $(common_CFLAGS) 46 | LOCAL_LDLIBS := -lz 47 | 48 | LOCAL_MODULE:= libpng 49 | 50 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 51 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 52 | 53 | include $(BUILD_SHARED_LIBRARY) 54 | -------------------------------------------------------------------------------- /jni/libpng/jni/Android.mk.original: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | # We need to build this for both the device (as a shared library) 4 | # and the host (as a static library for tools to use). 5 | 6 | common_SRC_FILES := \ 7 | png.c \ 8 | pngerror.c \ 9 | pnggccrd.c \ 10 | pngget.c \ 11 | pngmem.c \ 12 | pngpread.c \ 13 | pngread.c \ 14 | pngrio.c \ 15 | pngrtran.c \ 16 | pngrutil.c \ 17 | pngset.c \ 18 | pngtrans.c \ 19 | pngvcrd.c \ 20 | pngwio.c \ 21 | pngwrite.c \ 22 | pngwtran.c \ 23 | pngwutil.c 24 | 25 | common_CFLAGS := -fvisibility=hidden ## -fomit-frame-pointer 26 | 27 | ifeq ($(HOST_OS),windows) 28 | ifeq ($(USE_MINGW),) 29 | # Case where we're building windows but not under linux (so it must be cygwin) 30 | # In this case, gcc cygwin doesn't recognize -fvisibility=hidden 31 | $(info libpng: Ignoring gcc flag $(common_CFLAGS) on Cygwin) 32 | common_CFLAGS := 33 | endif 34 | endif 35 | 36 | common_C_INCLUDES += 37 | 38 | common_COPY_HEADERS_TO := libpng 39 | common_COPY_HEADERS := png.h pngconf.h pngusr.h 40 | 41 | # For the host 42 | # ===================================================== 43 | 44 | include $(CLEAR_VARS) 45 | 46 | LOCAL_SRC_FILES := $(common_SRC_FILES) 47 | LOCAL_CFLAGS += $(common_CFLAGS) 48 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) external/zlib 49 | 50 | LOCAL_MODULE:= libpng 51 | 52 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 53 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 54 | 55 | include $(BUILD_HOST_STATIC_LIBRARY) 56 | 57 | 58 | # For the device 59 | # ===================================================== 60 | 61 | include $(CLEAR_VARS) 62 | 63 | LOCAL_SRC_FILES := $(common_SRC_FILES) 64 | LOCAL_CFLAGS += $(common_CFLAGS) 65 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) \ 66 | external/zlib 67 | LOCAL_SHARED_LIBRARIES := \ 68 | libz 69 | 70 | LOCAL_MODULE:= libpng 71 | 72 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 73 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 74 | 75 | include $(BUILD_STATIC_LIBRARY) 76 | 77 | 78 | -------------------------------------------------------------------------------- /jni/libpng/jni/CleanSpec.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # If you don't need to do a full clean build but would like to touch 17 | # a file or delete some intermediate files, add a clean step to the end 18 | # of the list. These steps will only be run once, if they haven't been 19 | # run before. 20 | # 21 | # E.g.: 22 | # $(call add-clean-step, touch -c external/sqlite/sqlite3.h) 23 | # $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) 24 | # 25 | # Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with 26 | # files that are missing or have been moved. 27 | # 28 | # Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. 29 | # Use $(OUT_DIR) to refer to the "out" directory. 30 | # 31 | # If you need to re-do something that's already mentioned, just copy 32 | # the command and add it to the bottom of the list. E.g., if a change 33 | # that you made last week required touching a file and a change you 34 | # made today requires touching the same file, just copy the old 35 | # touch step and add it to the end of the list. 36 | # 37 | # ************************************************ 38 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 39 | # ************************************************ 40 | 41 | # For example: 42 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) 43 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) 44 | #$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) 45 | #$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) 46 | 47 | # ************************************************ 48 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 49 | # ************************************************ 50 | -------------------------------------------------------------------------------- /jni/libpng/jni/KNOWNBUG: -------------------------------------------------------------------------------- 1 | 2 | Known bugs in libpng version 1.2.44 3 | 4 | 1. December 4, 2009: The PNG_NO_ERROR_NUMBERS macro was inadvertently 5 | defined in libpng-1.2.41/pngconf.h, which may cause a problem with 6 | building a binary-compatible library. 7 | 8 | STATUS: This will be fixed in libpng-1.2.42. In the meantime, simply 9 | delete the definition from line : 10 | 11 | 2. February 23, 2006: The custom makefiles don't build libpng with -lz. 12 | 13 | STATUS: This is a subject of debate. The change will probably be made 14 | as a part of a major overhaul of the makefiles in libpng version 1.4.0. 15 | 16 | 3. February 24, 2006: The Makefile generated by the "configure" script 17 | fails to install symbolic links 18 | libpng12.so => libpng12.so.0.1.2.9betaN 19 | that are generated by the custom makefiles. 20 | 21 | 4. September 4, 2007: There is a report that pngtest crashes on MacOS 10. 22 | 23 | STATUS: workarounds are 24 | 1) Compile without optimization (crashes are observed with 25 | -arch i386 and -O2 or -O3, using gcc-4.0.1). 26 | 2) Compile pngtest.c with PNG_DEBUG defined (the bug goes away if 27 | you try to look at it). 28 | 3) Ignore the crash. The library itself seems to be OK. 29 | 30 | -------------------------------------------------------------------------------- /jni/libpng/jni/MODULE_LICENSE_BSD_LIKE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/libpng/jni/MODULE_LICENSE_BSD_LIKE -------------------------------------------------------------------------------- /jni/libpng/jni/TODO: -------------------------------------------------------------------------------- 1 | TODO - list of things to do for libpng: 2 | 3 | Final bug fixes. 4 | Improve API by hiding the png_struct and png_info structs. 5 | Finish work on the no-floating-point version (including gamma compensation) 6 | Better C++ wrapper/full C++ implementation? 7 | Fix problem with C++ and EXTERN "C". 8 | cHRM transformation. 9 | Improve setjmp/longjmp usage or remove it in favor of returning error codes. 10 | Add "grayscale->palette" transformation and "palette->grayscale" detection. 11 | Improved dithering. 12 | Multi-lingual error and warning message support. 13 | Complete sRGB transformation (presently it simply uses gamma=0.45455). 14 | Man pages for function calls. 15 | Better documentation. 16 | Better filter selection 17 | (counting huffman bits/precompression? filter inertia? filter costs?). 18 | Histogram creation. 19 | Text conversion between different code pages (Latin-1 -> Mac and DOS). 20 | Should we always malloc 2^bit_depth PLTE/tRNS/hIST entries for safety? 21 | Build gamma tables using fixed point (and do away with floating point entirely). 22 | Use greater precision when changing to linear gamma for compositing against 23 | background and doing rgb-to-gray transformation. 24 | Investigate pre-incremented loop counters and other loop constructions. 25 | Add interpolated method of handling interlacing. 26 | -------------------------------------------------------------------------------- /jni/libpng/jni/ThirdPartyProject.prop: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Google Inc. All Rights Reserved. 2 | #Fri Jul 16 10:03:09 PDT 2010 3 | currentVersion=1.4.3 4 | version=1.2.38 5 | isNative=true 6 | feedurl=http\://www.libpng.org/pub/png/libpng.html 7 | name=libpng 8 | keywords=libpng 9 | onDevice=true 10 | homepage=http\://www.libpng.org/pub/png/libpng.html 11 | -------------------------------------------------------------------------------- /jni/libpng/jni/autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # a quick hack script to generate necessary files from 3 | # auto* tools. 4 | # 5 | # WARNING: if you run this you will change the versions 6 | # of the tools which are used and, maybe, required! 7 | touch Makefile.am configure.ac 8 | { 9 | echo "running libtoolize" >&2 10 | libtoolize --force --copy --automake 11 | } && { 12 | echo "running aclocal" >&2 13 | aclocal 14 | } && { 15 | echo "running autoheader [ignore the warnings]" >&2 16 | autoheader 17 | } && { 18 | echo "running automake" >&2 19 | automake --force-missing --foreign -a -c 20 | } && { 21 | echo "running autoconf" >&2 22 | autoconf 23 | } && 24 | echo "autogen complete" >&2 || 25 | echo "ERROR: autogen.sh failed, autogen is incomplete" >&2 26 | -------------------------------------------------------------------------------- /jni/libpng/jni/pngbar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/libpng/jni/pngbar.jpg -------------------------------------------------------------------------------- /jni/libpng/jni/pngbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/libpng/jni/pngbar.png -------------------------------------------------------------------------------- /jni/libpng/jni/pngnow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/libpng/jni/pngnow.png -------------------------------------------------------------------------------- /jni/libpng/jni/pngtest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/libpng/jni/pngtest.png -------------------------------------------------------------------------------- /jni/libpng/jni/pngusr.h: -------------------------------------------------------------------------------- 1 | #define PNG_USER_PRIVATEBUILD "Skia build; no MNG features" 2 | #define PNG_USER_DLLFNAME_POSTFIX "Sk" 3 | #define PNG_NO_MNG_FEATURES 4 | #define PNG_NO_READ_GAMMA 5 | -------------------------------------------------------------------------------- /jni/libpng/jni/pngvcrd.c: -------------------------------------------------------------------------------- 1 | /* pnggvrd.c was removed from libpng-1.2.20. */ 2 | -------------------------------------------------------------------------------- /jni/libpng/jni/test-pngtest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ./pngtest ${srcdir}/pngtest.png 4 | -------------------------------------------------------------------------------- /jni/libpng/ndk-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | export NDK_PROJECT_PATH=. 4 | /cygdrive/u/Programs/android-ndk/ndk-build 5 | -------------------------------------------------------------------------------- /jni/libpng/source.txt: -------------------------------------------------------------------------------- 1 | http://android.git.kernel.org/ 2 | 3 | [platform/external/libpng.git] / Android.mk 4 | -------------------------------------------------------------------------------- /jni/libutils/README.TXT: -------------------------------------------------------------------------------- 1 | This version of libutils has been modified by Tom Arn (www.t-arn.com) 2 | to make it run with aapt on Android. 3 | 4 | Modified files: 5 | - String8.cpp 6 | - ResourceTypes.cpp 7 | - ResourceTypes.h 8 | 9 | Modifications are marked with tags. 10 | 11 | Tom Arn, 2011-08-16 12 | -------------------------------------------------------------------------------- /jni/libutils/jni/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2008 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | LOCAL_PATH:= $(call my-dir) 16 | 17 | commonSources:= \ 18 | Asset.cpp \ 19 | AssetDir.cpp \ 20 | AssetManager.cpp \ 21 | BufferedTextOutput.cpp \ 22 | CallStack.cpp \ 23 | Debug.cpp \ 24 | FileMap.cpp \ 25 | Flattenable.cpp \ 26 | ObbFile.cpp \ 27 | Pool.cpp \ 28 | RefBase.cpp \ 29 | ResourceTypes.cpp \ 30 | SharedBuffer.cpp \ 31 | Static.cpp \ 32 | StopWatch.cpp \ 33 | StreamingZipInflater.cpp \ 34 | String8.cpp \ 35 | String16.cpp \ 36 | StringArray.cpp \ 37 | SystemClock.cpp \ 38 | TextOutput.cpp \ 39 | Threads.cpp \ 40 | Timers.cpp \ 41 | VectorImpl.cpp \ 42 | ZipFileCRO.cpp \ 43 | ZipFileRO.cpp \ 44 | ZipUtils.cpp \ 45 | misc.cpp 46 | 47 | # ===================================================== 48 | include $(CLEAR_VARS) 49 | 50 | # we have the common sources, plus some device-specific stuff 51 | LOCAL_SRC_FILES:= \ 52 | $(commonSources) \ 53 | BackupData.cpp \ 54 | BackupHelpers.cpp \ 55 | Looper.cpp 56 | 57 | LOCAL_CFLAGS += -DHAVE_ENDIAN_H -DHAVE_ANDROID_OS -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP 58 | 59 | ifeq ($(TARGET_OS),linux) 60 | LOCAL_LDLIBS += -lrt -ldl 61 | endif 62 | 63 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/include 64 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../libcutils/jni/include 65 | 66 | LOCAL_LDLIBS := -lz -llog 67 | LOCAL_LDLIBS += $(LOCAL_PATH)/../../liblog/libs/armeabi/liblog.so 68 | LOCAL_LDLIBS += $(LOCAL_PATH)/../../libcutils/libs/armeabi/libcutils.so 69 | 70 | 71 | # LOCAL_SHARED_LIBRARIES := libcutils 72 | 73 | LOCAL_MODULE:= libutils 74 | include $(BUILD_SHARED_LIBRARY) 75 | 76 | -------------------------------------------------------------------------------- /jni/libutils/jni/Application.mk: -------------------------------------------------------------------------------- 1 | # needed for compiling libhost 2 | APP_STL := gnustl_static 3 | APP_PLATFORM := android-9 4 | -------------------------------------------------------------------------------- /jni/libutils/jni/AssetDir.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Provide access to a virtual directory in "asset space". Most of the 19 | // implementation is in the header file or in friend functions in 20 | // AssetManager. 21 | // 22 | #include 23 | 24 | using namespace android; 25 | 26 | 27 | /* 28 | * Find a matching entry in a vector of FileInfo. Because it's sorted, we 29 | * can use a binary search. 30 | * 31 | * Assumes the vector is sorted in ascending order. 32 | */ 33 | /*static*/ int AssetDir::FileInfo::findEntry(const SortedVector* pVector, 34 | const String8& fileName) 35 | { 36 | FileInfo tmpInfo; 37 | 38 | tmpInfo.setFileName(fileName); 39 | return pVector->indexOf(tmpInfo); 40 | 41 | #if 0 // don't need this after all (uses 1/2 compares of SortedVector though) 42 | int lo, hi, cur; 43 | 44 | lo = 0; 45 | hi = pVector->size() -1; 46 | while (lo <= hi) { 47 | int cmp; 48 | 49 | cur = (hi + lo) / 2; 50 | cmp = strcmp(pVector->itemAt(cur).getFileName(), fileName); 51 | if (cmp == 0) { 52 | /* match, bail */ 53 | return cur; 54 | } else if (cmp < 0) { 55 | /* too low */ 56 | lo = cur + 1; 57 | } else { 58 | /* too high */ 59 | hi = cur -1; 60 | } 61 | } 62 | 63 | return -1; 64 | #endif 65 | } 66 | 67 | -------------------------------------------------------------------------------- /jni/libutils/jni/Flattenable.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | namespace android { 20 | 21 | Flattenable::~Flattenable() { 22 | } 23 | 24 | }; // namespace android 25 | -------------------------------------------------------------------------------- /jni/libutils/jni/MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/libutils/jni/MODULE_LICENSE_APACHE2 -------------------------------------------------------------------------------- /jni/libutils/jni/Pool.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2010 The Android Open Source Project 3 | // 4 | // A simple memory pool. 5 | // 6 | #define LOG_TAG "Pool" 7 | 8 | //#define LOG_NDEBUG 0 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | namespace android { 16 | 17 | // TODO Provide a real implementation of a pool. This is just a stub for initial development. 18 | 19 | PoolImpl::PoolImpl(size_t objSize) : 20 | mObjSize(objSize) { 21 | } 22 | 23 | PoolImpl::~PoolImpl() { 24 | } 25 | 26 | void* PoolImpl::allocImpl() { 27 | void* ptr = malloc(mObjSize); 28 | LOG_ALWAYS_FATAL_IF(ptr == NULL, "Cannot allocate new pool object."); 29 | return ptr; 30 | } 31 | 32 | void PoolImpl::freeImpl(void* obj) { 33 | LOG_ALWAYS_FATAL_IF(obj == NULL, "Caller attempted to free NULL pool object."); 34 | return free(obj); 35 | } 36 | 37 | } // namespace android 38 | -------------------------------------------------------------------------------- /jni/libutils/jni/StopWatch.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define LOG_TAG "StopWatch" 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | /*****************************************************************************/ 28 | 29 | namespace android { 30 | 31 | 32 | StopWatch::StopWatch(const char *name, int clock, uint32_t flags) 33 | : mName(name), mClock(clock), mFlags(flags) 34 | { 35 | reset(); 36 | } 37 | 38 | StopWatch::~StopWatch() 39 | { 40 | nsecs_t elapsed = elapsedTime(); 41 | const int n = mNumLaps; 42 | LOGD("StopWatch %s (us): %lld ", mName, ns2us(elapsed)); 43 | for (int i=0 ; i= 8) { 59 | elapsed = 0; 60 | } else { 61 | const int n = mNumLaps; 62 | mLaps[n].soFar = elapsed; 63 | mLaps[n].thisLap = n ? (elapsed - mLaps[n-1].soFar) : elapsed; 64 | mNumLaps = n+1; 65 | } 66 | return elapsed; 67 | } 68 | 69 | nsecs_t StopWatch::elapsedTime() const 70 | { 71 | return systemTime(mClock) - mStartTime; 72 | } 73 | 74 | void StopWatch::reset() 75 | { 76 | mNumLaps = 0; 77 | mStartTime = systemTime(mClock); 78 | } 79 | 80 | 81 | /*****************************************************************************/ 82 | 83 | }; // namespace android 84 | 85 | -------------------------------------------------------------------------------- /jni/libutils/jni/ZipFileCRO.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | using namespace android; 21 | 22 | ZipFileCRO ZipFileXRO_open(const char* path) { 23 | ZipFileRO* zip = new ZipFileRO(); 24 | if (zip->open(path) == NO_ERROR) { 25 | return (ZipFileCRO)zip; 26 | } 27 | return NULL; 28 | } 29 | 30 | void ZipFileCRO_destroy(ZipFileCRO zipToken) { 31 | ZipFileRO* zip = (ZipFileRO*)zipToken; 32 | delete zip; 33 | } 34 | 35 | ZipEntryCRO ZipFileCRO_findEntryByName(ZipFileCRO zipToken, 36 | const char* fileName) { 37 | ZipFileRO* zip = (ZipFileRO*)zipToken; 38 | return (ZipEntryCRO)zip->findEntryByName(fileName); 39 | } 40 | 41 | bool ZipFileCRO_getEntryInfo(ZipFileCRO zipToken, ZipEntryRO entryToken, 42 | int* pMethod, size_t* pUncompLen, 43 | size_t* pCompLen, off_t* pOffset, long* pModWhen, long* pCrc32) { 44 | ZipFileRO* zip = (ZipFileRO*)zipToken; 45 | ZipEntryRO entry = (ZipEntryRO)entryToken; 46 | return zip->getEntryInfo(entry, pMethod, pUncompLen, pCompLen, pOffset, 47 | pModWhen, pCrc32); 48 | } 49 | 50 | bool ZipFileCRO_uncompressEntry(ZipFileCRO zipToken, ZipEntryRO entryToken, int fd) { 51 | ZipFileRO* zip = (ZipFileRO*)zipToken; 52 | ZipEntryRO entry = (ZipEntryRO)entryToken; 53 | return zip->uncompressEntry(entry, fd); 54 | } 55 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/private/utils/Static.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // All static variables go here, to control initialization and 18 | // destruction order in the library. 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | // For TextStream.cpp 25 | extern Vector gTextBuffers; 26 | 27 | // For String8.cpp 28 | extern void initialize_string8(); 29 | extern void terminate_string8(); 30 | 31 | // For String16.cpp 32 | extern void initialize_string16(); 33 | extern void terminate_string16(); 34 | 35 | } // namespace android 36 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/Atomic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UTILS_ATOMIC_H 18 | #define ANDROID_UTILS_ATOMIC_H 19 | 20 | #include 21 | 22 | #endif // ANDROID_UTILS_ATOMIC_H 23 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/BufferedTextOutput.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_BUFFEREDTEXTOUTPUT_H 18 | #define ANDROID_BUFFEREDTEXTOUTPUT_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | // --------------------------------------------------------------------------- 25 | namespace android { 26 | 27 | class BufferedTextOutput : public TextOutput 28 | { 29 | public: 30 | //** Flags for constructor */ 31 | enum { 32 | MULTITHREADED = 0x0001 33 | }; 34 | 35 | BufferedTextOutput(uint32_t flags = 0); 36 | virtual ~BufferedTextOutput(); 37 | 38 | virtual status_t print(const char* txt, size_t len); 39 | virtual void moveIndent(int delta); 40 | 41 | virtual void pushBundle(); 42 | virtual void popBundle(); 43 | 44 | protected: 45 | virtual status_t writeLines(const struct iovec& vec, size_t N) = 0; 46 | 47 | private: 48 | struct BufferState; 49 | struct ThreadState; 50 | 51 | static ThreadState*getThreadState(); 52 | static void threadDestructor(void *st); 53 | 54 | BufferState*getBuffer() const; 55 | 56 | uint32_t mFlags; 57 | const int32_t mSeq; 58 | const int32_t mIndex; 59 | 60 | Mutex mLock; 61 | BufferState* mGlobalState; 62 | }; 63 | 64 | // --------------------------------------------------------------------------- 65 | }; // namespace android 66 | 67 | #endif // ANDROID_BUFFEREDTEXTOUTPUT_H 68 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/CallStack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CALLSTACK_H 18 | #define ANDROID_CALLSTACK_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | // --------------------------------------------------------------------------- 26 | 27 | namespace android { 28 | 29 | class CallStack 30 | { 31 | public: 32 | enum { 33 | MAX_DEPTH = 31 34 | }; 35 | 36 | CallStack(); 37 | CallStack(const CallStack& rhs); 38 | ~CallStack(); 39 | 40 | CallStack& operator = (const CallStack& rhs); 41 | 42 | bool operator == (const CallStack& rhs) const; 43 | bool operator != (const CallStack& rhs) const; 44 | bool operator < (const CallStack& rhs) const; 45 | bool operator >= (const CallStack& rhs) const; 46 | bool operator > (const CallStack& rhs) const; 47 | bool operator <= (const CallStack& rhs) const; 48 | 49 | const void* operator [] (int index) const; 50 | 51 | void clear(); 52 | 53 | void update(int32_t ignoreDepth=0, int32_t maxDepth=MAX_DEPTH); 54 | 55 | // Dump a stack trace to the log 56 | void dump(const char* prefix = 0) const; 57 | 58 | // Return a string (possibly very long) containing the complete stack trace 59 | String8 toString(const char* prefix = 0) const; 60 | 61 | size_t size() const { return mCount; } 62 | 63 | private: 64 | // Internal helper function 65 | String8 toStringSingleLevel(const char* prefix, int32_t level) const; 66 | 67 | size_t mCount; 68 | const void* mStack[MAX_DEPTH]; 69 | }; 70 | 71 | }; // namespace android 72 | 73 | 74 | // --------------------------------------------------------------------------- 75 | 76 | #endif // ANDROID_CALLSTACK_H 77 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/Endian.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Android endian-ness defines. 19 | // 20 | #ifndef _LIBS_UTILS_ENDIAN_H 21 | #define _LIBS_UTILS_ENDIAN_H 22 | 23 | #if defined(HAVE_ENDIAN_H) 24 | 25 | #include 26 | 27 | #else /*not HAVE_ENDIAN_H*/ 28 | 29 | #define __BIG_ENDIAN 0x1000 30 | #define __LITTLE_ENDIAN 0x0001 31 | 32 | #if defined(HAVE_LITTLE_ENDIAN) 33 | # define __BYTE_ORDER __LITTLE_ENDIAN 34 | #else 35 | # define __BYTE_ORDER __BIG_ENDIAN 36 | #endif 37 | 38 | #endif /*not HAVE_ENDIAN_H*/ 39 | 40 | #endif /*_LIBS_UTILS_ENDIAN_H*/ 41 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/Flattenable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UTILS_FLATTENABLE_H 18 | #define ANDROID_UTILS_FLATTENABLE_H 19 | 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace android { 26 | 27 | class Flattenable 28 | { 29 | public: 30 | // size in bytes of the flattened object 31 | virtual size_t getFlattenedSize() const = 0; 32 | 33 | // number of file descriptors to flatten 34 | virtual size_t getFdCount() const = 0; 35 | 36 | // flattens the object into buffer. 37 | // size should be at least of getFlattenedSize() 38 | // file descriptors are written in the fds[] array but ownership is 39 | // not transfered (ie: they must be dupped by the caller of 40 | // flatten() if needed). 41 | virtual status_t flatten(void* buffer, size_t size, 42 | int fds[], size_t count) const = 0; 43 | 44 | // unflattens the object from buffer. 45 | // size should be equal to the value of getFlattenedSize() when the 46 | // object was flattened. 47 | // unflattened file descriptors are found in the fds[] array and 48 | // don't need to be dupped(). ie: the caller of unflatten doesn't 49 | // keep ownership. If a fd is not retained by unflatten() it must be 50 | // explicitly closed. 51 | virtual status_t unflatten(void const* buffer, size_t size, 52 | int fds[], size_t count) = 0; 53 | 54 | protected: 55 | virtual ~Flattenable() = 0; 56 | 57 | }; 58 | 59 | }; // namespace android 60 | 61 | 62 | #endif /* ANDROID_UTILS_FLATTENABLE_H */ 63 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/Functor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_FUNCTOR_H 18 | #define ANDROID_FUNCTOR_H 19 | 20 | namespace android { 21 | 22 | struct Functor{}; 23 | 24 | } 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/Log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // C/C++ logging functions. See the logging documentation for API details. 19 | // 20 | // We'd like these to be available from C code (in case we import some from 21 | // somewhere), so this has a C interface. 22 | // 23 | // The output will be correct when the log file is shared between multiple 24 | // threads and/or multiple processes so long as the operating system 25 | // supports O_APPEND. These calls have mutex-protected data structures 26 | // and so are NOT reentrant. Do not use LOG in a signal handler. 27 | // 28 | #ifndef _LIBS_UTILS_LOG_H 29 | #define _LIBS_UTILS_LOG_H 30 | 31 | #include 32 | 33 | #endif // _LIBS_UTILS_LOG_H 34 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/Pool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef UTILS_POOL_H 18 | #define UTILS_POOL_H 19 | 20 | #include 21 | 22 | namespace android { 23 | 24 | class PoolImpl { 25 | public: 26 | PoolImpl(size_t objSize); 27 | ~PoolImpl(); 28 | 29 | void* allocImpl(); 30 | void freeImpl(void* obj); 31 | 32 | private: 33 | size_t mObjSize; 34 | }; 35 | 36 | /* 37 | * A homogeneous typed memory pool for fixed size objects. 38 | * Not intended to be thread-safe. 39 | */ 40 | template 41 | class Pool : private PoolImpl { 42 | public: 43 | /* Creates an initially empty pool. */ 44 | Pool() : PoolImpl(sizeof(T)) { } 45 | 46 | /* Destroys the pool. 47 | * Assumes that the pool is empty. */ 48 | ~Pool() { } 49 | 50 | /* Allocates an object from the pool, growing the pool if needed. */ 51 | inline T* alloc() { 52 | void* mem = allocImpl(); 53 | if (! traits::has_trivial_ctor) { 54 | return new (mem) T(); 55 | } else { 56 | return static_cast(mem); 57 | } 58 | } 59 | 60 | /* Frees an object from the pool. */ 61 | inline void free(T* obj) { 62 | if (! traits::has_trivial_dtor) { 63 | obj->~T(); 64 | } 65 | freeImpl(obj); 66 | } 67 | }; 68 | 69 | } // namespace android 70 | 71 | #endif // UTILS_POOL_H 72 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/StopWatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_STOPWATCH_H 18 | #define ANDROID_STOPWATCH_H 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | // --------------------------------------------------------------------------- 26 | 27 | namespace android { 28 | 29 | class StopWatch 30 | { 31 | public: 32 | StopWatch( const char *name, 33 | int clock = SYSTEM_TIME_MONOTONIC, 34 | uint32_t flags = 0); 35 | ~StopWatch(); 36 | 37 | const char* name() const; 38 | nsecs_t lap(); 39 | nsecs_t elapsedTime() const; 40 | 41 | void reset(); 42 | 43 | private: 44 | const char* mName; 45 | int mClock; 46 | uint32_t mFlags; 47 | 48 | struct lap_t { 49 | nsecs_t soFar; 50 | nsecs_t thisLap; 51 | }; 52 | 53 | nsecs_t mStartTime; 54 | lap_t mLaps[8]; 55 | int mNumLaps; 56 | }; 57 | 58 | 59 | }; // namespace android 60 | 61 | 62 | // --------------------------------------------------------------------------- 63 | 64 | #endif // ANDROID_STOPWATCH_H 65 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/StringArray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // Sortable array of strings. STL-ish, but STL-free. 19 | // 20 | #ifndef _LIBS_UTILS_STRING_ARRAY_H 21 | #define _LIBS_UTILS_STRING_ARRAY_H 22 | 23 | #include 24 | #include 25 | 26 | namespace android { 27 | 28 | // 29 | // An expanding array of strings. Add, get, sort, delete. 30 | // 31 | class StringArray { 32 | public: 33 | StringArray(); 34 | virtual ~StringArray(); 35 | 36 | // 37 | // Add a string. A copy of the string is made. 38 | // 39 | bool push_back(const char* str); 40 | 41 | // 42 | // Delete an entry. 43 | // 44 | void erase(int idx); 45 | 46 | // 47 | // Sort the array. 48 | // 49 | void sort(int (*compare)(const void*, const void*)); 50 | 51 | // 52 | // Pass this to the sort routine to do an ascending alphabetical sort. 53 | // 54 | static int cmpAscendingAlpha(const void* pstr1, const void* pstr2); 55 | 56 | // 57 | // Get the #of items in the array. 58 | // 59 | inline int size(void) const { return mCurrent; } 60 | 61 | // 62 | // Return entry N. 63 | // [should use operator[] here] 64 | // 65 | const char* getEntry(int idx) const { 66 | return (unsigned(idx) >= unsigned(mCurrent)) ? NULL : mArray[idx]; 67 | } 68 | 69 | // 70 | // Set entry N to specified string. 71 | // [should use operator[] here] 72 | // 73 | void setEntry(int idx, const char* str); 74 | 75 | private: 76 | int mMax; 77 | int mCurrent; 78 | char** mArray; 79 | }; 80 | 81 | }; // namespace android 82 | 83 | #endif // _LIBS_UTILS_STRING_ARRAY_H 84 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/SystemClock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_UTILS_SYSTEMCLOCK_H 18 | #define ANDROID_UTILS_SYSTEMCLOCK_H 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | 25 | int setCurrentTimeMillis(int64_t millis); 26 | int64_t uptimeMillis(); 27 | int64_t elapsedRealtime(); 28 | 29 | }; // namespace android 30 | 31 | #endif // ANDROID_UTILS_SYSTEMCLOCK_H 32 | 33 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/ZipFileCRO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // C API for ead-only access to Zip archives, with minimal heap allocation. 19 | // 20 | #ifndef __LIBS_ZIPFILECRO_H 21 | #define __LIBS_ZIPFILECRO_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* 32 | * Trivial typedef to ensure that ZipFileCRO is not treated as a simple integer. 33 | */ 34 | typedef void* ZipFileCRO; 35 | 36 | /* 37 | * Trivial typedef to ensure that ZipEntryCRO is not treated as a simple 38 | * integer. We use NULL to indicate an invalid value. 39 | */ 40 | typedef void* ZipEntryCRO; 41 | 42 | extern ZipFileCRO ZipFileXRO_open(const char* path); 43 | 44 | extern void ZipFileCRO_destroy(ZipFileCRO zip); 45 | 46 | extern ZipEntryCRO ZipFileCRO_findEntryByName(ZipFileCRO zip, 47 | const char* fileName); 48 | 49 | extern bool ZipFileCRO_getEntryInfo(ZipFileCRO zip, ZipEntryCRO entry, 50 | int* pMethod, size_t* pUncompLen, 51 | size_t* pCompLen, off_t* pOffset, long* pModWhen, long* pCrc32); 52 | 53 | extern bool ZipFileCRO_uncompressEntry(ZipFileCRO zip, ZipEntryCRO entry, int fd); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /*__LIBS_ZIPFILECRO_H*/ 60 | -------------------------------------------------------------------------------- /jni/libutils/jni/include/utils/ashmem.h: -------------------------------------------------------------------------------- 1 | /* utils/ashmem.h 2 | ** 3 | ** Copyright 2008 The Android Open Source Project 4 | ** 5 | ** This file is dual licensed. It may be redistributed and/or modified 6 | ** under the terms of the Apache 2.0 License OR version 2 of the GNU 7 | ** General Public License. 8 | */ 9 | 10 | #ifndef _UTILS_ASHMEM_H 11 | #define _UTILS_ASHMEM_H 12 | 13 | #include 14 | #include 15 | 16 | #define ASHMEM_NAME_LEN 256 17 | 18 | #define ASHMEM_NAME_DEF "dev/ashmem" 19 | 20 | /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ 21 | #define ASHMEM_NOT_REAPED 0 22 | #define ASHMEM_WAS_REAPED 1 23 | 24 | /* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ 25 | #define ASHMEM_NOW_UNPINNED 0 26 | #define ASHMEM_NOW_PINNED 1 27 | 28 | #define __ASHMEMIOC 0x77 29 | 30 | #define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN]) 31 | #define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN]) 32 | #define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t) 33 | #define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4) 34 | #define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long) 35 | #define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) 36 | #define ASHMEM_PIN _IO(__ASHMEMIOC, 7) 37 | #define ASHMEM_UNPIN _IO(__ASHMEMIOC, 8) 38 | #define ASHMEM_ISPINNED _IO(__ASHMEMIOC, 9) 39 | #define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) 40 | 41 | #endif /* _UTILS_ASHMEM_H */ 42 | -------------------------------------------------------------------------------- /jni/libutils/ndk-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | export NDK_PROJECT_PATH=. 4 | /cygdrive/u/Programs/android-ndk/ndk-build 5 | -------------------------------------------------------------------------------- /jni/libutils/source.txt: -------------------------------------------------------------------------------- 1 | http://android.git.kernel.org/ 2 | 3 | [platform/frameworks/base.git] / libs / utils / Android.mk 4 | [platform/frameworks/base.git] / include / utils / * -------------------------------------------------------------------------------- /jni/materials/Android.mkDocumentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/materials/Android.mkDocumentation.pdf -------------------------------------------------------------------------------- /jni/materials/aapt-port-android_1-0-0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/jni/materials/aapt-port-android_1-0-0.zip -------------------------------------------------------------------------------- /jni/materials/linking_existing_static_lib.txt: -------------------------------------------------------------------------------- 1 | http://android-jotting.blogspot.com/2010/08/compile-static-library-only-using-ndk.html -------------------------------------------------------------------------------- /jni/materials/making_static_lib.txt: -------------------------------------------------------------------------------- 1 | http://stackoverflow.com/questions/2943828/how-to-compile-a-static-library-using-the-android-ndk -------------------------------------------------------------------------------- /jni/materials/multi_android_mk.txt: -------------------------------------------------------------------------------- 1 | http://android-jotting.blogspot.com/2010/08/compile-static-library-only-using-ndk.html -------------------------------------------------------------------------------- /jni/materials/redirection.txt: -------------------------------------------------------------------------------- 1 | http://stackoverflow.com/questions/5483068/jni-connecting-stdout-to-a-jtextarea 2 | 3 | std::stringbuf str; 4 | std::streambuf* save = std::cout.rdbuf(); 5 | std::cout.rdbuf(&str); // the output... 6 | std::cout.rdbuf(save); // Better would be to use RAII 7 | 8 | // Now convert str.str() to a Java string. ` Of course, if your code is outputting to an std::ostream, like it should be, there's no problem: just use std::ostringstream 9 | 10 | 11 | http://cboard.cprogramming.com/c-programming/86580-stdout-jni.html 12 | JNIEnv* env; 13 | stream = freopen("file.txt", "w", stdout); 14 | env = create_vm(); 15 | 16 | 17 | http://www.velocityreviews.com/forums/t635861-redirect-cout-and-cerr-to-system-out-and-system-err.html 18 | http://www.vajhoej.dk/arne/eksperten/jniredirect/ 19 | 20 | 21 | http://de.w3support.net/index.php?db=so&id=573724 22 | #include 23 | 24 | int main() 25 | { 26 | freopen ("myfile.txt", "w", stdout); 27 | printf ("This is redirected to a file"); 28 | fclose (stdout); 29 | return 0; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /jni/materials/stringSplit.c: -------------------------------------------------------------------------------- 1 | string str= "Nice Input Man"; 2 | int len = strlen(str); 3 | int OS; //output sting number 4 | string output[]; 5 | for (int loop = 0; loop < len; loop++) 6 | { 7 | if ( str[loop] == '\t') 8 | { OS += 1; } 9 | else 10 | { output[OS] += str[loop]; } 11 | } 12 | 13 | 14 | Here is a simple example showing the use of strtok. 15 | 16 | #include 17 | #include 18 | 19 | ... 20 | 21 | char string[] = "words separated by spaces -- and, punctuation!"; 22 | const char delimiters[] = " .,;:!-"; 23 | char *token; 24 | 25 | ... 26 | 27 | token = strtok (string, delimiters); /* token => "words" */ 28 | token = strtok (NULL, delimiters); /* token => "separated" */ 29 | token = strtok (NULL, delimiters); /* token => "by" */ 30 | token = strtok (NULL, delimiters); /* token => "spaces" */ 31 | token = strtok (NULL, delimiters); /* token => "and" */ 32 | token = strtok (NULL, delimiters); /* token => "punctuation" */ 33 | token = strtok (NULL, delimiters); /* token => NULL */ 34 | -------------------------------------------------------------------------------- /jni/zlib/README.TXT: -------------------------------------------------------------------------------- 1 | This library is needed by aapt, 2 | but is already on the device by 3 | default: 4 | 5 | android-ndk/platforms/android-8/arch-arm/usr/lib/libz.so 6 | 7 | hmmm... is libunz needed by aapt??? 8 | -------------------------------------------------------------------------------- /jni/zlib/source.txt: -------------------------------------------------------------------------------- 1 | http://android.git.kernel.org/ 2 | 3 | [platform/external/zlib.git] / Android.mk 4 | -------------------------------------------------------------------------------- /libs/armeabi/libaaptcomplete.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/libs/armeabi/libaaptcomplete.so -------------------------------------------------------------------------------- /libs/bsh.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/libs/bsh.jar -------------------------------------------------------------------------------- /libs/dx_ta.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/libs/dx_ta.jar -------------------------------------------------------------------------------- /libs/ecj.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/libs/ecj.jar -------------------------------------------------------------------------------- /libs/sdklib_ta.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/libs/sdklib_ta.jar -------------------------------------------------------------------------------- /libs/zipsigner-lib_all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/libs/zipsigner-lib_all.jar -------------------------------------------------------------------------------- /materials/dx/dx_ta_src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/materials/dx/dx_ta_src.zip -------------------------------------------------------------------------------- /materials/sdklib/sdklib_ta_src.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/materials/sdklib/sdklib_ta_src.zip -------------------------------------------------------------------------------- /ndk-build-aaptcomplete.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | export NDK_PROJECT_PATH=. 4 | /cygdrive/u/Programs/android-ndk/ndk-build 5 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable-hdpi/ic_menu_login.png -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_menu_money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable-hdpi/ic_menu_money.png -------------------------------------------------------------------------------- /res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable-mdpi/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable-mdpi/ic_menu_login.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_menu_money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable-mdpi/ic_menu_money.png -------------------------------------------------------------------------------- /res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /res/drawable/ic_launcher_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable/ic_launcher_folder.png -------------------------------------------------------------------------------- /res/drawable/ic_launcher_folder_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t-arn/java-ide-droid/d8ef9f9c47effb26e90c27ceac9f6a5ab160ba42/res/drawable/ic_launcher_folder_small.png -------------------------------------------------------------------------------- /res/layout/filebrowserlist.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 17 | 26 | 35 | 44 | 49 |