├── zlib ├── MODULE_LICENSE_BSD_LIKE ├── ChangeLog ├── zlib.3.pdf ├── zlib.pc ├── zlib.pc.in ├── zlib.pc.cmakein ├── inffast.h ├── gzclose.c ├── NOTICE ├── update_zlib.sh ├── zlib.map ├── uncompr.c ├── INDEX └── CleanSpec.mk ├── libpng ├── MODULE_LICENSE_BSD_LIKE ├── pngvcrd.c ├── projects │ ├── xcode │ │ ├── libpng.xcodeproj │ │ │ └── .gitignore │ │ └── Info.plist │ ├── beos │ │ ├── x86-shared.proj │ │ ├── x86-static.proj │ │ ├── x86-shared.txt │ │ └── x86-static.txt │ ├── netware.txt │ ├── wince.txt │ ├── visualc71 │ │ ├── PRJ0041.mak │ │ ├── README_zlib.txt │ │ └── README.txt │ ├── cbuilder5 │ │ ├── libpngstat.bpf │ │ ├── zlib.readme.txt │ │ ├── libpng.bpf │ │ ├── libpng.readme.txt │ │ ├── libpng.bpg │ │ └── libpng.cpp │ └── visualc6 │ │ ├── libpng.dsw │ │ └── README.txt ├── test-pngtest.sh ├── pngbar.jpg ├── pngbar.png ├── pngnow.png ├── pngtest.png ├── contrib │ ├── pngminus │ │ ├── pngminus.bat │ │ ├── pngminus.sh │ │ ├── makefile.tc3 │ │ ├── makefile.std │ │ ├── pnm2png.sh │ │ ├── pnm2png.bat │ │ ├── png2pnm.sh │ │ ├── png2pnm.bat │ │ └── makevms.com │ ├── gregbook │ │ ├── rpng-x.c │ │ ├── rpng2-x.c │ │ ├── toucan.png │ │ └── LICENSE │ ├── pngsuite │ │ ├── basn0g01.png │ │ ├── basn0g02.png │ │ ├── basn0g04.png │ │ ├── basn0g08.png │ │ ├── basn0g16.png │ │ ├── basn2c08.png │ │ ├── basn2c16.png │ │ ├── basn3p01.png │ │ ├── basn3p02.png │ │ ├── basn3p04.png │ │ ├── basn3p08.png │ │ ├── basn4a08.png │ │ ├── basn4a16.png │ │ ├── basn6a08.png │ │ └── basn6a16.png │ ├── visupng │ │ ├── VisualPng.ico │ │ ├── VisualPng.png │ │ ├── VisualPng.dsw │ │ ├── resource.h │ │ ├── PngFile.h │ │ └── README.txt │ └── pngminim │ │ ├── encoder │ │ ├── gather.sh │ │ ├── README │ │ ├── dummy_inflate.c │ │ ├── makefile │ │ ├── makefile.std │ │ └── pngusr.h │ │ ├── decoder │ │ ├── gather.sh │ │ ├── README │ │ ├── makefile │ │ ├── makefile.std │ │ └── pngusr.h │ │ └── preader │ │ ├── gather.sh │ │ ├── README │ │ ├── makefile │ │ └── pngusr.h ├── scripts │ ├── SCOPTIONS.ppc │ ├── libpng.pc.in │ ├── libpng.pc-configure.in │ ├── libpng-config-head.in │ ├── smakefile.ppc │ ├── descrip.mms │ ├── makefile.amiga │ ├── makefile.netbsd │ ├── makefile.ne12bsd │ ├── makefile.freebsd │ ├── libpng.icc │ ├── makefile.dj2 │ ├── makefile.acorn │ ├── makefile.atari │ ├── makefile.ibmc │ ├── libpng-config-body.in │ ├── makefile.os2 │ ├── makefile.gcc │ ├── makefile.tc3 │ ├── makefile.msc │ ├── makefile.openbsd │ └── makefile.mips ├── pngusr.h ├── autogen.sh ├── KNOWNBUG ├── TODO ├── ANNOUNCE ├── CleanSpec.mk ├── Y2KINFO ├── config.h.in └── png.5 ├── README.md ├── preDef.h ├── constDef.h ├── host └── pseudolocalize.h ├── fakeLog.h ├── SourcePos.h ├── Images.h ├── cutils-c ├── atomic.c ├── loghack.h ├── sockets.c ├── uio.c └── threads.c ├── utils ├── Atomic.h ├── SystemClock.h ├── Functor.h ├── Endian.h ├── zLog.h ├── ashmem.h ├── Compat.h ├── StopWatch.h ├── ZipFileCRO.h ├── Flattenable.h ├── LinearTransform.h ├── BufferedTextOutput.h ├── StringArray.h ├── CallStack.h ├── ZipUtils.h ├── Debug.h ├── ByteOrder.h ├── Singleton.h └── Errors.h ├── utils-cpp ├── Flattenable.cpp ├── ZipFileCRO.cpp ├── AssetDir.cpp ├── StopWatch.cpp └── Static.cpp ├── expat ├── xmltok_impl.h ├── asciitab.h ├── utf8tab.h ├── latin1tab.h ├── iasciitab.h ├── internal.h └── ascii.h ├── ResourceFilter.h ├── cutils ├── sched_policy.h ├── uio.h ├── logd.h ├── atomic-inline.h └── properties.h ├── private └── utils │ └── Static.h ├── Android.mk ├── zipfile ├── private.h └── zipfile.h └── Main.h /zlib/MODULE_LICENSE_BSD_LIKE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libpng/MODULE_LICENSE_BSD_LIKE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libpng/pngvcrd.c: -------------------------------------------------------------------------------- 1 | /* pnggvrd.c was removed from libpng-1.2.20. */ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aapt 2 | aapt compiled with Code Blocks in windows platform 3 | -------------------------------------------------------------------------------- /libpng/projects/xcode/libpng.xcodeproj/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1* 2 | *.pbxuser 3 | -------------------------------------------------------------------------------- /libpng/test-pngtest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ./pngtest ${srcdir}/pngtest.png 4 | -------------------------------------------------------------------------------- /zlib/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/zlib/ChangeLog -------------------------------------------------------------------------------- /preDef.h: -------------------------------------------------------------------------------- 1 | #ifndef OS_PATH_SEPARATOR 2 | #define OS_PATH_SEPARATOR '/' 3 | #endif 4 | -------------------------------------------------------------------------------- /zlib/zlib.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/zlib/zlib.3.pdf -------------------------------------------------------------------------------- /libpng/pngbar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/pngbar.jpg -------------------------------------------------------------------------------- /libpng/pngbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/pngbar.png -------------------------------------------------------------------------------- /libpng/pngnow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/pngnow.png -------------------------------------------------------------------------------- /libpng/pngtest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/pngtest.png -------------------------------------------------------------------------------- /libpng/contrib/pngminus/pngminus.bat: -------------------------------------------------------------------------------- 1 | make -f makefile.tc3 2 | call png2pnm.bat 3 | call pnm2png.bat 4 | 5 | -------------------------------------------------------------------------------- /libpng/contrib/gregbook/rpng-x.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/gregbook/rpng-x.c -------------------------------------------------------------------------------- /libpng/contrib/gregbook/rpng2-x.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/gregbook/rpng2-x.c -------------------------------------------------------------------------------- /libpng/contrib/gregbook/toucan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/gregbook/toucan.png -------------------------------------------------------------------------------- /libpng/contrib/pngminus/pngminus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | make -f makefile.std 3 | sh png2pnm.sh 4 | sh pnm2png.sh 5 | 6 | -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn0g01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn0g01.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn0g02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn0g02.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn0g04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn0g04.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn0g08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn0g08.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn0g16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn0g16.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn2c08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn2c08.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn2c16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn2c16.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn3p01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn3p01.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn3p02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn3p02.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn3p04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn3p04.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn3p08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn3p08.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn4a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn4a08.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn4a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn4a16.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn6a08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn6a08.png -------------------------------------------------------------------------------- /libpng/contrib/pngsuite/basn6a16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/pngsuite/basn6a16.png -------------------------------------------------------------------------------- /libpng/contrib/visupng/VisualPng.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/visupng/VisualPng.ico -------------------------------------------------------------------------------- /libpng/contrib/visupng/VisualPng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/contrib/visupng/VisualPng.png -------------------------------------------------------------------------------- /libpng/projects/beos/x86-shared.proj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/projects/beos/x86-shared.proj -------------------------------------------------------------------------------- /libpng/projects/beos/x86-static.proj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dabang007/aapt/HEAD/libpng/projects/beos/x86-static.proj -------------------------------------------------------------------------------- /libpng/scripts/SCOPTIONS.ppc: -------------------------------------------------------------------------------- 1 | OPTIMIZE 2 | OPTPEEP 3 | OPTTIME 4 | OPTSCHED 5 | AUTOREGISTER 6 | PARMS=REGISTERS 7 | INCLUDEDIR=hlp:ppc/include 8 | -------------------------------------------------------------------------------- /constDef.h: -------------------------------------------------------------------------------- 1 | #ifndef CONSTDEF_H_INCLUDED 2 | #define CONSTDEF_H_INCLUDED 3 | 4 | #define OS_PATH_SEPARATOR '/' 5 | 6 | #endif // CONSTDEF_H_INCLUDED 7 | -------------------------------------------------------------------------------- /libpng/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpng/scripts/libpng.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@/libpng12 5 | 6 | Name: libpng 7 | Description: Loads and saves PNG files 8 | Version: 1.2.46 9 | Libs: -L${libdir} -lpng12 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /libpng/projects/netware.txt: -------------------------------------------------------------------------------- 1 | A set of project files is available for Netware. Get 2 | libpng-1.2.5-project-netware.zip from a libpng distribution 3 | site such as http://libpng.sourceforge.net 4 | 5 | Put the zip file in this directory (projects) and then run 6 | "unzip -a libpng-1.2.5-project-netware.zip" 7 | -------------------------------------------------------------------------------- /libpng/projects/wince.txt: -------------------------------------------------------------------------------- 1 | A set of project files is available for WinCE. Get 2 | libpng-1.2.46-project-wince.zip from a libpng distribution 3 | site such as http://libpng.sourceforge.net/index.html 4 | 5 | Put the zip file in this directory (projects) and then run 6 | "unzip -a libpng-1.2.46-project-wince.zip" 7 | -------------------------------------------------------------------------------- /zlib/zlib.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr/local 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | sharedlibdir=${libdir} 5 | includedir=${prefix}/include 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: 1.2.8 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /zlib/zlib.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | sharedlibdir=@sharedlibdir@ 5 | includedir=@includedir@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/encoder/gather.sh: -------------------------------------------------------------------------------- 1 | cp ../../pngminus/pnm2png.c pnm2pngm.c 2 | cp ../../../*.h . 3 | cp ../../../*.c . 4 | rm pnggccrd.c pngvcrd.c 5 | rm example.c pngtest.c pngr*.c pngpread.c 6 | # Change the next 2 lines if zlib is somewhere else. 7 | cp ../../../../zlib/*.h . 8 | cp ../../../../zlib/*.c . 9 | rm inf*.[ch] 10 | rm minigzip.c example.c gz* 11 | -------------------------------------------------------------------------------- /zlib/zlib.pc.cmakein: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@INSTALL_LIB_DIR@ 4 | sharedlibdir=@INSTALL_LIB_DIR@ 5 | includedir=@INSTALL_INC_DIR@ 6 | 7 | Name: zlib 8 | Description: zlib compression library 9 | Version: @VERSION@ 10 | 11 | Requires: 12 | Libs: -L${libdir} -L${sharedlibdir} -lz 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/decoder/gather.sh: -------------------------------------------------------------------------------- 1 | cp ../../pngminus/png2pnm.c pngm2pnm.c 2 | cp ../../../*.h . 3 | cp ../../../*.c . 4 | rm pnggccrd.c pngvcrd.c 5 | rm example.c pngtest.c pngpread.c pngw*.c 6 | # change the following 2 lines if zlib is somewhere else 7 | cp ../../../../zlib/*.h . 8 | cp ../../../../zlib/*.c . 9 | rm minigzip.c example.c compress.c deflate.c gz* 10 | -------------------------------------------------------------------------------- /libpng/scripts/libpng.pc-configure.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ 5 | 6 | Name: libpng 7 | Description: Loads and saves PNG files 8 | Version: @PNGLIB_VERSION@ 9 | Libs: -L${libdir} -lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ 10 | Libs.private: @LIBS@ 11 | Cflags: -I${includedir} @LIBPNG_NO_MMX@ 12 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/decoder/README: -------------------------------------------------------------------------------- 1 | This demonstrates the use of PNG_USER_CONFIG and pngusr.h 2 | 3 | To build a minimal read-only decoder with embedded libpng and zlib, run 4 | 5 | gather.sh # to collect needed files from pngminus, libpng, and zlib 6 | make 7 | 8 | If you prefer to use the shared libraries, go to contrib/pngminus 9 | and build the png2pnm application there. 10 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/encoder/README: -------------------------------------------------------------------------------- 1 | This demonstrates the use of PNG_USER_CONFIG and pngusr.h 2 | 3 | To build a minimal write-only decoder with embedded libpng and zlib, run 4 | 5 | gather.sh # to collect needed files from pngminus, libpng, and zlib 6 | make 7 | 8 | If you prefer to use the shared libraries, go to contrib/pngminus 9 | and build the pnm2png application there. 10 | -------------------------------------------------------------------------------- /fakeLog.h: -------------------------------------------------------------------------------- 1 | #ifndef FAKELOG_H_INCLUDED 2 | #define FAKELOG_H_INCLUDED 3 | 4 | #define LOG(...) 5 | #define LOGV(...) 6 | #define LOGD(...) 7 | #define LOGI(...) 8 | #define LOGW(...) 9 | #define LOGE(...) 10 | #define LOG_FATAL_IF(...) 11 | #define LOG_ALWAYS_FATAL_IF(...) 12 | #define LOG_ASSERT(...) 13 | #define LOG_ALWAYS_FATAL(...) 14 | 15 | #define SLOGE(...) 16 | #define SLOGW(...) 17 | 18 | #endif // FAKELOG_H_INCLUDED 19 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/preader/gather.sh: -------------------------------------------------------------------------------- 1 | cp ../../gregbook/rpng2-x.c ../../gregbook/readpng2.[ch] . 2 | cp ../../gregbook/COPYING ../../gregbook/LICENSE . 3 | cp ../../../*.h . 4 | cp ../../../*.c . 5 | rm pnggccrd.c pngvcrd.c 6 | rm example.c pngtest.c pngw*.c 7 | # change the following 2 lines if zlib is somewhere else 8 | cp ../../../../zlib/*.h . 9 | cp ../../../../zlib/*.c . 10 | rm minigzip.c example.c compress.c deflate.c gz* 11 | -------------------------------------------------------------------------------- /zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /libpng/scripts/libpng-config-head.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # libpng-config 4 | # provides configuration info for libpng. 5 | 6 | # Copyright (C) 2002 Glenn Randers-Pehrson 7 | 8 | # This code is released under the libpng license. 9 | # For conditions of distribution and use, see the disclaimer 10 | # and license in png.h 11 | 12 | # Modeled after libxml-config. 13 | 14 | version=1.2.46 15 | prefix="" 16 | libdir="" 17 | libs="" 18 | I_opts="" 19 | L_opts="" 20 | R_opts="" 21 | cppflags="" 22 | ccopts="" 23 | ldopts="" 24 | 25 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/preader/README: -------------------------------------------------------------------------------- 1 | This demonstrates the use of PNG_USER_CONFIG and pngusr.h 2 | 3 | To build a minimal read-only progressive decoder embedded libpng and 4 | zlib and with your system's X library, run 5 | 6 | gather.sh # to collect needed files from gregbook, libpng, and zlib 7 | 8 | Edit makefile if required, to find your X library and include files, 9 | then 10 | 11 | make 12 | 13 | If you prefer to use the shared libraries, go to contrib/gregbook 14 | and build the rpng2-x application there. 15 | -------------------------------------------------------------------------------- /libpng/projects/visualc71/PRJ0041.mak: -------------------------------------------------------------------------------- 1 | # Prevent "Cannot find missing dependency..." warnings while compiling 2 | # pngw32.rc (PRJ0041). 3 | 4 | all: $(IntDir)\alloc.h \ 5 | $(IntDir)\fp.h \ 6 | $(IntDir)\m68881.h \ 7 | $(IntDir)\mem.h \ 8 | $(IntDir)\pngusr.h \ 9 | $(IntDir)\strings.h \ 10 | $(IntDir)\unistd.h \ 11 | $(IntDir)\unixio.h 12 | 13 | $(IntDir)\alloc.h \ 14 | $(IntDir)\fp.h \ 15 | $(IntDir)\m68881.h \ 16 | $(IntDir)\mem.h \ 17 | $(IntDir)\pngusr.h \ 18 | $(IntDir)\strings.h \ 19 | $(IntDir)\unistd.h \ 20 | $(IntDir)\unixio.h: 21 | @!echo.>$@ 22 | -------------------------------------------------------------------------------- /SourcePos.h: -------------------------------------------------------------------------------- 1 | #ifndef SOURCEPOS_H 2 | #define SOURCEPOS_H 3 | 4 | #include 5 | #include 6 | 7 | using namespace android; 8 | 9 | class SourcePos 10 | { 11 | public: 12 | String8 file; 13 | int line; 14 | 15 | SourcePos(const String8& f, int l); 16 | SourcePos(const SourcePos& that); 17 | SourcePos(); 18 | ~SourcePos(); 19 | 20 | int error(const char* fmt, ...) const; 21 | int warning(const char* fmt, ...) const; 22 | 23 | static bool hasErrors(); 24 | static void printErrors(FILE* to); 25 | }; 26 | 27 | 28 | #endif // SOURCEPOS_H 29 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/encoder/dummy_inflate.c: -------------------------------------------------------------------------------- 1 | #include "zlib.h" 2 | 3 | int ZEXPORT inflate(strm, flush) 4 | z_streamp strm; 5 | int flush; 6 | { return Z_OK ; } 7 | 8 | int ZEXPORT inflateReset(strm) 9 | z_streamp strm; 10 | { return Z_OK ; } 11 | 12 | int ZEXPORT inflateEnd(strm) 13 | z_streamp strm; 14 | { return Z_STREAM_ERROR ; } 15 | 16 | int ZEXPORT inflateInit_(strm, version, stream_size) 17 | z_streamp strm; 18 | const char *version; 19 | int stream_size; 20 | { return Z_OK ; } 21 | 22 | int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) 23 | z_streamp strm; 24 | int windowBits; 25 | const char *version; 26 | int stream_size; 27 | { return Z_STREAM_ERROR ; } 28 | -------------------------------------------------------------------------------- /libpng/contrib/visupng/VisualPng.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "VisualPng"=.\VisualPng.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /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 | #include "Bundle.h" 12 | 13 | #include 14 | #include 15 | 16 | using android::String8; 17 | 18 | status_t preProcessImage(Bundle* bundle, const sp& assets, 19 | const sp& file, String8* outNewLeafName); 20 | 21 | status_t preProcessImageToCache(Bundle* bundle, String8 source, String8 dest); 22 | 23 | status_t postProcessImage(const sp& assets, 24 | ResourceTable* table, const sp& file); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /libpng/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 | -------------------------------------------------------------------------------- /cutils-c/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 | -------------------------------------------------------------------------------- /libpng/projects/cbuilder5/libpngstat.bpf: -------------------------------------------------------------------------------- 1 | USEUNIT("..\..\png.c"); 2 | USEUNIT("..\..\pngerror.c"); 3 | USEUNIT("..\..\pngget.c"); 4 | USEUNIT("..\..\pngmem.c"); 5 | USEUNIT("..\..\pngpread.c"); 6 | USEUNIT("..\..\pngread.c"); 7 | USEUNIT("..\..\pngrio.c"); 8 | USEUNIT("..\..\pngrtran.c"); 9 | USEUNIT("..\..\pngrutil.c"); 10 | USEUNIT("..\..\pngset.c"); 11 | USEUNIT("..\..\pngtrans.c"); 12 | USEUNIT("..\..\pngwio.c"); 13 | USEUNIT("..\..\pngwrite.c"); 14 | USEUNIT("..\..\pngwtran.c"); 15 | USEUNIT("..\..\pngwutil.c"); 16 | USELIB("..\..\..\zlib\zlib.lib"); 17 | //--------------------------------------------------------------------------- 18 | #define Library 19 | 20 | // To add a file to the library use the Project menu 'Add to Project'. 21 | 22 | -------------------------------------------------------------------------------- /libpng/projects/cbuilder5/zlib.readme.txt: -------------------------------------------------------------------------------- 1 | The project that builds libpng under Borland C++ Builder does not 2 | explicitly build zlib. By taking this decision, there is no need 3 | to update the libpng project each time when there is a change in 4 | the list of zlib source files. After all, this list is private to 5 | zlib, and applications (such as libpng) should not assume anything 6 | about it. 7 | 8 | If you wish to contribute a project that builds zlib under Borland 9 | C++ Builder, please submit it to the zlib developers, not to the 10 | libpng developers. 11 | 12 | By default, the libpng project uses zlib as a static library. If 13 | you wish to use zlib as a DLL, please read the important notes from 14 | the zlib DLL FAQ, found inside the zlib distribution. 15 | -------------------------------------------------------------------------------- /zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /libpng/projects/cbuilder5/libpng.bpf: -------------------------------------------------------------------------------- 1 | USEUNIT("libpng.cpp"); 2 | USEUNIT("..\..\png.c"); 3 | USEUNIT("..\..\pngerror.c"); 4 | USEUNIT("..\..\pngget.c"); 5 | USEUNIT("..\..\pngmem.c"); 6 | USEUNIT("..\..\pngpread.c"); 7 | USEUNIT("..\..\pngread.c"); 8 | USEUNIT("..\..\pngrio.c"); 9 | USEUNIT("..\..\pngrtran.c"); 10 | USEUNIT("..\..\pngrutil.c"); 11 | USEUNIT("..\..\pngset.c"); 12 | USEUNIT("..\..\pngtrans.c"); 13 | USEUNIT("..\..\pngwio.c"); 14 | USEUNIT("..\..\pngwrite.c"); 15 | USEUNIT("..\..\pngwtran.c"); 16 | USEUNIT("..\..\pngwutil.c"); 17 | USELIB("..\..\..\zlib\zlib.lib"); 18 | //--------------------------------------------------------------------------- 19 | This file is used by the project manager only and should be treated like the project file 20 | 21 | 22 | DllEntryPoint 23 | -------------------------------------------------------------------------------- /libpng/projects/beos/x86-shared.txt: -------------------------------------------------------------------------------- 1 | This project builds a shared library version of libpng on x86 BeOS. 2 | 3 | It defines PNG_USE_PNGGCCRD, which activates the assembly code in 4 | pnggccrd.c; this hasn't been extensively tested on BeOS. 5 | 6 | To install: 7 | 8 | 1) build 9 | 10 | Note: As of version 1.0.10, you'll get a fair number of warnings when 11 | you compile pnggccrd.c. As far as I know, these are harmless, 12 | but it would be better if someone fixed them. 13 | 14 | 2) copy and png.h, pngconf.h somewhere; /boot/home/config/include (which 15 | you'll have to make) is a good choice 16 | 17 | 3) copy libpng.so to /boot/home/config/lib 18 | 19 | 4) build your libpng.so applications (remember to include libz.a as 20 | well when you link) 21 | 22 | - Chris Herborth, March 27, 2001 23 | -------------------------------------------------------------------------------- /libpng/projects/beos/x86-static.txt: -------------------------------------------------------------------------------- 1 | This project builds a static library version of libpng on x86 BeOS. 2 | 3 | It defines PNG_USE_PNGGCCRD, which activates the assembly code in 4 | pnggccrd.c; this hasn't been extensively tested on BeOS. 5 | 6 | To install: 7 | 8 | 1) build 9 | 10 | Note: As of version 1.0.10, you'll get a fair number of warnings when 11 | you compile pnggccrd.c. As far as I know, these are harmless, 12 | but it would be better if someone fixed them. 13 | 14 | 2) copy and png.h, pngconf.h somewhere; /boot/home/config/include (which 15 | you'll have to make) is a good choice 16 | 17 | 3) copy libpng.a to /boot/home/config/lib 18 | 19 | 4) build your libpng.a applications (remember to include libz.a as 20 | well when you link) 21 | 22 | - Chris Herborth, March 27, 2001 23 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /utils-cpp/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 | -------------------------------------------------------------------------------- /libpng/contrib/pngminus/makefile.tc3: -------------------------------------------------------------------------------- 1 | # Makefile for PngMinus (png2pnm and pnm2png) 2 | # TurboC++ 3.0 3 | 4 | CC=tcc -Ic:\tc3\inc 5 | LD=tcc -Lc:\tc3\lib 6 | LB=tlib 7 | RM=del 8 | CP=copy 9 | MODEL=l 10 | CCFLAGS=-O -m$(MODEL) -I..\libpng -I..\zlib 11 | LDFLAGS=-m$(MODEL) -L..\libpng -L..\zlib 12 | C=.c 13 | O=.obj 14 | L=.lib 15 | E=.exe 16 | 17 | # dependencies 18 | 19 | all: png2pnm$(E) pnm2png$(E) 20 | 21 | png2pnm$(O): png2pnm$(C) 22 | $(CC) -c $(CCFLAGS) png2pnm$(C) 23 | 24 | png2pnm$(E): png2pnm$(O) 25 | $(LD) $(LDFLAGS) png2pnm$(O) libpng$(L) zlib$(L) 26 | 27 | pnm2png$(O): pnm2png$(C) 28 | $(CC) -c $(CCFLAGS) pnm2png$(C) 29 | 30 | pnm2png$(E): pnm2png$(O) 31 | $(LD) $(LDFLAGS) pnm2png$(O) libpng$(L) zlib$(L) 32 | 33 | clean: 34 | $(RM) *$(O) 35 | $(RM) *$(E) 36 | 37 | # End of makefile for png2pnm / pnm2png 38 | 39 | -------------------------------------------------------------------------------- /expat/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 | -------------------------------------------------------------------------------- /libpng/contrib/visupng/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by VisualPng.rc 4 | // 5 | #define IDM_FILE_OPEN 40001 6 | #define IDM_FILE_SAVE 40002 7 | #define IDM_FILE_NEXT 40003 8 | #define IDM_FILE_PREVIOUS 40004 9 | #define IDM_FILE_EXIT 40005 10 | #define IDM_OPTIONS_BACKGROUND 40006 11 | #define IDM_OPTIONS_STRETCH 40007 12 | #define IDM_HELP_ABOUT 40008 13 | 14 | // Next default values for new objects 15 | // 16 | #ifdef APSTUDIO_INVOKED 17 | #ifndef APSTUDIO_READONLY_SYMBOLS 18 | #define _APS_NEXT_RESOURCE_VALUE 113 19 | #define _APS_NEXT_COMMAND_VALUE 40009 20 | #define _APS_NEXT_CONTROL_VALUE 1001 21 | #define _APS_NEXT_SYMED_VALUE 101 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /libpng/projects/xcode/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | libpng 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.apple.carbonframeworktemplate 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | CFBundleShortVersionString 22 | 1.0 23 | CSResourcesFileMapped 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /libpng/KNOWNBUG: -------------------------------------------------------------------------------- 1 | 2 | Known bugs in libpng version 1.2.46 3 | 4 | 1. February 23, 2006: The custom makefiles don't build libpng with -lz. 5 | 6 | STATUS: This is a subject of debate. The change will probably be made 7 | as a part of a major overhaul of the makefiles in libpng version 1.4.0. 8 | 9 | 2. February 24, 2006: The Makefile generated by the "configure" script 10 | fails to install symbolic links 11 | libpng12.so => libpng12.so.0.1.2.9betaN 12 | that are generated by the custom makefiles. 13 | 14 | 3. September 4, 2007: There is a report that pngtest crashes on MacOS 10. 15 | 16 | STATUS: workarounds are 17 | 1) Compile without optimization (crashes are observed with 18 | -arch i386 and -O2 or -O3, using gcc-4.0.1). 19 | 2) Compile pngtest.c with PNG_DEBUG defined (the bug goes away if 20 | you try to look at it). 21 | 3) Ignore the crash. The library itself seems to be OK. 22 | 23 | -------------------------------------------------------------------------------- /ResourceFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 The Android Open Source Project 3 | // 4 | // Build resource files from raw assets. 5 | // 6 | 7 | #ifndef RESOURCE_FILTER_H 8 | #define RESOURCE_FILTER_H 9 | 10 | #include "AaptAssets.h" 11 | 12 | /** 13 | * Implements logic for parsing and handling "-c" and "--preferred-configurations" 14 | * options. 15 | */ 16 | class ResourceFilter 17 | { 18 | public: 19 | ResourceFilter() : mData(), mContainsPseudo(false) {} 20 | status_t parse(const char* arg); 21 | bool isEmpty() const; 22 | bool match(int axis, uint32_t value) const; 23 | bool match(int axis, const ResTable_config& config) const; 24 | bool match(const ResTable_config& config) const; 25 | const SortedVector* configsForAxis(int axis) const; 26 | inline bool containsPseudo() const { return mContainsPseudo; } 27 | 28 | private: 29 | KeyedVector > mData; 30 | bool mContainsPseudo; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/encoder/makefile: -------------------------------------------------------------------------------- 1 | # Makefile for PngMinus (pnm2pngm) 2 | # Linux / Unix 3 | 4 | #CC=cc 5 | CC=gcc 6 | LD=$(CC) 7 | 8 | RM=rm -f 9 | 10 | CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1 11 | 12 | C=.c 13 | O=.o 14 | L=.a 15 | E= 16 | 17 | ZOBJS = adler32$(O) compress$(O) crc32$(O) deflate$(O) \ 18 | dummy_inflate$(O) \ 19 | trees$(O) uncompr$(O) zutil$(O) 20 | 21 | OBJS = pnm2pngm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ 22 | pngset$(O) pngtrans$(O) pngwio$(O) pngwrite$(O) \ 23 | pngwtran$(O) pngwutil$(O) $(ZOBJS) 24 | 25 | # implicit make rules ------------------------------------------------------- 26 | 27 | .c$(O): png.h pngconf.h pngusr.h zlib.h 28 | $(CC) -c $(CFLAGS) $< 29 | 30 | # dependencies 31 | 32 | all: pnm2pngm$(E) 33 | 34 | pnm2pngm$(E): $(OBJS) 35 | $(LD) -o pnm2pngm$(E) $(OBJS) 36 | strip pnm2pngm$(E) 37 | 38 | clean: 39 | $(RM) pnm2pngm$(O) 40 | $(RM) pnm2pngm$(E) 41 | $(RM) $(OBJS) 42 | 43 | # End of makefile for pnm2pngm 44 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/encoder/makefile.std: -------------------------------------------------------------------------------- 1 | # Makefile for PngMinus (pnm2pngm) 2 | # Linux / Unix 3 | 4 | #CC=cc 5 | CC=gcc 6 | LD=$(CC) 7 | 8 | RM=rm -f 9 | 10 | CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1 11 | 12 | C=.c 13 | O=.o 14 | L=.a 15 | E= 16 | 17 | ZOBJS = adler32$(O) compress$(O) crc32$(O) deflate$(O) gzio$(O) \ 18 | dummy_inflate$(O) \ 19 | trees$(O) uncompr$(O) zutil$(O) 20 | 21 | OBJS = pnm2pngm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ 22 | pngset$(O) pngtrans$(O) pngwio$(O) pngwrite$(O) \ 23 | pngwtran$(O) pngwutil$(O) $(ZOBJS) 24 | 25 | # implicit make rules ------------------------------------------------------- 26 | 27 | .c$(O): png.h pngconf.h pngusr.h zlib.h 28 | $(CC) -c $(CFLAGS) $< 29 | 30 | # dependencies 31 | 32 | all: pnm2pngm$(E) 33 | 34 | pnm2pngm$(E): $(OBJS) 35 | $(LD) -o pnm2pngm$(E) $(OBJS) 36 | strip pnm2pngm$(E) 37 | 38 | clean: 39 | $(RM) pnm2pngm$(O) 40 | $(RM) pnm2pngm$(E) 41 | $(RM) $(OBJS) 42 | 43 | # End of makefile for pnm2pngm 44 | -------------------------------------------------------------------------------- /libpng/projects/cbuilder5/libpng.readme.txt: -------------------------------------------------------------------------------- 1 | Project files to build libpng using Borland C++ Builder v5.0 2 | 3 | In order to build and use libpng, please follow these steps: 4 | 5 | 1). Install zlib in a directory at the same level with libpng. 6 | 7 | 2). In a console window, go to the zlib directory and type: 8 | make -f win32\Makefile.bor 9 | After performing this step, you should have a file named 10 | zlib.lib in the zlib directory. 11 | 12 | 3). Add the following conditional define to your project: 13 | PNG_USE_DLL 14 | 15 | 4). Add libpng.lib or libpngstat.lib to the project. 16 | Build the project. 17 | 18 | 5). If the build fails, add the paths to png.h and zlib.h to 19 | your include path, and restart the build. 20 | 21 | By default, the libpng project uses zlib as a static library. If 22 | you wish to use zlib as a DLL, please read the important notes from 23 | the zlib DLL FAQ, found inside the zlib distribution. 24 | 25 | See the libpng documentation for instructions on how to use the code. 26 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/decoder/makefile: -------------------------------------------------------------------------------- 1 | # Makefile for PngMinus (pngm2pnm) 2 | # Linux / Unix 3 | 4 | #CC=cc 5 | CC=gcc 6 | LD=$(CC) 7 | 8 | RM=rm -f 9 | 10 | CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ 11 | -DdeflateParams\(a,b,c\)=Z_OK -I. -O1 12 | 13 | C=.c 14 | O=.o 15 | L=.a 16 | E= 17 | 18 | ZOBJS = adler32$(O) crc32$(O) \ 19 | infback$(O) inffast$(O) inflate$(O) inftrees$(O) \ 20 | trees$(O) uncompr$(O) zutil$(O) 21 | 22 | OBJS = pngm2pnm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ 23 | pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \ 24 | pngset$(O) pngtrans$(O) $(ZOBJS) 25 | 26 | # implicit make rules ------------------------------------------------------- 27 | 28 | .c$(O): png.h pngconf.h pngusr.h zlib.h 29 | $(CC) -c $(CFLAGS) $< 30 | 31 | # dependencies 32 | 33 | all: pngm2pnm$(E) 34 | 35 | pngm2pnm$(E): $(OBJS) 36 | $(LD) -o pngm2pnm$(E) $(OBJS) 37 | strip pngm2pnm$(E) 38 | 39 | clean: 40 | $(RM) pngm2pnm$(O) 41 | $(RM) pngm2pnm$(E) 42 | $(RM) $(OBJS) 43 | 44 | # End of makefile for pngm2pnm 45 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/decoder/makefile.std: -------------------------------------------------------------------------------- 1 | # Makefile for PngMinus (pngm2pnm) 2 | # Linux / Unix 3 | 4 | #CC=cc 5 | CC=gcc 6 | LD=$(CC) 7 | 8 | RM=rm -f 9 | 10 | CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ 11 | -DdeflateParams\(a,b,c\)=Z_OK -I. -O1 12 | 13 | C=.c 14 | O=.o 15 | L=.a 16 | E= 17 | 18 | ZOBJS = adler32$(O) crc32$(O) gzio$(O) \ 19 | infback$(O) inffast$(O) inflate$(O) inftrees$(O) \ 20 | trees$(O) uncompr$(O) zutil$(O) 21 | 22 | OBJS = pngm2pnm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ 23 | pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \ 24 | pngset$(O) pngtrans$(O) $(ZOBJS) 25 | 26 | # implicit make rules ------------------------------------------------------- 27 | 28 | .c$(O): png.h pngconf.h pngusr.h zlib.h 29 | $(CC) -c $(CFLAGS) $< 30 | 31 | # dependencies 32 | 33 | all: pngm2pnm$(E) 34 | 35 | pngm2pnm$(E): $(OBJS) 36 | $(LD) -o pngm2pnm$(E) $(OBJS) 37 | strip pngm2pnm$(E) 38 | 39 | clean: 40 | $(RM) pngm2pnm$(O) 41 | $(RM) pngm2pnm$(E) 42 | $(RM) $(OBJS) 43 | 44 | # End of makefile for pngm2pnm 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /zlib/NOTICE: -------------------------------------------------------------------------------- 1 | (C) 1995-2013 Jean-loup Gailly and Mark Adler 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | 19 | Jean-loup Gailly Mark Adler 20 | jloup@gzip.org madler@alumni.caltech.edu 21 | -------------------------------------------------------------------------------- /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 | #include 21 | 22 | namespace android { 23 | 24 | class Functor { 25 | public: 26 | Functor() {} 27 | virtual ~Functor() {} 28 | virtual status_t operator ()(int what, void* data) { return NO_ERROR; } 29 | }; 30 | 31 | }; // namespace android 32 | 33 | #endif // ANDROID_FUNCTOR_H 34 | -------------------------------------------------------------------------------- /libpng/projects/cbuilder5/libpng.bpg: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | VERSION = BWS.01 3 | #------------------------------------------------------------------------------ 4 | !ifndef ROOT 5 | ROOT = $(MAKEDIR)\.. 6 | !endif 7 | #------------------------------------------------------------------------------ 8 | MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** 9 | DCC = $(ROOT)\bin\dcc32.exe $** 10 | BRCC = $(ROOT)\bin\brcc32.exe $** 11 | #------------------------------------------------------------------------------ 12 | PROJECTS = libpngstat.lib libpng.dll 13 | #------------------------------------------------------------------------------ 14 | default: $(PROJECTS) 15 | #------------------------------------------------------------------------------ 16 | 17 | libpngstat.lib: libpngstat.bpr 18 | $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** 19 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 20 | 21 | libpng.dll: libpng.bpr 22 | $(ROOT)\bin\bpr2mak $** 23 | $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak 24 | 25 | 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpng/scripts/smakefile.ppc: -------------------------------------------------------------------------------- 1 | # Amiga powerUP (TM) Makefile 2 | # makefile for libpng and SAS C V6.58/7.00 PPC compiler 3 | # Copyright (C) 1998 by Andreas R. Kleinert 4 | # 5 | # This code is released under the libpng license. 6 | # For conditions of distribution and use, see the disclaimer 7 | # and license in png.h 8 | 9 | CC = scppc 10 | CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL IDIR /zlib \ 11 | OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 12 | LIBNAME = libpng.a 13 | AR = ppc-amigaos-ar 14 | AR_FLAGS = cr 15 | RANLIB = ppc-amigaos-ranlib 16 | LDFLAGS = -r -o 17 | LDLIBS = ../zlib/libzip.a LIB:scppc.a 18 | LN = ppc-amigaos-ld 19 | RM = delete quiet 20 | MKDIR = makedir 21 | 22 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o pngread.o \ 23 | pngerror.o pngpread.o pngwrite.o pngrtran.o pngwtran.o pngrio.o pngwio.o pngmem.o 24 | 25 | all: $(LIBNAME) pngtest 26 | 27 | $(LIBNAME): $(OBJS) 28 | $(AR) $(AR_FLAGS) $@ $(OBJS) 29 | $(RANLIB) $@ 30 | 31 | pngtest: pngtest.o $(LIBNAME) 32 | $(LN) $(LDFLAGS) pngtest LIB:c_ppc.o pngtest.o $(LIBNAME) $(LDLIBS) \ 33 | LIB:end.o 34 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpng/contrib/visupng/PngFile.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------ 2 | // PNGFILE.H -- Header File for pngfile.c 3 | //------------------------------------------ 4 | 5 | // Copyright 2000, Willem van Schaik. 6 | 7 | // This code is released under the libpng license. 8 | // For conditions of distribution and use, see the disclaimer 9 | // and license in png.h 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | void PngFileInitialize (HWND hwnd) ; 17 | BOOL PngFileOpenDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName) ; 18 | BOOL PngFileSaveDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName) ; 19 | 20 | BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, 21 | int *piWidth, int *piHeight, int *piChannels, png_color *pBkgColor); 22 | BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData, 23 | int iWidth, int iHeight, png_color BkgColor); 24 | 25 | #if defined(PNG_NO_STDIO) 26 | static void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length); 27 | static void png_write_data(png_structp png_ptr, png_bytep data, png_size_t length); 28 | static void png_flush(png_structp png_ptr); 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /zlib/update_zlib.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Run with no arguments from any directory, with no special setup required. 3 | 4 | # Abort if any command returns an error exit status, or if an undefined 5 | # variable is used. 6 | set -e 7 | set -u 8 | 9 | base_dir=$(realpath $(dirname $0)) 10 | 11 | # Extract the latest version from the web page. 12 | new_version=$(wget -O - --no-verbose -q http://zlib.net/ | \ 13 | grep 'http://zlib.net/zlib-[0-9].*.tar.gz' | \ 14 | sed 's/.*zlib-\(.*\)\.tar\.gz.*/\1/') 15 | tgz_file="zlib-$new_version.tar.gz" 16 | 17 | echo "Upgrading zlib to version $new_version..." 18 | echo "-------------------------------------------------------------------" 19 | 20 | echo "Downloading $tgz_file..." 21 | wget -O /tmp/$tgz_file --no-verbose "http://zlib.net/$tgz_file" 22 | 23 | echo "Cleaning out old version..." 24 | src_dir=$base_dir/src 25 | rm -rf $src_dir 26 | 27 | echo "Unpacking new version..." 28 | cd $base_dir 29 | tar zxf /tmp/$tgz_file 30 | mv zlib-$new_version src 31 | 32 | echo "Configuring new version..." 33 | cd src 34 | ./configure 35 | rm Makefile configure.log 36 | cd .. 37 | 38 | echo "Fixing NOTICE file..." 39 | grep -A21 'Copyright notice:' src/README | tail -20 > NOTICE 40 | 41 | md5_sum=$(md5sum /tmp/$tgz_file) 42 | echo "MD5: $md5_sum" 43 | -------------------------------------------------------------------------------- /libpng/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 | -------------------------------------------------------------------------------- /utils/zLog.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /cutils-c/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 | -------------------------------------------------------------------------------- /libpng/projects/visualc6/libpng.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "libpng"=".\libpng.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | Begin Project Dependency 15 | Project_Dep_Name zlib 16 | End Project Dependency 17 | }}} 18 | 19 | ############################################################################### 20 | 21 | Project: "pngtest"=".\pngtest.dsp" - Package Owner=<4> 22 | 23 | Package=<5> 24 | {{{ 25 | }}} 26 | 27 | Package=<4> 28 | {{{ 29 | Begin Project Dependency 30 | Project_Dep_Name libpng 31 | End Project Dependency 32 | }}} 33 | 34 | ############################################################################### 35 | 36 | Project: "zlib"="..\..\..\zlib\projects\visualc6\zlib.dsp" - Package Owner=<4> 37 | 38 | Package=<5> 39 | {{{ 40 | }}} 41 | 42 | Package=<4> 43 | {{{ 44 | }}} 45 | 46 | ############################################################################### 47 | 48 | Global: 49 | 50 | Package=<5> 51 | {{{ 52 | }}} 53 | 54 | Package=<3> 55 | {{{ 56 | }}} 57 | 58 | ############################################################################### 59 | 60 | -------------------------------------------------------------------------------- /libpng/scripts/descrip.mms: -------------------------------------------------------------------------------- 1 | 2 | cc_defs = /inc=$(ZLIBSRC) 3 | c_deb = 4 | 5 | .ifdef __DECC__ 6 | pref = /prefix=all 7 | .endif 8 | 9 | 10 | 11 | OBJS = png.obj, pngset.obj, pngget.obj, pngrutil.obj, pngtrans.obj,\ 12 | pngwutil.obj, pngread.obj, pngmem.obj, pngwrite.obj, pngrtran.obj,\ 13 | pngwtran.obj, pngrio.obj, pngwio.obj, pngerror.obj, pngpread.obj 14 | 15 | 16 | CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) 17 | 18 | all : pngtest.exe libpng.olb 19 | @ write sys$output " pngtest available" 20 | 21 | libpng.olb : libpng.olb($(OBJS)) 22 | @ write sys$output " Libpng available" 23 | 24 | 25 | pngtest.exe : pngtest.obj libpng.olb 26 | link pngtest,libpng.olb/lib,$(ZLIBSRC)libz.olb/lib 27 | 28 | test : pngtest.exe 29 | run pngtest 30 | 31 | clean : 32 | delete *.obj;*,*.exe; 33 | 34 | 35 | # Other dependencies. 36 | png.obj : png.h, pngconf.h 37 | pngpread.obj : png.h, pngconf.h 38 | pngset.obj : png.h, pngconf.h 39 | pngget.obj : png.h, pngconf.h 40 | pngread.obj : png.h, pngconf.h 41 | pngrtran.obj : png.h, pngconf.h 42 | pngrutil.obj : png.h, pngconf.h 43 | pngerror.obj : png.h, pngconf.h 44 | pngmem.obj : png.h, pngconf.h 45 | pngrio.obj : png.h, pngconf.h 46 | pngwio.obj : png.h, pngconf.h 47 | pngtrans.obj : png.h, pngconf.h 48 | pngwrite.obj : png.h, pngconf.h 49 | pngwtran.obj : png.h, pngconf.h 50 | pngwutil.obj : png.h, pngconf.h 51 | 52 | pngtest.obj : png.h, pngconf.h 53 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 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 | CrunchCache.cpp \ 17 | FileFinder.cpp \ 18 | Main.cpp \ 19 | Package.cpp \ 20 | StringPool.cpp \ 21 | XMLNode.cpp \ 22 | ResourceFilter.cpp \ 23 | ResourceTable.cpp \ 24 | Images.cpp \ 25 | Resource.cpp \ 26 | SourcePos.cpp \ 27 | ZipEntry.cpp \ 28 | ZipFile.cpp 29 | 30 | 31 | LOCAL_CFLAGS += -Wno-format-y2k 32 | 33 | LOCAL_C_INCLUDES += external/expat/lib 34 | LOCAL_C_INCLUDES += external/libpng 35 | LOCAL_C_INCLUDES += external/zlib 36 | LOCAL_C_INCLUDES += build/libs/host/include 37 | 38 | #LOCAL_WHOLE_STATIC_LIBRARIES := 39 | LOCAL_STATIC_LIBRARIES := \ 40 | libhost \ 41 | libutils \ 42 | libcutils \ 43 | libexpat \ 44 | libpng 45 | 46 | ifeq ($(HOST_OS),linux) 47 | LOCAL_LDLIBS += -lrt -lpthread 48 | endif 49 | 50 | # Statically link libz for MinGW (Win SDK under Linux), 51 | # and dynamically link for all others. 52 | ifneq ($(strip $(USE_MINGW)),) 53 | LOCAL_STATIC_LIBRARIES += libz 54 | else 55 | LOCAL_LDLIBS += -lz 56 | endif 57 | 58 | LOCAL_MODULE := aapt 59 | 60 | include $(BUILD_HOST_EXECUTABLE) 61 | 62 | endif # TARGET_BUILD_APPS 63 | -------------------------------------------------------------------------------- /zipfile/private.h: -------------------------------------------------------------------------------- 1 | #ifndef PRIVATE_H 2 | #define PRIVATE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | typedef struct Zipentry { 11 | unsigned long fileNameLength; 12 | const unsigned char* fileName; 13 | unsigned short compressionMethod; 14 | unsigned int uncompressedSize; 15 | unsigned int compressedSize; 16 | const unsigned char* data; 17 | 18 | struct Zipentry* next; 19 | } Zipentry; 20 | 21 | typedef struct Zipfile 22 | { 23 | const unsigned char *buf; 24 | ssize_t bufsize; 25 | 26 | // Central directory 27 | unsigned short disknum; //mDiskNumber; 28 | unsigned short diskWithCentralDir; //mDiskWithCentralDir; 29 | unsigned short entryCount; //mNumEntries; 30 | unsigned short totalEntryCount; //mTotalNumEntries; 31 | unsigned int centralDirSize; //mCentralDirSize; 32 | unsigned int centralDirOffest; // offset from first disk //mCentralDirOffset; 33 | unsigned short commentLen; //mCommentLen; 34 | const unsigned char* comment; //mComment; 35 | 36 | Zipentry* entries; 37 | } Zipfile; 38 | 39 | int read_central_dir(Zipfile* file); 40 | 41 | unsigned int read_le_int(const unsigned char* buf); 42 | unsigned int read_le_short(const unsigned char* buf); 43 | 44 | #endif // PRIVATE_H 45 | 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /utils/Compat.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 __LIB_UTILS_COMPAT_H 18 | #define __LIB_UTILS_COMPAT_H 19 | 20 | #include 21 | 22 | /* Compatibility definitions for non-Linux (i.e., BSD-based) hosts. */ 23 | #ifndef HAVE_OFF64_T 24 | #if _FILE_OFFSET_BITS < 64 25 | #error "_FILE_OFFSET_BITS < 64; large files are not supported on this platform" 26 | #endif /* _FILE_OFFSET_BITS < 64 */ 27 | 28 | /*typedef off_t off64_t; 29 | 30 | static inline off64_t lseek64(int fd, off64_t offset, int whence) { 31 | return lseek(fd, offset, whence); 32 | }*/ 33 | 34 | #ifdef HAVE_PREAD 35 | static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { 36 | return pread(fd, buf, nbytes, offset); 37 | } 38 | #endif 39 | 40 | #endif /* !HAVE_OFF64_T */ 41 | 42 | #endif /* __LIB_UTILS_COMPAT_H */ 43 | -------------------------------------------------------------------------------- /cutils-c/sockets.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 | #include 19 | 20 | #ifdef HAVE_ANDROID_OS 21 | /* For the socket trust (credentials) check */ 22 | #include 23 | #endif 24 | 25 | bool socket_peer_is_trusted(int fd) 26 | { 27 | #ifdef HAVE_ANDROID_OS 28 | struct ucred cr; 29 | socklen_t len = sizeof(cr); 30 | int n = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len); 31 | 32 | if (n != 0) { 33 | LOGE("could not get socket credentials: %s\n", strerror(errno)); 34 | return false; 35 | } 36 | 37 | if ((cr.uid != AID_ROOT) && (cr.uid != AID_SHELL)) { 38 | LOGE("untrusted userid on other end of socket: userid %d\n", cr.uid); 39 | return false; 40 | } 41 | #endif 42 | 43 | return true; 44 | } 45 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.amiga: -------------------------------------------------------------------------------- 1 | # Commodore Amiga Makefile 2 | # makefile for libpng and SAS C V6.5x compiler 3 | # Copyright (C) 1995-2000 Wolf Faust 4 | # 5 | # This code is released under the libpng license. 6 | # For conditions of distribution and use, see the disclaimer 7 | # and license in png.h 8 | # 9 | # Note: Use #define PNG_READ_BIG_ENDIAN_SUPPORTED in pngconf.h 10 | # 11 | # Location/path of zlib include files 12 | ZLIB=/zlib 13 | #compiler 14 | CC=sc 15 | #compiler flags 16 | # WARNING: a bug in V6.51 causes bad code with OPTGO 17 | # So use V6.55 or set NOOPTGO!!!!!!!!! 18 | CFLAGS= NOSTKCHK PARMS=REG OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL\ 19 | OPTLOOP OPTRDEP=4 OPTDEP=4 OPTCOMP=4 INCLUDEDIR=$(ZLIB) \ 20 | DEFINE=PNG_INTERNAL 21 | #linker flags 22 | LDFLAGS= SD ND BATCH 23 | #link libs 24 | LDLIBS= libpng.lib libgz.lib LIB:scm.lib LIB:sc.lib Lib:amiga.lib 25 | # linker 26 | LN= slink 27 | # file deletion command 28 | RM= delete quiet 29 | # library (.lib) file creation command 30 | AR= oml 31 | # make directory command 32 | MKDIR= makedir 33 | 34 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ 35 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ 36 | pngwtran.o pngmem.o pngerror.o pngpread.o 37 | 38 | all: libpng.lib pngtest 39 | 40 | libpng.lib: $(OBJS) 41 | -$(RM) libpng.lib 42 | $(AR) libpng.lib r $(OBJS) 43 | 44 | pngtest: pngtest.o libpng.lib 45 | $(LN) 50 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.ne12bsd: -------------------------------------------------------------------------------- 1 | # makefile for libpng for NetBSD for the standard 2 | # make obj && make depend && make && make test 3 | # make includes && make install 4 | # Copyright (C) 2002 Patrick R.L. Welche 5 | # Copyright (C) 2007, 2009 Glenn Randers-Pehrson 6 | # 7 | # This code is released under the libpng license. 8 | # For conditions of distribution and use, see the disclaimer 9 | # and license in png.h 10 | 11 | # You should also run makefile.netbsd 12 | 13 | LOCALBASE?=/usr/local 14 | LIBDIR= ${LOCALBASE}/lib 15 | MANDIR= ${LOCALBASE}/man 16 | INCSDIR=${LOCALBASE}/include/libpng12 17 | 18 | LIB= png12 19 | SHLIB_MAJOR= 0 20 | SHLIB_MINOR= 1.2.46 21 | SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ 22 | pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ 23 | pngwtran.c pngmem.c pngerror.c pngpread.c 24 | INCS= png.h pngconf.h 25 | MAN= libpng.3 libpngpf.3 png.5 26 | 27 | CPPFLAGS+=-I${.CURDIR} 28 | 29 | # We should be able to do something like this instead of the manual 30 | # uncommenting, but it core dumps for me at the moment: 31 | # .if ${MACHINE_ARCH} == "i386" 32 | # CPPFLAGS+=-DPNG_THREAD_UNSAFE_OK 33 | # MKLINT= no 34 | # .else 35 | CPPFLAGS+=-DPNG_NO_MMX_CODE 36 | # .endif 37 | 38 | CLEANFILES+=pngtest.o pngtest 39 | 40 | pngtest.o: pngtest.c 41 | ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} 42 | 43 | pngtest: pngtest.o libpng.a 44 | ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm 45 | 46 | test: pngtest 47 | cd ${.CURDIR} && ${.OBJDIR}/pngtest 48 | 49 | .include 50 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.freebsd: -------------------------------------------------------------------------------- 1 | # makefile for libpng under FreeBSD 2 | # Copyright (C) 2002, 2007, 2009 Glenn Randers-Pehrson and Andrey A. Chernov 3 | # 4 | # This code is released under the libpng license. 5 | # For conditions of distribution and use, see the disclaimer 6 | # and license in png.h 7 | 8 | PREFIX?= /usr/local 9 | SHLIB_VER?= 5 10 | 11 | LIB= png 12 | SHLIB_MAJOR= ${SHLIB_VER} 13 | SHLIB_MINOR= 0 14 | NOPROFILE= YES 15 | NOOBJ= YES 16 | 17 | # where make install puts libpng.a and png.h 18 | DESTDIR= ${PREFIX} 19 | LIBDIR= /lib 20 | INCS= png.h pngconf.h 21 | INCSDIR= /include/libpng 22 | INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk 23 | MAN= libpng.3 libpngpf.3 png.5 24 | MANDIR= /man/man 25 | SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \ 26 | libpng/pngconf.h ${INCSDIR}/../pngconf.h 27 | LDADD+= -lm -lz 28 | DPADD+= ${LIBM} ${LIBZ} 29 | 30 | CFLAGS+= -I. 31 | .if (${MACHINE_ARCH} != "i386") 32 | CFLAGS+= -DPNG_CONFIGURE_LIBPNG -DPNG_NO_MMX_CODE 33 | .endif 34 | 35 | SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ 36 | pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ 37 | pngwtran.c pngmem.c pngerror.c pngpread.c 38 | 39 | pngtest: pngtest.o libpng.a 40 | ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm 41 | 42 | CLEANFILES= pngtest pngtest.o pngout.png 43 | 44 | test: pngtest 45 | ./pngtest 46 | 47 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO 48 | writelock: 49 | chmod a-w *.[ch35] $(DOCS) scripts/* 50 | 51 | .include 52 | -------------------------------------------------------------------------------- /libpng/scripts/libpng.icc: -------------------------------------------------------------------------------- 1 | // Project file for libpng (static) 2 | // IBM VisualAge/C++ version 4.0 or later 3 | // Copyright (C) 2000 Cosmin Truta 4 | // 5 | // This code is released under the libpng license. 6 | // For conditions of distribution and use, see the disclaimer 7 | // and license in png.h 8 | // 9 | // Notes: 10 | // All modules are compiled in C mode 11 | // Tested with IBM VAC++ 4.0 under Win32 12 | // Expected to work with IBM VAC++ 4.0 or later under OS/2 and Win32 13 | // Can be easily adapted for IBM VAC++ 4.0 or later under AIX 14 | 15 | option incl(searchpath, "../zlib"), opt(level, "2"), 16 | link(libsearchpath, "../zlib") 17 | { 18 | target type(lib) "libpng.lib" 19 | { 20 | source type(c) "png.c" 21 | source type(c) "pngerror.c" 22 | source type(c) "pngget.c" 23 | source type(c) "pngmem.c" 24 | source type(c) "pngpread.c" 25 | source type(c) "pngread.c" 26 | source type(c) "pngrio.c" 27 | source type(c) "pngrtran.c" 28 | source type(c) "pngrutil.c" 29 | source type(c) "pngset.c" 30 | source type(c) "pngtrans.c" 31 | source type(c) "pngwio.c" 32 | source type(c) "pngwrite.c" 33 | source type(c) "pngwtran.c" 34 | source type(c) "pngwutil.c" 35 | } 36 | } 37 | 38 | option incl(searchpath, "../zlib"), opt(level, "2"), 39 | link(libsearchpath, "../zlib") 40 | { 41 | target type(exe) "pngtest.exe" 42 | { 43 | source type(c) "pngtest.c" 44 | source type(lib) "libpng.lib" 45 | source type(lib) "zlib.lib" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /zlib/zlib.map: -------------------------------------------------------------------------------- 1 | ZLIB_1.2.0 { 2 | global: 3 | compressBound; 4 | deflateBound; 5 | inflateBack; 6 | inflateBackEnd; 7 | inflateBackInit_; 8 | inflateCopy; 9 | local: 10 | deflate_copyright; 11 | inflate_copyright; 12 | inflate_fast; 13 | inflate_table; 14 | zcalloc; 15 | zcfree; 16 | z_errmsg; 17 | gz_error; 18 | gz_intmax; 19 | _*; 20 | }; 21 | 22 | ZLIB_1.2.0.2 { 23 | gzclearerr; 24 | gzungetc; 25 | zlibCompileFlags; 26 | } ZLIB_1.2.0; 27 | 28 | ZLIB_1.2.0.8 { 29 | deflatePrime; 30 | } ZLIB_1.2.0.2; 31 | 32 | ZLIB_1.2.2 { 33 | adler32_combine; 34 | crc32_combine; 35 | deflateSetHeader; 36 | inflateGetHeader; 37 | } ZLIB_1.2.0.8; 38 | 39 | ZLIB_1.2.2.3 { 40 | deflateTune; 41 | gzdirect; 42 | } ZLIB_1.2.2; 43 | 44 | ZLIB_1.2.2.4 { 45 | inflatePrime; 46 | } ZLIB_1.2.2.3; 47 | 48 | ZLIB_1.2.3.3 { 49 | adler32_combine64; 50 | crc32_combine64; 51 | gzopen64; 52 | gzseek64; 53 | gztell64; 54 | inflateUndermine; 55 | } ZLIB_1.2.2.4; 56 | 57 | ZLIB_1.2.3.4 { 58 | inflateReset2; 59 | inflateMark; 60 | } ZLIB_1.2.3.3; 61 | 62 | ZLIB_1.2.3.5 { 63 | gzbuffer; 64 | gzoffset; 65 | gzoffset64; 66 | gzclose_r; 67 | gzclose_w; 68 | } ZLIB_1.2.3.4; 69 | 70 | ZLIB_1.2.5.1 { 71 | deflatePending; 72 | } ZLIB_1.2.3.5; 73 | 74 | ZLIB_1.2.5.2 { 75 | deflateResetKeep; 76 | gzgetc_; 77 | inflateResetKeep; 78 | } ZLIB_1.2.5.1; 79 | 80 | ZLIB_1.2.7.1 { 81 | inflateGetDictionary; 82 | gzvprintf; 83 | } ZLIB_1.2.5.2; 84 | -------------------------------------------------------------------------------- /libpng/projects/cbuilder5/libpng.cpp: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #include 3 | //--------------------------------------------------------------------------- 4 | // Important note about DLL memory management when your DLL uses the 5 | // static version of the RunTime Library: 6 | // 7 | // If your DLL exports any functions that pass String objects (or structs/ 8 | // classes containing nested Strings) as parameter or function results, 9 | // you will need to add the library MEMMGR.LIB to both the DLL project and 10 | // any other projects that use the DLL. You will also need to use MEMMGR.LIB 11 | // if any other projects which use the DLL will be performing new or delete 12 | // operations on any non-TObject-derived classes which are exported from the 13 | // DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling 14 | // EXE's to use the BORLNDMM.DLL as their memory manager. In these cases, 15 | // the file BORLNDMM.DLL should be deployed along with your DLL. 16 | // 17 | // To avoid using BORLNDMM.DLL, pass string information using "char *" or 18 | // ShortString parameters. 19 | // 20 | // If your DLL uses the dynamic version of the RTL, you do not need to 21 | // explicitly add MEMMGR.LIB as this will be done implicitly for you 22 | //--------------------------------------------------------------------------- 23 | 24 | int WINAPI DllEntryPoint(HINSTANCE, unsigned long, void*) 25 | { 26 | return 1; 27 | } 28 | //--------------------------------------------------------------------------- 29 | -------------------------------------------------------------------------------- /libpng/contrib/pngminus/makefile.std: -------------------------------------------------------------------------------- 1 | # Makefile for PngMinus (png2pnm and pnm2png) 2 | # Linux / Unix 3 | 4 | #CC=cc 5 | CC=gcc 6 | LD=$(CC) 7 | 8 | RM=rm -f 9 | 10 | #PNGPATH = /usr/local 11 | #PNGINC = -I$(PNGPATH)/include/libpng12 12 | #PNGLIB = -L$(PNGPATH)/lib -lpng12 13 | #PNGLIBS = $(PNGPATH)/lib/libpng12.a 14 | PNGINC = -I../.. 15 | PNGLIB = -L../.. -lpng 16 | PNGLIBS = ../../libpng.a 17 | 18 | #ZPATH = /usr/local 19 | #ZINC = -I$(ZPATH)/include 20 | #ZLIB = -L$(ZPATH)/lib -lz 21 | #ZLIBS = $(ZPATH)/lib/libz.a 22 | ZINC = -I../../../zlib 23 | ZLIB = -L../../../zlib -lz 24 | ZLIBS = ../../../zlib/libz.a 25 | 26 | CFLAGS=-O3 $(PNGINC) $(ZINC) 27 | LDFLAGS=$(PNGLIB) $(ZLIB) 28 | LDFLAGSS=$(PNGLIBS) $(ZLIBS) 29 | C=.c 30 | O=.o 31 | L=.a 32 | E= 33 | 34 | # dependencies 35 | 36 | #all: png2pnm$(E) pnm2png$(E) 37 | all: png2pnm$(E) pnm2png$(E) png2pnm-static$(E) pnm2png-static$(E) 38 | 39 | png2pnm$(O): png2pnm$(C) 40 | $(CC) -c $(CFLAGS) png2pnm$(C) 41 | 42 | png2pnm$(E): png2pnm$(O) 43 | $(LD) -o png2pnm$(E) png2pnm$(O) $(LDFLAGS) -lm 44 | 45 | png2pnm-static$(E): png2pnm$(O) 46 | $(LD) -o png2pnm-static$(E) png2pnm$(O) $(LDFLAGSS) -lm 47 | 48 | pnm2png$(O): pnm2png$(C) 49 | $(CC) -c $(CFLAGS) pnm2png$(C) 50 | 51 | pnm2png$(E): pnm2png$(O) 52 | $(LD) -o pnm2png$(E) pnm2png$(O) $(LDFLAGS) -lm 53 | 54 | pnm2png-static$(E): pnm2png$(O) 55 | $(LD) -o pnm2png-static$(E) pnm2png$(O) $(LDFLAGSS) -lm 56 | 57 | clean: 58 | $(RM) png2pnm$(O) 59 | $(RM) pnm2png$(O) 60 | $(RM) png2pnm$(E) 61 | $(RM) pnm2png$(E) 62 | $(RM) png2pnm-static$(E) 63 | $(RM) pnm2png-static$(E) 64 | 65 | # End of makefile for png2pnm / pnm2png 66 | -------------------------------------------------------------------------------- /libpng/contrib/pngminus/pnm2png.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # -- grayscale 3 | ./pnm2png basn0g01.pgm basn0g01.png 4 | ./pnm2png basn0g02.pgm basn0g02.png 5 | ./pnm2png basn0g04.pgm basn0g04.png 6 | ./pnm2png basn0g08.pgm basn0g08.png 7 | ./pnm2png basn0g16.pgm basn0g16.png 8 | # -- full-color 9 | ./pnm2png basn2c08.ppm basn2c08.png 10 | ./pnm2png basn2c16.ppm basn2c16.png 11 | # -- palletted 12 | ./pnm2png basn3p01.ppm basn3p01.png 13 | ./pnm2png basn3p02.ppm basn3p02.png 14 | ./pnm2png basn3p04.ppm basn3p04.png 15 | ./pnm2png basn3p08.ppm basn3p08.png 16 | # -- gray with alpha-channel 17 | ./pnm2png -alpha basn6a08.pgm basn4a08.pgm basn4a08.png 18 | ./pnm2png -alpha basn6a16.pgm basn4a16.pgm basn4a16.png 19 | # -- color with alpha-channel 20 | ./pnm2png -alpha basn6a08.pgm basn6a08.ppm basn6a08.png 21 | ./pnm2png -alpha basn6a16.pgm basn6a16.ppm basn6a16.png 22 | # -- grayscale 23 | ./pnm2png rawn0g01.pgm rawn0g01.png 24 | ./pnm2png rawn0g02.pgm rawn0g02.png 25 | ./pnm2png rawn0g04.pgm rawn0g04.png 26 | ./pnm2png rawn0g08.pgm rawn0g08.png 27 | ./pnm2png rawn0g16.pgm rawn0g16.png 28 | # -- full-color 29 | ./pnm2png rawn2c08.ppm rawn2c08.png 30 | ./pnm2png rawn2c16.ppm rawn2c16.png 31 | # -- palletted 32 | ./pnm2png rawn3p01.ppm rawn3p01.png 33 | ./pnm2png rawn3p02.ppm rawn3p02.png 34 | ./pnm2png rawn3p04.ppm rawn3p04.png 35 | ./pnm2png rawn3p08.ppm rawn3p08.png 36 | # -- gray with alpha-channel 37 | ./pnm2png -alpha rawn6a08.pgm rawn4a08.pgm rawn4a08.png 38 | ./pnm2png -alpha rawn6a16.pgm rawn4a16.pgm rawn4a16.png 39 | # -- color with alpha-channel 40 | ./pnm2png -alpha rawn6a08.pgm rawn6a08.ppm rawn6a08.png 41 | ./pnm2png -alpha rawn6a16.pgm rawn6a16.ppm rawn6a16.png 42 | 43 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.dj2: -------------------------------------------------------------------------------- 1 | # DJGPP (DOS gcc) makefile for libpng 2 | # Copyright (C) 2002, 2006, 2009 Glenn Randers-Pehrson 3 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. 4 | # 5 | # This code is released under the libpng license. 6 | # For conditions of distribution and use, see the disclaimer 7 | # and license in png.h 8 | 9 | # where make install will put libpng.a and png.h 10 | #prefix=/usr/local 11 | prefix=. 12 | INCPATH=$(prefix)/include 13 | LIBPATH=$(prefix)/lib 14 | 15 | CC=gcc 16 | CFLAGS=-I../zlib -O 17 | LDFLAGS=-L. -L../zlib/ -lpng -lz -lm 18 | 19 | RANLIB=ranlib 20 | 21 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ 22 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o pngwtran.o \ 23 | pngmem.o pngerror.o pngpread.o 24 | 25 | all: libpng.a pngtest 26 | 27 | libpng.a: $(OBJS) 28 | ar rc $@ $(OBJS) 29 | $(RANLIB) $@ 30 | 31 | pngtest: pngtest.o libpng.a 32 | $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) 33 | coff2exe pngtest 34 | 35 | test: pngtest 36 | ./pngtest 37 | clean: 38 | rm -f *.o libpng.a pngtest pngout.png 39 | 40 | # DO NOT DELETE THIS LINE -- make depend depends on it. 41 | 42 | png.o: png.h pngconf.h 43 | pngerror.o: png.h pngconf.h 44 | pngrio.o: png.h pngconf.h 45 | pngwio.o: png.h pngconf.h 46 | pngmem.o: png.h pngconf.h 47 | pngset.o: png.h pngconf.h 48 | pngget.o: png.h pngconf.h 49 | pngread.o: png.h pngconf.h 50 | pngpread.o: png.h pngconf.h 51 | pngrtran.o: png.h pngconf.h 52 | pngrutil.o: png.h pngconf.h 53 | pngtrans.o: png.h pngconf.h 54 | pngwrite.o: png.h pngconf.h 55 | pngwtran.o: png.h pngconf.h 56 | pngwutil.o: png.h pngconf.h 57 | 58 | pngtest.o: png.h pngconf.h 59 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/preader/makefile: -------------------------------------------------------------------------------- 1 | # Makefile for PngMinus (rpng2) 2 | # Linux / Unix 3 | 4 | #CC=cc 5 | CC=gcc 6 | LD=$(CC) 7 | 8 | RM=rm -f 9 | 10 | #XINC = -I/usr/include # old-style, stock X distributions 11 | #XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX) 12 | 13 | #XINC = -I/usr/openwin/include # Sun workstations (OpenWindows) 14 | #XLIB = -L/usr/openwin/lib -lX11 15 | 16 | XINC = -I/usr/X11R6/include # new X distributions (X.org, etc.) 17 | XLIB = -L/usr/X11R6/lib -lX11 18 | #XLIB = -L/usr/X11R6/lib64 -lX11 # e.g., Red Hat on AMD64 19 | 20 | #XINC = -I/usr/local/include # FreeBSD 21 | #XLIB = -L/usr/local/lib -lX11 22 | 23 | #LIBS = $(XLIB) 24 | LIBS = $(XLIB) -lm #platforms that need libm 25 | 26 | CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ 27 | -DdeflateParams\(a,b,c\)=Z_OK -I. $(XINC) -O1 28 | 29 | C=.c 30 | O=.o 31 | L=.a 32 | E= 33 | 34 | ZOBJS = adler32$(O) crc32$(O) \ 35 | infback$(O) inffast$(O) inflate$(O) inftrees$(O) \ 36 | trees$(O) uncompr$(O) zutil$(O) 37 | 38 | OBJS = rpng2-x$(O) readpng2$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ 39 | pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \ 40 | pngset$(O) pngtrans$(O) $(ZOBJS) 41 | 42 | # implicit make rules ------------------------------------------------------- 43 | 44 | .c$(O): png.h pngconf.h readpng2.h pngusr.h zlib.h 45 | $(CC) -c $(CFLAGS) $< 46 | 47 | # dependencies 48 | 49 | all: rpng2-x$(E) 50 | 51 | rpng2-x$(E): $(OBJS) 52 | $(LD) -o rpng2-x$(E) $(OBJS) $(LIBS) 53 | strip rpng2-x$(E) 54 | 55 | clean: 56 | $(RM) rpng2-x$(O) 57 | $(RM) rpng2-x$(E) 58 | $(RM) $(OBJS) 59 | 60 | # End of makefile for rpng2-x 61 | -------------------------------------------------------------------------------- /libpng/contrib/pngminus/pnm2png.bat: -------------------------------------------------------------------------------- 1 | REM -- grayscale 2 | pnm2png.exe basn0g01.pgm basn0g01.png 3 | pnm2png.exe basn0g02.pgm basn0g02.png 4 | pnm2png.exe basn0g04.pgm basn0g04.png 5 | pnm2png.exe basn0g08.pgm basn0g08.png 6 | pnm2png.exe basn0g16.pgm basn0g16.png 7 | REM -- full-color 8 | pnm2png.exe basn2c08.ppm basn2c08.png 9 | pnm2png.exe basn2c16.ppm basn2c16.png 10 | REM -- palletted 11 | pnm2png.exe basn3p01.ppm basn3p01.png 12 | pnm2png.exe basn3p02.ppm basn3p02.png 13 | pnm2png.exe basn3p04.ppm basn3p04.png 14 | pnm2png.exe basn3p08.ppm basn3p08.png 15 | REM -- gray with alpha-channel 16 | pnm2png.exe -alpha basn6a08.pgm basn4a08.pgm basn4a08.png 17 | pnm2png.exe -alpha basn6a16.pgm basn4a16.pgm basn4a16.png 18 | REM -- color with alpha-channel 19 | pnm2png.exe -alpha basn6a08.pgm basn6a08.ppm basn6a08.png 20 | pnm2png.exe -alpha basn6a16.pgm basn6a16.ppm basn6a16.png 21 | REM -- grayscale 22 | pnm2png.exe rawn0g01.pgm rawn0g01.png 23 | pnm2png.exe rawn0g02.pgm rawn0g02.png 24 | pnm2png.exe rawn0g04.pgm rawn0g04.png 25 | pnm2png.exe rawn0g08.pgm rawn0g08.png 26 | pnm2png.exe rawn0g16.pgm rawn0g16.png 27 | REM -- full-color 28 | pnm2png.exe rawn2c08.ppm rawn2c08.png 29 | pnm2png.exe rawn2c16.ppm rawn2c16.png 30 | REM -- palletted 31 | pnm2png.exe rawn3p01.ppm rawn3p01.png 32 | pnm2png.exe rawn3p02.ppm rawn3p02.png 33 | pnm2png.exe rawn3p04.ppm rawn3p04.png 34 | pnm2png.exe rawn3p08.ppm rawn3p08.png 35 | REM -- gray with alpha-channel 36 | pnm2png.exe -alpha rawn6a08.pgm rawn4a08.pgm rawn4a08.png 37 | pnm2png.exe -alpha rawn6a16.pgm rawn4a16.pgm rawn4a16.png 38 | REM -- color with alpha-channel 39 | pnm2png.exe -alpha rawn6a08.pgm rawn6a08.ppm rawn6a08.png 40 | pnm2png.exe -alpha rawn6a16.pgm rawn6a16.ppm rawn6a16.png 41 | 42 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.acorn: -------------------------------------------------------------------------------- 1 | # Project: libpng 2 | 3 | 4 | # Toolflags: 5 | CCflags = -c -depend !Depend -IC:,Zlib: -g -throwback -DRISCOS -fnah 6 | C++flags = -c -depend !Depend -IC: -throwback 7 | Linkflags = -aif -c++ -o $@ 8 | ObjAsmflags = -throwback -NoCache -depend !Depend 9 | CMHGflags = 10 | LibFileflags = -c -l -o $@ 11 | Squeezeflags = -o $@ 12 | 13 | # Final targets: 14 | @.libpng-lib: @.o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \ 15 | @.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngrtran \ 16 | @.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil 17 | LibFile $(LibFileflags) @.o.png @.o.pngerror @.o.pngrio @.o.pngrtran \ 18 | @.o.pngmem @.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngwio \ 19 | @.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil 20 | @.mm-libpng-lib: @.mm.png @.mm.pngerror @.mm.pngrio @.mm.pngwio @.mm.pngmem \ 21 | @.mm.pngpread @.mm.pngset @.mm.pngget @.mm.pngread @.mm.pngrtran \ 22 | @.mm.pngrutil @.mm.pngtrans @.mm.pngwrite @.mm.pngwtran @.mm.pngwutil 23 | LibFile $(LibFileflags) @.mm.png @.mm.pngerror @.mm.pngrio \ 24 | @.mm.pngwio @.mm.pngmem @.mm.pngpread @.mm.pngset @.mm.pngget \ 25 | @.mm.pngread @.mm.pngrtran @.mm.pngrutil @.mm.pngtrans @.mm.pngwrite \ 26 | @.mm.pngwtran @.mm.pngwutil 27 | 28 | 29 | # User-editable dependencies: 30 | # (C) Copyright 1997 Tom Tanner 31 | Test: @.pngtest 32 | .pngtest 33 | @remove .pngtest 34 | 35 | #It would be nice if you could stop "make" listing from here on! 36 | @.pngtest: @.o.pngtest @.libpng-lib C:o.Stubs Zlib:zlib_lib 37 | Link $(Linkflags) @.o.pngtest @.libpng-lib C:o.Stubs Zlib:zlib_lib 38 | 39 | .SUFFIXES: .o .mm .c 40 | 41 | .c.mm: 42 | MemCheck.CC cc $(ccflags) -o $@ LibPng:$< 43 | .c.o: 44 | cc $(ccflags) -o $@ $< 45 | 46 | 47 | # Static dependencies: 48 | 49 | 50 | # Dynamic dependencies: 51 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /expat/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 | -------------------------------------------------------------------------------- /expat/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 | -------------------------------------------------------------------------------- /expat/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 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.atari: -------------------------------------------------------------------------------- 1 | # makefile for libpng 2 | # Copyright (C) 2002 Glenn Randers-Pehrson 3 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. 4 | # 5 | # This code is released under the libpng license. 6 | # For conditions of distribution and use, see the disclaimer 7 | # and license in png.h 8 | # 9 | # Modified for LC56/ATARI assumes libz.lib is in same dir and uses default 10 | # rules for library management 11 | # 12 | CFLAGS=-I..\zlib -O 13 | LBR = png.lib 14 | LDFLAGS=-lpng -lz -lm 15 | 16 | # where make install puts libpng.a and png.h 17 | prefix=/usr/local 18 | INCPATH=$(prefix)/include 19 | LIBPATH=$(prefix)/lib 20 | 21 | # override DESTDIR= on the make install command line to easily support 22 | # installing into a temporary location. Example: 23 | # 24 | # make install DESTDIR=/tmp/build/libpng 25 | # 26 | # If you're going to install into a temporary location 27 | # via DESTDIR, $(DESTDIR)$(prefix) must already exist before 28 | # you execute make install. 29 | DESTDIR= 30 | 31 | OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\ 32 | $(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\ 33 | $(LBR)(pngread.o) $(LBR)(pngerror.o) $(LBR)(pngwrite.o)\ 34 | $(LBR)(pngrtran.o) $(LBR)(pngwtran.o)\ 35 | $(LBR)(pngmem.o) $(LBR)(pngrio.o) $(LBR)(pngwio.o) $(LBR)(pngpread.o) 36 | 37 | all: $(LBR) pngtest.ttp 38 | 39 | $(LBR): $(OBJS) 40 | 41 | pngtest.ttp: pngtest.o $(LBR) 42 | $(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o 43 | 44 | install: libpng.a 45 | -@mkdir $(DESTDIR)$(INCPATH) 46 | -@mkdir $(DESTDIR)$(INCPATH)/libpng 47 | -@mkdir $(DESTDIR)$(LIBPATH) 48 | -@rm -f $(DESTDIR)$(INCPATH)/png.h 49 | -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h 50 | cp png.h $(DESTDIR)$(INCPATH)/libpng 51 | cp pngconf.h $(DESTDIR)$(INCPATH)/libpng 52 | chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h 53 | chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h 54 | (cd $(DESTDIR)$(INCPATH); ln -f -s $(LIBNAME) libpng; \ 55 | ln -f -s $(LIBNAME)/* .) 56 | -------------------------------------------------------------------------------- /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 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /* 34 | * Trivial typedef to ensure that ZipFileCRO is not treated as a simple integer. 35 | */ 36 | typedef void* ZipFileCRO; 37 | 38 | /* 39 | * Trivial typedef to ensure that ZipEntryCRO is not treated as a simple 40 | * integer. We use NULL to indicate an invalid value. 41 | */ 42 | typedef void* ZipEntryCRO; 43 | 44 | extern ZipFileCRO ZipFileXRO_open(const char* path); 45 | 46 | extern void ZipFileCRO_destroy(ZipFileCRO zip); 47 | 48 | extern ZipEntryCRO ZipFileCRO_findEntryByName(ZipFileCRO zip, 49 | const char* fileName); 50 | 51 | extern bool ZipFileCRO_getEntryInfo(ZipFileCRO zip, ZipEntryCRO entry, 52 | int* pMethod, size_t* pUncompLen, 53 | size_t* pCompLen, off64_t* pOffset, long* pModWhen, long* pCrc32); 54 | 55 | extern bool ZipFileCRO_uncompressEntry(ZipFileCRO zip, ZipEntryCRO entry, int fd); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /*__LIBS_ZIPFILECRO_H*/ 62 | -------------------------------------------------------------------------------- /libpng/projects/visualc71/README_zlib.txt: -------------------------------------------------------------------------------- 1 | /* WARNING: This file was put in the LibPNG distribution for convenience only. 2 | It is expected to be part of the next zlib release under 3 | "projects\visualc71\README.txt." */ 4 | 5 | Microsoft Developer Studio Project File, Format Version 7.10 for zlib. 6 | 7 | Copyright (C) 2004 Simon-Pierre Cadieux. 8 | Copyright (C) 2004 Cosmin Truta. 9 | For conditions of distribution and use, see copyright notice in zlib.h. 10 | 11 | 12 | To use: 13 | 14 | 1) On the main menu, select "File | Open Solution". 15 | Open "zlib.sln". 16 | 17 | 2) Display the Solution Explorer view (Ctrl+Alt+L) 18 | 19 | 3) Set one of the project as the StartUp project. If you just want to build the 20 | binaries set "zlib" as the startup project (Select "zlib" tree view item + 21 | Project | Set as StartUp project). If you want to build and test the 22 | binaries set it to "example" (Select "example" tree view item + Project | 23 | Set as StartUp project), If you want to build the minigzip utility set it to 24 | "minigzip" (Select "minigzip" tree view item + Project | Set as StartUp 25 | project 26 | 27 | 4) Select "Build | Configuration Manager...". 28 | Choose the configuration you wish to build. 29 | 30 | 5) Select "Build | Clean Solution". 31 | 32 | 6) Select "Build | Build Solution (Ctrl-Shift-B)" 33 | 34 | This project builds the zlib binaries as follows: 35 | 36 | * Win32_DLL_Release\zlib1.dll DLL build 37 | * Win32_DLL_Debug\zlib1d.dll DLL build (debug version) 38 | * Win32_DLL_ASM_Release\zlib1.dll DLL build using ASM code 39 | * Win32_DLL_ASM_Debug\zlib1d.dll DLL build using ASM code (debug version) 40 | * Win32_LIB_Release\zlib.lib static build 41 | * Win32_LIB_Debug\zlibd.lib static build (debug version) 42 | * Win32_LIB_ASM_Release\zlib.lib static build using ASM code 43 | * Win32_LIB_ASM_Debug\zlibd.lib static build using ASM code (debug version) 44 | 45 | -------------------------------------------------------------------------------- /expat/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 | -------------------------------------------------------------------------------- /utils-cpp/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, off64_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 | -------------------------------------------------------------------------------- /utils-cpp/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.ibmc: -------------------------------------------------------------------------------- 1 | # Makefile for libpng (static) 2 | # IBM C version 3.x for Win32 and OS/2 3 | # Copyright (C) 2006 Glenn Randers-Pehrson 4 | # Copyright (C) 2000 Cosmin Truta 5 | # 6 | # This code is released under the libpng license. 7 | # For conditions of distribution and use, see the disclaimer 8 | # and license in png.h 9 | # 10 | # Notes: 11 | # Derived from makefile.std 12 | # All modules are compiled in C mode 13 | # Tested under Win32, expected to work under OS/2 14 | # Can be easily adapted for IBM VisualAge/C++ for AIX 15 | 16 | # Location of the zlib library and include files 17 | ZLIBINC = ../zlib 18 | ZLIBLIB = ../zlib 19 | 20 | # Compiler, linker, lib and other tools 21 | CC = icc 22 | LD = ilink 23 | AR = ilib 24 | RM = del 25 | 26 | CFLAGS = -I$(ZLIBINC) -Mc -O2 -W3 27 | LDFLAGS = 28 | 29 | # File extensions 30 | O=.obj 31 | A=.lib 32 | E=.exe 33 | 34 | # Variables 35 | OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \ 36 | pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \ 37 | pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) 38 | 39 | LIBS = libpng$(A) $(ZLIBLIB)/zlib$(A) 40 | 41 | # Targets 42 | all: libpng$(A) pngtest$(E) 43 | 44 | libpng$(A): $(OBJS) 45 | $(AR) -out:$@ $(OBJS) 46 | 47 | test: pngtest$(E) 48 | pngtest$(E) 49 | 50 | pngtest: pngtest$(E) 51 | 52 | pngtest$(E): pngtest$(O) libpng$(A) 53 | $(LD) $(LDFLAGS) pngtest$(O) $(LIBS) 54 | 55 | clean: 56 | $(RM) *$(O) 57 | $(RM) libpng$(A) 58 | $(RM) pngtest$(E) 59 | $(RM) pngout.png 60 | 61 | png$(O): png.h pngconf.h 62 | pngerror$(O): png.h pngconf.h 63 | pngget$(O): png.h pngconf.h 64 | pngmem$(O): png.h pngconf.h 65 | pngpread$(O): png.h pngconf.h 66 | pngread$(O): png.h pngconf.h 67 | pngrio$(O): png.h pngconf.h 68 | pngrtran$(O): png.h pngconf.h 69 | pngrutil$(O): png.h pngconf.h 70 | pngset$(O): png.h pngconf.h 71 | pngtrans$(O): png.h pngconf.h 72 | pngwio$(O): png.h pngconf.h 73 | pngwrite$(O): png.h pngconf.h 74 | pngwtran$(O): png.h pngconf.h 75 | pngwutil$(O): png.h pngconf.h 76 | 77 | pngtest$(O): png.h pngconf.h 78 | -------------------------------------------------------------------------------- /libpng/contrib/pngminus/png2pnm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # -- grayscale 3 | ./png2pnm -noraw ../pngsuite/basn0g01.png basn0g01.pgm 4 | ./png2pnm -noraw ../pngsuite/basn0g02.png basn0g02.pgm 5 | ./png2pnm -noraw ../pngsuite/basn0g04.png basn0g04.pgm 6 | ./png2pnm -noraw ../pngsuite/basn0g08.png basn0g08.pgm 7 | ./png2pnm -noraw ../pngsuite/basn0g16.png basn0g16.pgm 8 | # -- full-color 9 | ./png2pnm -noraw ../pngsuite/basn2c08.png basn2c08.ppm 10 | ./png2pnm -noraw ../pngsuite/basn2c16.png basn2c16.ppm 11 | # -- palletted 12 | ./png2pnm -noraw ../pngsuite/basn3p01.png basn3p01.ppm 13 | ./png2pnm -noraw ../pngsuite/basn3p02.png basn3p02.ppm 14 | ./png2pnm -noraw ../pngsuite/basn3p04.png basn3p04.ppm 15 | ./png2pnm -noraw ../pngsuite/basn3p08.png basn3p08.ppm 16 | # -- gray with alpha-channel 17 | ./png2pnm -noraw ../pngsuite/basn4a08.png basn4a08.pgm 18 | ./png2pnm -noraw ../pngsuite/basn4a16.png basn4a16.pgm 19 | # -- color with alpha-channel 20 | ./png2pnm -noraw -alpha basn6a08.pgm ../pngsuite/basn6a08.png basn6a08.ppm 21 | ./png2pnm -noraw -alpha basn6a16.pgm ../pngsuite/basn6a16.png basn6a16.ppm 22 | # -- grayscale 23 | ./png2pnm -raw ../pngsuite/basn0g01.png rawn0g01.pgm 24 | ./png2pnm -raw ../pngsuite/basn0g02.png rawn0g02.pgm 25 | ./png2pnm -raw ../pngsuite/basn0g04.png rawn0g04.pgm 26 | ./png2pnm -raw ../pngsuite/basn0g08.png rawn0g08.pgm 27 | ./png2pnm -raw ../pngsuite/basn0g16.png rawn0g16.pgm 28 | # -- full-color 29 | ./png2pnm -raw ../pngsuite/basn2c08.png rawn2c08.ppm 30 | ./png2pnm -raw ../pngsuite/basn2c16.png rawn2c16.ppm 31 | # -- palletted 32 | ./png2pnm -raw ../pngsuite/basn3p01.png rawn3p01.ppm 33 | ./png2pnm -raw ../pngsuite/basn3p02.png rawn3p02.ppm 34 | ./png2pnm -raw ../pngsuite/basn3p04.png rawn3p04.ppm 35 | ./png2pnm -raw ../pngsuite/basn3p08.png rawn3p08.ppm 36 | # -- gray with alpha-channel 37 | ./png2pnm -raw ../pngsuite/basn4a08.png rawn4a08.pgm 38 | ./png2pnm -raw ../pngsuite/basn4a16.png rawn4a16.pgm 39 | # -- color with alpha-channel 40 | ./png2pnm -noraw -alpha rawn6a08.pgm ../pngsuite/basn6a08.png rawn6a08.ppm 41 | ./png2pnm -noraw -alpha rawn6a16.pgm ../pngsuite/basn6a16.png rawn6a16.ppm 42 | 43 | -------------------------------------------------------------------------------- /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 "fakeLog.h" /*#include */ 10 | #include 11 | #include 12 | #include 13 | #include "Bundle.h" 14 | #include "AaptAssets.h" 15 | #include "ZipFile.h" 16 | 17 | #include "preDef.h" 18 | 19 | /* Benchmarking Flag */ 20 | //#define BENCHMARK 1 21 | 22 | #if BENCHMARK 23 | #include 24 | #endif /* BENCHMARK */ 25 | 26 | extern int doVersion(Bundle* bundle); 27 | extern int doList(Bundle* bundle); 28 | extern int doDump(Bundle* bundle); 29 | extern int doAdd(Bundle* bundle); 30 | extern int doRemove(Bundle* bundle); 31 | extern int doPackage(Bundle* bundle); 32 | extern int doCrunch(Bundle* bundle); 33 | 34 | extern int calcPercent(long uncompressedLen, long compressedLen); 35 | 36 | extern android::status_t writeAPK(Bundle* bundle, 37 | const sp& assets, 38 | const android::String8& outputFile); 39 | 40 | extern android::status_t updatePreProcessedCache(Bundle* bundle); 41 | 42 | extern android::status_t buildResources(Bundle* bundle, 43 | const sp& assets); 44 | 45 | extern android::status_t writeResourceSymbols(Bundle* bundle, 46 | const sp& assets, const String8& pkgName, bool includePrivate); 47 | 48 | extern android::status_t writeProguardFile(Bundle* bundle, const sp& assets); 49 | 50 | extern bool isValidResourceType(const String8& type); 51 | 52 | ssize_t processAssets(Bundle* bundle, ZipFile* zip, const sp& assets); 53 | 54 | extern status_t filterResources(Bundle* bundle, const sp& assets); 55 | 56 | int dumpResources(Bundle* bundle); 57 | 58 | String8 getAttribute(const ResXMLTree& tree, const char* ns, 59 | const char* attr, String8* outError); 60 | 61 | status_t writeDependencyPreReqs(Bundle* bundle, const sp& assets, 62 | FILE* fp, bool includeRaw); 63 | #endif // __MAIN_H 64 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/preader/pngusr.h: -------------------------------------------------------------------------------- 1 | /* minrdpngconf.h: headers to make a minimal png-read-only library 2 | * 3 | * Copyright (c) 2009 Glenn Randers-Pehrson 4 | * 5 | * This code is released under the libpng license. 6 | * For conditions of distribution and use, see the disclaimer 7 | * and license in png.h 8 | * 9 | * Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson 10 | */ 11 | 12 | #ifndef MINPRDPNGCONF_H 13 | #define MINPRDPNGCONF_H 14 | 15 | #define PNG_NO_GLOBAL_ARRAYS 16 | 17 | #define PNG_NO_WARNINGS 18 | #define png_warning(s1,s2) "" 19 | #define png_chunk_warning(s1,s2) "" 20 | #define PNG_NO_ERROR_TEXT 21 | #define png_error(s1,s2) png_err(s1) 22 | #define png_chunk_error(s1,s2) png_err(s1) 23 | 24 | #define PNG_NO_ASSEMBLER_CODE 25 | #define PNG_NO_OPTIMIZED_CODE 26 | #define PNG_NO_READ_DITHER 27 | #define PNG_NO_READ_INVERT 28 | #define PNG_NO_READ_SHIFT 29 | #define PNG_NO_READ_PACK 30 | #define PNG_NO_READ_PACKSWAP 31 | #define PNG_NO_READ_FILLER 32 | #define PNG_NO_READ_SWAP 33 | #define PNG_NO_READ_SWAP_ALPHA 34 | #define PNG_NO_READ_INVERT_ALPHA 35 | #define PNG_NO_READ_RGB_TO_GRAY 36 | #define PNG_NO_READ_USER_TRANSFORM 37 | #define PNG_NO_READ_cHRM 38 | #define PNG_NO_READ_hIST 39 | #define PNG_NO_READ_iCCP 40 | #define PNG_NO_READ_pCAL 41 | #define PNG_NO_READ_pHYs 42 | #define PNG_NO_READ_sBIT 43 | #define PNG_NO_READ_sCAL 44 | #define PNG_NO_READ_sPLT 45 | #define PNG_NO_READ_TEXT 46 | #define PNG_NO_READ_tIME 47 | #define PNG_NO_READ_UNKNOWN_CHUNKS 48 | #define PNG_NO_READ_USER_CHUNKS 49 | #define PNG_NO_READ_EMPTY_PLTE 50 | #define PNG_NO_READ_OPT_PLTE 51 | #define PNG_NO_READ_STRIP_ALPHA 52 | #define PNG_NO_READ_oFFs 53 | #define PNG_NO_WARN_UNINITIALIZED_ROW 54 | 55 | #define PNG_NO_WRITE_SUPPORTED 56 | 57 | #define PNG_NO_INFO_IMAGE 58 | #define PNG_NO_USER_MEM 59 | #define PNG_NO_FIXED_POINT_SUPPORTED 60 | #define PNG_NO_MNG_FEATURES 61 | #define PNG_NO_USER_TRANSFORM_PTR 62 | #define PNG_NO_HANDLE_AS_UNKNOWN 63 | #define PNG_NO_CONSOLE_IO 64 | #define PNG_NO_ZALLOC_ZERO 65 | #define PNG_NO_ERROR_NUMBERS 66 | #define PNG_NO_EASY_ACCESS 67 | 68 | #endif /* MINPRDPNGCONF_H */ 69 | -------------------------------------------------------------------------------- /libpng/scripts/libpng-config-body.in: -------------------------------------------------------------------------------- 1 | 2 | usage() 3 | { 4 | cat <location !PNG_AFTER_IDAT when writing unknown chunks 51 | before IDAT. 52 | Ported bugfix in pngrtran.c from 1.5.3: when expanding a paletted image, 53 | always expand to RGBA if transparency is present. 54 | Check for integer overflow in png_set_rgb_to_gray(). 55 | Check for sCAL chunk too short. 56 | Added CMakeLists.txt, projects/xcode, and pnggccrd.c to EXTRA_DIST in 57 | Makefile.am and Makefile.in 58 | Udated copyright year to 2011. 59 | 60 | Send comments/corrections/commendations to png-mng-implement at lists.sf.net 61 | (subscription required; visit 62 | https://lists.sourceforge.net/lists/listinfo/png-mng-implement 63 | to subscribe) or to glennrp at users.sourceforge.net 64 | 65 | Glenn R-P 66 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /utils/LinearTransform.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 _LIBS_UTILS_LINEAR_TRANSFORM_H 18 | #define _LIBS_UTILS_LINEAR_TRANSFORM_H 19 | 20 | #include 21 | 22 | namespace android { 23 | 24 | // LinearTransform defines a structure which hold the definition of a 25 | // transformation from single dimensional coordinate system A into coordinate 26 | // system B (and back again). Values in A and in B are 64 bit, the linear 27 | // scale factor is expressed as a rational number using two 32 bit values. 28 | // 29 | // Specifically, let 30 | // f(a) = b 31 | // F(b) = f^-1(b) = a 32 | // then 33 | // 34 | // f(a) = (((a - a_zero) * a_to_b_numer) / a_to_b_denom) + b_zero; 35 | // 36 | // and 37 | // 38 | // F(b) = (((b - b_zero) * a_to_b_denom) / a_to_b_numer) + a_zero; 39 | // 40 | struct LinearTransform { 41 | int64_t a_zero; 42 | int64_t b_zero; 43 | int32_t a_to_b_numer; 44 | uint32_t a_to_b_denom; 45 | 46 | // Transform from A->B 47 | // Returns true on success, or false in the case of a singularity or an 48 | // overflow. 49 | bool doForwardTransform(int64_t a_in, int64_t* b_out) const; 50 | 51 | // Transform from B->A 52 | // Returns true on success, or false in the case of a singularity or an 53 | // overflow. 54 | bool doReverseTransform(int64_t b_in, int64_t* a_out) const; 55 | 56 | // Helpers which will reduce the fraction N/D using Euclid's method. 57 | template static void reduce(T* N, T* D); 58 | static void reduce(int32_t* N, uint32_t* D); 59 | }; 60 | 61 | 62 | } 63 | 64 | #endif // _LIBS_UTILS_LINEAR_TRANSFORM_H 65 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (z_const Bytef *)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /cutils-c/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 | -------------------------------------------------------------------------------- /zlib/INDEX: -------------------------------------------------------------------------------- 1 | CMakeLists.txt cmake build file 2 | ChangeLog history of changes 3 | FAQ Frequently Asked Questions about zlib 4 | INDEX this file 5 | Makefile dummy Makefile that tells you to ./configure 6 | Makefile.in template for Unix Makefile 7 | README guess what 8 | configure configure script for Unix 9 | make_vms.com makefile for VMS 10 | test/example.c zlib usages examples for build testing 11 | test/minigzip.c minimal gzip-like functionality for build testing 12 | test/infcover.c inf*.c code coverage for build coverage testing 13 | treebuild.xml XML description of source file dependencies 14 | zconf.h.cmakein zconf.h template for cmake 15 | zconf.h.in zconf.h template for configure 16 | zlib.3 Man page for zlib 17 | zlib.3.pdf Man page in PDF format 18 | zlib.map Linux symbol information 19 | zlib.pc.in Template for pkg-config descriptor 20 | zlib.pc.cmakein zlib.pc template for cmake 21 | zlib2ansi perl script to convert source files for C++ compilation 22 | 23 | amiga/ makefiles for Amiga SAS C 24 | as400/ makefiles for AS/400 25 | doc/ documentation for formats and algorithms 26 | msdos/ makefiles for MSDOS 27 | nintendods/ makefile for Nintendo DS 28 | old/ makefiles for various architectures and zlib documentation 29 | files that have not yet been updated for zlib 1.2.x 30 | qnx/ makefiles for QNX 31 | watcom/ makefiles for OpenWatcom 32 | win32/ makefiles for Windows 33 | 34 | zlib public header files (required for library use): 35 | zconf.h 36 | zlib.h 37 | 38 | private source files used to build the zlib library: 39 | adler32.c 40 | compress.c 41 | crc32.c 42 | crc32.h 43 | deflate.c 44 | deflate.h 45 | gzclose.c 46 | gzguts.h 47 | gzlib.c 48 | gzread.c 49 | gzwrite.c 50 | infback.c 51 | inffast.c 52 | inffast.h 53 | inffixed.h 54 | inflate.c 55 | inflate.h 56 | inftrees.c 57 | inftrees.h 58 | trees.c 59 | trees.h 60 | uncompr.c 61 | zutil.c 62 | zutil.h 63 | 64 | source files for sample programs 65 | See examples/README.examples 66 | 67 | unsupported contributions by third parties 68 | See contrib/README.contrib 69 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.os2: -------------------------------------------------------------------------------- 1 | # makefile for libpng on OS/2 with gcc 2 | # 3 | # This code is released under the libpng license. 4 | # For conditions of distribution and use, see the disclaimer 5 | # and license in png.h 6 | 7 | # Related files: pngos2.def 8 | 9 | CC=gcc -Zomf -s 10 | 11 | # Where the zlib library and include files are located 12 | ZLIBLIB=../zlib 13 | ZLIBINC=../zlib 14 | 15 | WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ 16 | -Wmissing-declarations -Wtraditional -Wcast-align \ 17 | -Wstrict-prototypes -Wmissing-prototypes #-Wconversion 18 | CFLAGS=-I$(ZLIBINC) -W -Wall -O6 -funroll-loops -malign-loops=2 \ 19 | -malign-functions=2 #$(WARNMORE) -g -DPNG_DEBUG=5 20 | LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lzdll -Zcrtdll 21 | AR=emxomfar 22 | 23 | PNGLIB=png.lib 24 | IMPLIB=emximp 25 | SHAREDLIB=png.dll 26 | SHAREDLIBIMP=pngdll.lib 27 | 28 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ 29 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ 30 | pngwtran.o pngmem.o pngerror.o pngpread.o 31 | 32 | .SUFFIXES: .c .o 33 | 34 | all: $(PNGLIB) $(SHAREDLIB) $(SHAREDLIBIMP) 35 | 36 | $(PNGLIB): $(OBJS) 37 | $(AR) rc $@ $(OBJS) 38 | 39 | $(SHAREDLIB): $(OBJS) pngos2.def 40 | $(CC) $(LDFLAGS) -Zdll -o $@ $^ 41 | 42 | $(SHAREDLIBIMP): pngos2.def 43 | $(IMPLIB) -o $@ $^ 44 | 45 | pngtest.exe: pngtest.o png.dll pngdll.lib 46 | $(CC) -o $@ $(CFLAGS) $< $(LDFLAGS) 47 | 48 | test: pngtest.exe 49 | ./pngtest.exe 50 | 51 | clean: 52 | rm -f *.o $(PNGLIB) png.dll pngdll.lib pngtest.exe pngout.png 53 | 54 | # DO NOT DELETE THIS LINE -- make depend depends on it. 55 | 56 | png.o png.pic.o: png.h pngconf.h 57 | pngerror.o pngerror.pic.o: png.h pngconf.h 58 | pngrio.o pngrio.pic.o: png.h pngconf.h 59 | pngwio.o pngwio.pic.o: png.h pngconf.h 60 | pngmem.o pngmem.pic.o: png.h pngconf.h 61 | pngset.o pngset.pic.o: png.h pngconf.h 62 | pngget.o pngget.pic.o: png.h pngconf.h 63 | pngread.o pngread.pic.o: png.h pngconf.h 64 | pngrtran.o pngrtran.pic.o: png.h pngconf.h 65 | pngrutil.o pngrutil.pic.o: png.h pngconf.h 66 | pngtrans.o pngtrans.pic.o: png.h pngconf.h 67 | pngwrite.o pngwrite.pic.o: png.h pngconf.h 68 | pngwtran.o pngwtran.pic.o: png.h pngconf.h 69 | pngwutil.o pngwutil.pic.o: png.h pngconf.h 70 | pngpread.o pngpread.pic.o: png.h pngconf.h 71 | 72 | pngtest.o: png.h pngconf.h 73 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.gcc: -------------------------------------------------------------------------------- 1 | # makefile for libpng using gcc (generic, static library) 2 | # Copyright (C) 2008 Glenn Randers-Pehrson 3 | # Copyright (C) 2000 Cosmin Truta 4 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. 5 | # 6 | # This code is released under the libpng license. 7 | # For conditions of distribution and use, see the disclaimer 8 | # and license in png.h 9 | 10 | # Location of the zlib library and include files 11 | ZLIBINC = ../zlib 12 | ZLIBLIB = ../zlib 13 | 14 | # Compiler, linker, lib and other tools 15 | CC = gcc 16 | LD = $(CC) 17 | AR_RC = ar rcs 18 | RANLIB = ranlib 19 | RM_F = rm -f 20 | 21 | CDEBUG = -g -DPNG_DEBUG=5 22 | LDDEBUG = 23 | CRELEASE = -O2 24 | LDRELEASE = -s 25 | #CFLAGS = -W -Wall $(CDEBUG) 26 | CFLAGS = -W -Wall $(CRELEASE) 27 | #LDFLAGS = $(LDDEBUG) 28 | LDFLAGS = $(LDRELEASE) 29 | LIBS = -lz -lm 30 | 31 | # File extensions 32 | O=.o 33 | A=.a 34 | EXE= 35 | 36 | # Variables 37 | OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \ 38 | pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \ 39 | pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) 40 | 41 | # Targets 42 | all: static 43 | 44 | .c$(O): 45 | $(CC) -c $(CFLAGS) -I$(ZLIBINC) $< 46 | 47 | static: libpng$(A) pngtest$(EXE) 48 | 49 | shared: 50 | @echo This is a generic makefile that cannot create shared libraries. 51 | @echo Please use a configuration that is specific to your platform. 52 | @false 53 | 54 | libpng$(A): $(OBJS) 55 | $(AR_RC) $@ $(OBJS) 56 | $(RANLIB) $@ 57 | 58 | test: pngtest$(EXE) 59 | ./pngtest$(EXE) 60 | 61 | pngtest$(EXE): pngtest$(O) libpng$(A) 62 | $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest$(O) libpng$(A) $(LIBS) 63 | 64 | clean: 65 | $(RM_F) *$(O) libpng$(A) pngtest$(EXE) pngout.png 66 | 67 | png$(O): png.h pngconf.h 68 | pngerror$(O): png.h pngconf.h 69 | pngget$(O): png.h pngconf.h 70 | pngmem$(O): png.h pngconf.h 71 | pngpread$(O): png.h pngconf.h 72 | pngread$(O): png.h pngconf.h 73 | pngrio$(O): png.h pngconf.h 74 | pngrtran$(O): png.h pngconf.h 75 | pngrutil$(O): png.h pngconf.h 76 | pngset$(O): png.h pngconf.h 77 | pngtrans$(O): png.h pngconf.h 78 | pngwio$(O): png.h pngconf.h 79 | pngwrite$(O): png.h pngconf.h 80 | pngwtran$(O): png.h pngconf.h 81 | pngwutil$(O): png.h pngconf.h 82 | 83 | pngtest$(O): png.h pngconf.h 84 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/encoder/pngusr.h: -------------------------------------------------------------------------------- 1 | /* minwrpngconf.h: headers to make a minimal png-write-only library 2 | * 3 | * Copyright (c) 2007, 2009 Glenn Randers-Pehrson 4 | * 5 | * This code is released under the libpng license. 6 | * For conditions of distribution and use, see the disclaimer 7 | * and license in png.h 8 | * 9 | * Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson 10 | */ 11 | 12 | #ifndef MINWRPNGCONF_H 13 | #define MINWRPNGCONF_H 14 | 15 | #define PNG_NO_GLOBAL_ARRAYS 16 | 17 | #define PNG_NO_READ_SUPPORTED 18 | 19 | #define PNG_NO_WARNINGS 20 | #define png_warning(s1,s2) "" 21 | #define png_chunk_warning(s1,s2) "" 22 | #define PNG_NO_ERROR_TEXT 23 | #define png_error(s1,s2) png_err(s1) 24 | #define png_chunk_error(s1,s2) png_err(s1) 25 | 26 | #define PNG_NO_WRITE_BACKGROUND 27 | #define PNG_NO_WRITE_GAMMA 28 | #define PNG_NO_WRITE_DITHER 29 | #define PNG_NO_WRITE_INVERT 30 | #define PNG_NO_WRITE_SHIFT 31 | #define PNG_NO_WRITE_PACK 32 | #define PNG_NO_WRITE_PACKSWAP 33 | #define PNG_NO_WRITE_FILLER 34 | #define PNG_NO_WRITE_SWAP 35 | #define PNG_NO_WRITE_SWAP_ALPHA 36 | #define PNG_NO_WRITE_INVERT_ALPHA 37 | #define PNG_NO_WRITE_RGB_TO_GRAY 38 | #define PNG_NO_WRITE_USER_TRANSFORM 39 | #define PNG_NO_WRITE_bKGD 40 | #define PNG_NO_WRITE_cHRM 41 | #define PNG_NO_WRITE_gAMA 42 | #define PNG_NO_WRITE_hIST 43 | #define PNG_NO_WRITE_iCCP 44 | #define PNG_NO_WRITE_oFFs 45 | #define PNG_NO_WRITE_pCAL 46 | #define PNG_NO_WRITE_pHYs 47 | #define PNG_NO_WRITE_sBIT 48 | #define PNG_NO_WRITE_sCAL 49 | #define PNG_NO_WRITE_sPLT 50 | #define PNG_NO_WRITE_sRGB 51 | #define PNG_NO_WRITE_TEXT 52 | #define PNG_NO_WRITE_tIME 53 | #define PNG_NO_WRITE_UNKNOWN_CHUNKS 54 | #define PNG_NO_WRITE_USER_CHUNKS 55 | #define PNG_NO_WRITE_EMPTY_PLTE 56 | #define PNG_NO_WRITE_OPT_PLTE 57 | #define PNG_NO_WRITE_FILTER 58 | #define PNG_NO_WRITE_WEIGHTED_FILTER 59 | #define PNG_NO_WRITE_INTERLACING_SUPPORTED 60 | #define PNG_NO_WRITE_FLUSH 61 | 62 | #define PNG_NO_INFO_IMAGE 63 | #define PNG_NO_USER_MEM 64 | #define PNG_NO_FIXED_POINT_SUPPORTED 65 | #define PNG_NO_MNG_FEATURES 66 | #define PNG_NO_USER_TRANSFORM_PTR 67 | #define PNG_NO_HANDLE_AS_UNKNOWN 68 | #define PNG_NO_CONSOLE_IO 69 | #define PNG_NO_ZALLOC_ZERO 70 | #define PNG_NO_ERROR_NUMBERS 71 | #define PNG_NO_EASY_ACCESS 72 | 73 | #endif /* MINWRPNGCONF_H */ 74 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /expat/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 | -------------------------------------------------------------------------------- /libpng/contrib/visupng/README.txt: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Build File, Format Version 6.00 for VisualPng 2 | ------------------------------------------------------------------------ 3 | 4 | Copyright 2000, Willem van Schaik. 5 | 6 | This code is released under the libpng license. 7 | For conditions of distribution and use, see the disclaimer 8 | and license in png.h 9 | 10 | As a PNG .dll demo VisualPng is finished. More features would only hinder 11 | the program's objective. However, further extensions (like support for other 12 | graphics formats) are in development. To get these, or for pre-compiled 13 | binaries, go to "http://www.schaik.com/png/visualpng.html". 14 | 15 | ------------------------------------------------------------------------ 16 | 17 | Assumes that 18 | 19 | libpng DLLs and LIBs are in ..\..\projects\msvc\win32\libpng 20 | zlib DLLs and LIBs are in ..\..\projects\msvc\win32\zlib 21 | libpng header files are in ..\..\..\libpng 22 | zlib header files are in ..\..\..\zlib 23 | the pngsuite images are in ..\pngsuite 24 | 25 | To build: 26 | 27 | 1) On the main menu Select "Build|Set Active configuration". 28 | Choose the configuration that corresponds to the library you want to test. 29 | This library must have been built using the libpng MS project located in 30 | the "..\..\mscv" subdirectory. 31 | 32 | 2) Select "Build|Clean" 33 | 34 | 3) Select "Build|Rebuild All" 35 | 36 | 4) After compiling and linking VisualPng will be started to view an image 37 | from the PngSuite directory. Press Ctrl-N (and Ctrl-V) for other images. 38 | 39 | 40 | To install: 41 | 42 | When distributing VisualPng (or a further development) the following options 43 | are available: 44 | 45 | 1) Build the program with the configuration "Win32 LIB" and you only need to 46 | include the executable from the ./lib directory in your distribution. 47 | 48 | 2) Build the program with the configuration "Win32 DLL" and you need to put 49 | in your distribution the executable from the ./dll directory and the dll's 50 | libpng1.dll, zlib.dll and msvcrt.dll. These need to be in the user's PATH. 51 | 52 | 53 | Willem van Schaik 54 | Calgary, June 6th 2000 55 | 56 | P.S. VisualPng was written based on preliminary work of: 57 | 58 | - Simon-Pierre Cadieux 59 | - Glenn Randers-Pehrson 60 | - Greg Roelofs 61 | 62 | -------------------------------------------------------------------------------- /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 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* 25 | * Inline declarations and macros for some special-purpose atomic 26 | * operations. These are intended for rare circumstances where a 27 | * memory barrier needs to be issued inline rather than as a function 28 | * call. 29 | * 30 | * Most code should not use these. 31 | * 32 | * Anything that does include this file must set ANDROID_SMP to either 33 | * 0 or 1, indicating compilation for UP or SMP, respectively. 34 | * 35 | * Macros defined in this header: 36 | * 37 | * void ANDROID_MEMBAR_FULL(void) 38 | * Full memory barrier. Provides a compiler reordering barrier, and 39 | * on SMP systems emits an appropriate instruction. 40 | */ 41 | 42 | #if !defined(ANDROID_SMP) 43 | # error "Must define ANDROID_SMP before including atomic-inline.h" 44 | #endif 45 | 46 | #if defined(__arm__) 47 | #include 48 | #elif defined(__i386__) || defined(__x86_64__) 49 | #include 50 | #elif defined(__sh__) 51 | /* implementation is in atomic-android-sh.c */ 52 | #else 53 | #error atomic operations are unsupported 54 | #endif 55 | 56 | #if ANDROID_SMP == 0 57 | #define ANDROID_MEMBAR_FULL android_compiler_barrier 58 | #else 59 | #define ANDROID_MEMBAR_FULL android_memory_barrier 60 | #endif 61 | 62 | #if ANDROID_SMP == 0 63 | #define ANDROID_MEMBAR_STORE android_compiler_barrier 64 | #else 65 | #define ANDROID_MEMBAR_STORE android_memory_store_barrier 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* ANDROID_CUTILS_ATOMIC_INLINE_H */ 73 | -------------------------------------------------------------------------------- /expat/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 | -------------------------------------------------------------------------------- /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=1, 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libpng/contrib/pngminim/decoder/pngusr.h: -------------------------------------------------------------------------------- 1 | /* minrdpngconf.h: headers to make a minimal png-read-only library 2 | * 3 | * Copyright (c) 2007, 2009 Glenn Randers-Pehrson 4 | * 5 | * This code is released under the libpng license. 6 | * For conditions of distribution and use, see the disclaimer 7 | * and license in png.h 8 | * 9 | * Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson 10 | */ 11 | 12 | #ifndef MINRDPNGCONF_H 13 | #define MINRDPNGCONF_H 14 | 15 | #ifdef NJET 16 | /* No 16-bit support beyond reading with strip_16 */ 17 | #endif 18 | 19 | #define PNG_NO_GLOBAL_ARRAYS 20 | 21 | #define PNG_NO_WARNINGS 22 | #define png_warning(s1,s2) "" 23 | #define png_chunk_warning(s1,s2) "" 24 | #define PNG_NO_ERROR_TEXT 25 | #define png_error(s1,s2) png_err(s1) 26 | #define png_chunk_error(s1,s2) png_err(s1) 27 | 28 | #define PNG_NO_ASSEMBLER_CODE 29 | #define PNG_NO_OPTIMIZED_CODE 30 | #define PNG_NO_READ_GAMMA 31 | #define PNG_NO_READ_BACKGROUND 32 | #define PNG_NO_READ_DITHER 33 | #define PNG_NO_READ_INVERT 34 | #define PNG_NO_READ_SHIFT 35 | #define PNG_NO_READ_PACK 36 | #define PNG_NO_READ_PACKSWAP 37 | #define PNG_NO_READ_FILLER 38 | #define PNG_NO_READ_SWAP 39 | #define PNG_NO_READ_SWAP_ALPHA 40 | #define PNG_NO_READ_INVERT_ALPHA 41 | #define PNG_NO_READ_RGB_TO_GRAY 42 | #define PNG_NO_READ_USER_TRANSFORM 43 | #define PNG_NO_READ_bKGD 44 | #define PNG_NO_READ_cHRM 45 | #define PNG_NO_READ_gAMA 46 | #define PNG_NO_READ_hIST 47 | #define PNG_NO_READ_iCCP 48 | #define PNG_NO_READ_pCAL 49 | #define PNG_NO_READ_pHYs 50 | #define PNG_NO_READ_sBIT 51 | #define PNG_NO_READ_sCAL 52 | #define PNG_NO_READ_sPLT 53 | #define PNG_NO_READ_sRGB 54 | #define PNG_NO_READ_TEXT 55 | #define PNG_NO_READ_tIME 56 | #define PNG_NO_READ_UNKNOWN_CHUNKS 57 | #define PNG_NO_READ_USER_CHUNKS 58 | #define PNG_NO_READ_EMPTY_PLTE 59 | #define PNG_NO_READ_OPT_PLTE 60 | #define PNG_NO_READ_STRIP_ALPHA 61 | #define PNG_NO_READ_oFFs 62 | #define PNG_NO_WARN_UNINITIALIZED_ROW 63 | 64 | #define PNG_NO_WRITE_SUPPORTED 65 | 66 | #define PNG_NO_INFO_IMAGE 67 | #define PNG_NO_USER_MEM 68 | #define PNG_NO_FIXED_POINT_SUPPORTED 69 | #define PNG_NO_MNG_FEATURES 70 | #define PNG_NO_USER_TRANSFORM_PTR 71 | #define PNG_NO_HANDLE_AS_UNKNOWN 72 | #define PNG_NO_CONSOLE_IO 73 | #define PNG_NO_ZALLOC_ZERO 74 | #define PNG_NO_ERROR_NUMBERS 75 | #define PNG_NO_EASY_ACCESS 76 | #define PNG_NO_PROGRESSIVE_READ 77 | 78 | #endif /* MINRDPNGCONF_H */ 79 | -------------------------------------------------------------------------------- /libpng/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 | -------------------------------------------------------------------------------- /zlib/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 | -------------------------------------------------------------------------------- /utils/ZipUtils.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 | // Miscellaneous zip/gzip utility functions. 19 | // 20 | #ifndef __LIBS_ZIPUTILS_H 21 | #define __LIBS_ZIPUTILS_H 22 | 23 | #include 24 | 25 | namespace android { 26 | 27 | /* 28 | * Container class for utility functions, primarily for namespace reasons. 29 | */ 30 | class ZipUtils { 31 | public: 32 | /* 33 | * General utility function for uncompressing "deflate" data from a file 34 | * to a buffer. 35 | */ 36 | static bool inflateToBuffer(int fd, void* buf, long uncompressedLen, 37 | long compressedLen); 38 | static bool inflateToBuffer(FILE* fp, void* buf, long uncompressedLen, 39 | long compressedLen); 40 | 41 | /* 42 | * Someday we might want to make this generic and handle bzip2 ".bz2" 43 | * files too. 44 | * 45 | * We could declare gzip to be a sub-class of zip that has exactly 46 | * one always-compressed entry, but we currently want to treat Zip 47 | * and gzip as distinct, so there's no value. 48 | * 49 | * The zlib library has some gzip utilities, but it has no interface 50 | * for extracting the uncompressed length of the file (you do *not* 51 | * want to gzseek to the end). 52 | * 53 | * Pass in a seeked file pointer for the gzip file. If this is a gzip 54 | * file, we set our return values appropriately and return "true" with 55 | * the file seeked to the start of the compressed data. 56 | */ 57 | static bool examineGzip(FILE* fp, int* pCompressionMethod, 58 | long* pUncompressedLen, long* pCompressedLen, unsigned long* pCRC32); 59 | 60 | private: 61 | ZipUtils() {} 62 | ~ZipUtils() {} 63 | }; 64 | 65 | }; // namespace android 66 | 67 | #endif /*__LIBS_ZIPUTILS_H*/ 68 | -------------------------------------------------------------------------------- /utils-cpp/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 "fakeLog.h" 25 | 26 | #include 27 | #include 28 | 29 | /*****************************************************************************/ 30 | 31 | namespace android { 32 | 33 | 34 | StopWatch::StopWatch(const char *name, int clock, uint32_t flags) 35 | : mName(name), mClock(clock), mFlags(flags) 36 | { 37 | reset(); 38 | } 39 | 40 | StopWatch::~StopWatch() 41 | { 42 | nsecs_t elapsed = elapsedTime(); 43 | const int n = mNumLaps; 44 | LOGD("StopWatch %s (us): %lld ", mName, ns2us(elapsed)); 45 | for (int i=0 ; i= 8) { 61 | elapsed = 0; 62 | } else { 63 | const int n = mNumLaps; 64 | mLaps[n].soFar = elapsed; 65 | mLaps[n].thisLap = n ? (elapsed - mLaps[n-1].soFar) : elapsed; 66 | mNumLaps = n+1; 67 | } 68 | return elapsed; 69 | } 70 | 71 | nsecs_t StopWatch::elapsedTime() const 72 | { 73 | return systemTime(mClock) - mStartTime; 74 | } 75 | 76 | void StopWatch::reset() 77 | { 78 | mNumLaps = 0; 79 | mStartTime = systemTime(mClock); 80 | } 81 | 82 | 83 | /*****************************************************************************/ 84 | 85 | }; // namespace android 86 | 87 | -------------------------------------------------------------------------------- /libpng/projects/visualc6/README.txt: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Project File, Format Version 6.00 for libpng. 2 | 3 | Copyright (C) 2000-2004 Simon-Pierre Cadieux. 4 | Copyright (C) 2004 Cosmin Truta. 5 | For conditions of distribution and use, see copyright notice in png.h 6 | 7 | 8 | Assumptions: 9 | * The libpng source files are in ..\.. 10 | * The zlib source files are in ..\..\..\zlib 11 | * The zlib project files are in ..\..\..\zlib\projects\visualc6 12 | 13 | 14 | To use: 15 | 16 | 1) On the main menu, select "File | Open Workspace". 17 | Open "libpng.dsw". 18 | 19 | 2) Select "Build | Set Active Configuration". 20 | Choose the configuration you wish to build. 21 | (Choose libpng or pngtest; zlib will be built automatically.) 22 | 23 | 3) Select "Build | Clean". 24 | 25 | 4) Select "Build | Build ... (F7)". Ignore warning messages about 26 | not being able to find certain include files (e.g. alloc.h). 27 | 28 | 5) If you built the sample program (pngtest), 29 | select "Build | Execute ... (Ctrl+F5)". 30 | 31 | 32 | This project builds the libpng binaries as follows: 33 | 34 | * Win32_DLL_Release\libpng13.dll DLL build 35 | * Win32_DLL_Debug\libpng13d.dll DLL build (debug version) 36 | * Win32_DLL_ASM_Release\libpng13.dll DLL build using ASM code 37 | * Win32_DLL_ASM_Debug\libpng13d.dll DLL build using ASM (debug version) 38 | * Win32_DLL_VB\libpng13vb.dll DLL build for Visual Basic, using stdcall 39 | * Win32_LIB_Release\libpng.lib static build 40 | * Win32_LIB_Debug\libpngd.lib static build (debug version) 41 | * Win32_LIB_ASM_Release\libpng.lib static build using ASM code 42 | * Win32_LIB_ASM_Debug\libpngd.lib static build using ASM (debug version) 43 | 44 | 45 | Notes: 46 | 47 | If you change anything in the source files, or select different compiler 48 | settings, please change the DLL name to something different than any of 49 | the above names. Also, make sure that in your "pngusr.h" you define 50 | PNG_USER_PRIVATEBUILD and PNG_USER_DLLFNAME_POSTFIX according to the 51 | instructions provided in "pngconf.h". 52 | 53 | All DLLs built by this project use the Microsoft dynamic C runtime library 54 | MSVCRT.DLL (MSVCRTD.DLL for debug versions). If you distribute any of the 55 | above mentioned libraries you should also include this DLL in your package. 56 | For a list of files that are redistributable in Visual C++ 6.0, see 57 | Common\Redist\Redist.txt on Disc 1 of the Visual C++ 6.0 product CDs. 58 | -------------------------------------------------------------------------------- /utils/Debug.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_DEBUG_H 18 | #define ANDROID_DEBUG_H 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | // --------------------------------------------------------------------------- 25 | 26 | #ifdef __cplusplus 27 | template struct CompileTimeAssert; 28 | template<> struct CompileTimeAssert {}; 29 | #define COMPILE_TIME_ASSERT(_exp) \ 30 | template class CompileTimeAssert< (_exp) >; 31 | #endif 32 | #define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ 33 | CompileTimeAssert<( _exp )>(); 34 | 35 | // --------------------------------------------------------------------------- 36 | 37 | #ifdef __cplusplus 38 | template struct CompileTimeIfElse; 39 | template 40 | struct CompileTimeIfElse { typedef LHS TYPE; }; 41 | template 42 | struct CompileTimeIfElse { typedef RHS TYPE; }; 43 | #endif 44 | 45 | // --------------------------------------------------------------------------- 46 | 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | const char* stringForIndent(int32_t indentLevel); 52 | 53 | typedef void (*debugPrintFunc)(void* cookie, const char* txt); 54 | 55 | void printTypeCode(uint32_t typeCode, 56 | debugPrintFunc func = 0, void* cookie = 0); 57 | 58 | void printHexData(int32_t indent, const void *buf, size_t length, 59 | size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16, 60 | size_t alignment=0, bool cArrayStyle=false, 61 | debugPrintFunc func = 0, void* cookie = 0); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | // --------------------------------------------------------------------------- 68 | }; // namespace android 69 | 70 | #endif // ANDROID_DEBUG_H 71 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.tc3: -------------------------------------------------------------------------------- 1 | # Makefile for libpng 2 | # TurboC/C++ (Note: All modules are compiled in C mode) 3 | 4 | # To use, do "make -fmakefile.tc3" 5 | 6 | # ----- Turbo C 3.00 (can be modified to work with earlier versions) ----- 7 | 8 | MODEL=l 9 | CFLAGS=-O2 -Z -m$(MODEL) -I..\zlib 10 | #CFLAGS=-D_NO_PROTO -O2 -Z -m$(MODEL) -I..\zlib # Turbo C older than 3.00 11 | CC=tcc 12 | LD=tcc 13 | LIB=tlib 14 | LDFLAGS=-m$(MODEL) -L..\zlib 15 | O=.obj 16 | E=.exe 17 | 18 | # variables 19 | OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) 20 | OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) 21 | OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) 22 | OBJSL1 = +png$(O) +pngset$(O) +pngget$(O) +pngrutil$(O) +pngtrans$(O) 23 | OBJSL2 = +pngwutil$(O) +pngmem$(O) +pngpread$(O) +pngread$(O) +pngerror$(O) 24 | OBJSL3 = +pngwrite$(O) +pngrtran$(O) +pngwtran$(O) +pngrio$(O) +pngwio$(O) 25 | 26 | all: libpng$(MODEL).lib pngtest$(E) 27 | 28 | pngtest: pngtest$(E) 29 | 30 | test: pngtest$(E) 31 | pngtest$(E) 32 | 33 | png$(O): png.h pngconf.h 34 | $(CC) -c $(CFLAGS) $*.c 35 | 36 | pngset$(O): png.h pngconf.h 37 | $(CC) -c $(CFLAGS) $*.c 38 | 39 | pngget$(O): png.h pngconf.h 40 | $(CC) -c $(CFLAGS) $*.c 41 | 42 | pngread$(O): png.h pngconf.h 43 | $(CC) -c $(CFLAGS) $*.c 44 | 45 | pngpread$(O): png.h pngconf.h 46 | $(CC) -c $(CFLAGS) $*.c 47 | 48 | pngrtran$(O): png.h pngconf.h 49 | $(CC) -c $(CFLAGS) $*.c 50 | 51 | pngrutil$(O): png.h pngconf.h 52 | $(CC) -c $(CFLAGS) $*.c 53 | 54 | pngerror$(O): png.h pngconf.h 55 | $(CC) -c $(CFLAGS) $*.c 56 | 57 | pngmem$(O): png.h pngconf.h 58 | $(CC) -c $(CFLAGS) $*.c 59 | 60 | pngrio$(O): png.h pngconf.h 61 | $(CC) -c $(CFLAGS) $*.c 62 | 63 | pngwio$(O): png.h pngconf.h 64 | $(CC) -c $(CFLAGS) $*.c 65 | 66 | pngtest$(O): png.h pngconf.h 67 | $(CC) -c $(CFLAGS) $*.c 68 | 69 | pngtrans$(O): png.h pngconf.h 70 | $(CC) -c $(CFLAGS) $*.c 71 | 72 | pngwrite$(O): png.h pngconf.h 73 | $(CC) -c $(CFLAGS) $*.c 74 | 75 | pngwtran$(O): png.h pngconf.h 76 | $(CC) -c $(CFLAGS) $*.c 77 | 78 | pngwutil$(O): png.h pngconf.h 79 | $(CC) -c $(CFLAGS) $*.c 80 | 81 | libpng$(MODEL).lib: $(OBJS1) $(OBJS2) $(OBJS3) 82 | $(LIB) libpng$(MODEL) +$(OBJSL1) 83 | $(LIB) libpng$(MODEL) +$(OBJSL2) 84 | $(LIB) libpng$(MODEL) +$(OBJSL3) 85 | 86 | pngtest$(E): pngtest$(O) libpng$(MODEL).lib 87 | $(LD) $(LDFLAGS) pngtest.obj libpng$(MODEL).lib zlib_$(MODEL).lib 88 | 89 | # End of makefile for libpng 90 | -------------------------------------------------------------------------------- /utils/ByteOrder.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 | 19 | #ifndef _LIBS_UTILS_BYTE_ORDER_H 20 | #define _LIBS_UTILS_BYTE_ORDER_H 21 | 22 | #include 23 | #include 24 | #ifdef HAVE_WINSOCK 25 | #include 26 | #else 27 | #include 28 | #endif 29 | 30 | /* 31 | * These macros are like the hton/ntoh byte swapping macros, 32 | * except they allow you to swap to and from the "device" byte 33 | * order. The device byte order is the endianness of the target 34 | * device -- for the ARM CPUs we use today, this is little endian. 35 | * 36 | * Note that the byte swapping functions have not been optimized 37 | * much; performance is currently not an issue for them since the 38 | * intent is to allow us to avoid byte swapping on the device. 39 | */ 40 | 41 | static inline uint32_t android_swap_long(uint32_t v) 42 | { 43 | return (v<<24) | ((v<<8)&0x00FF0000) | ((v>>8)&0x0000FF00) | (v>>24); 44 | } 45 | 46 | static inline uint16_t android_swap_short(uint16_t v) 47 | { 48 | return (v<<8) | (v>>8); 49 | } 50 | 51 | #define DEVICE_BYTE_ORDER LITTLE_ENDIAN 52 | 53 | #if BYTE_ORDER == DEVICE_BYTE_ORDER 54 | 55 | #define dtohl(x) (x) 56 | #define dtohs(x) (x) 57 | #define htodl(x) (x) 58 | #define htods(x) (x) 59 | 60 | #else 61 | 62 | #define dtohl(x) (android_swap_long(x)) 63 | #define dtohs(x) (android_swap_short(x)) 64 | #define htodl(x) (android_swap_long(x)) 65 | #define htods(x) (android_swap_short(x)) 66 | 67 | #endif 68 | 69 | #if BYTE_ORDER == LITTLE_ENDIAN 70 | #define fromlel(x) (x) 71 | #define fromles(x) (x) 72 | #define tolel(x) (x) 73 | #define toles(x) (x) 74 | #else 75 | #define fromlel(x) (android_swap_long(x)) 76 | #define fromles(x) (android_swap_short(x)) 77 | #define tolel(x) (android_swap_long(x)) 78 | #define toles(x) (android_swap_short(x)) 79 | #endif 80 | 81 | #endif // _LIBS_UTILS_BYTE_ORDER_H 82 | -------------------------------------------------------------------------------- /libpng/Y2KINFO: -------------------------------------------------------------------------------- 1 | Y2K compliance in libpng: 2 | ========================= 3 | 4 | July 9, 2011 5 | 6 | Since the PNG Development group is an ad-hoc body, we can't make 7 | an official declaration. 8 | 9 | This is your unofficial assurance that libpng from version 0.71 and 10 | upward through 1.2.46 are Y2K compliant. It is my belief that earlier 11 | versions were also Y2K compliant. 12 | 13 | Libpng only has three year fields. One is a 2-byte unsigned integer 14 | that will hold years up to 65535. The other two hold the date in text 15 | format, and will hold years up to 9999. 16 | 17 | The integer is 18 | "png_uint_16 year" in png_time_struct. 19 | 20 | The strings are 21 | "png_charp time_buffer" in png_struct and 22 | "near_time_buffer", which is a local character string in png.c. 23 | 24 | There are seven time-related functions: 25 | 26 | png_convert_to_rfc_1123() in png.c 27 | (formerly png_convert_to_rfc_1152() in error) 28 | png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c 29 | png_convert_from_time_t() in pngwrite.c 30 | png_get_tIME() in pngget.c 31 | png_handle_tIME() in pngrutil.c, called in pngread.c 32 | png_set_tIME() in pngset.c 33 | png_write_tIME() in pngwutil.c, called in pngwrite.c 34 | 35 | All appear to handle dates properly in a Y2K environment. The 36 | png_convert_from_time_t() function calls gmtime() to convert from system 37 | clock time, which returns (year - 1900), which we properly convert to 38 | the full 4-digit year. There is a possibility that applications using 39 | libpng are not passing 4-digit years into the png_convert_to_rfc_1123() 40 | function, or that they are incorrectly passing only a 2-digit year 41 | instead of "year - 1900" into the png_convert_from_struct_tm() function, 42 | but this is not under our control. The libpng documentation has always 43 | stated that it works with 4-digit years, and the APIs have been 44 | documented as such. 45 | 46 | The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned 47 | integer to hold the year, and can hold years as large as 65535. 48 | 49 | zlib, upon which libpng depends, is also Y2K compliant. It contains 50 | no date-related code. 51 | 52 | 53 | Glenn Randers-Pehrson 54 | libpng maintainer 55 | PNG Development Group 56 | -------------------------------------------------------------------------------- /libpng/contrib/gregbook/LICENSE: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------- 2 | 3 | Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. 4 | 5 | This software is provided "as is," without warranty of any kind, 6 | express or implied. In no event shall the author or contributors 7 | be held liable for any damages arising in any way from the use of 8 | this software. 9 | 10 | The contents of this file are DUAL-LICENSED. You may modify and/or 11 | redistribute this software according to the terms of one of the 12 | following two licenses (at your option): 13 | 14 | 15 | LICENSE 1 ("BSD-like with advertising clause"): 16 | 17 | Permission is granted to anyone to use this software for any purpose, 18 | including commercial applications, and to alter it and redistribute 19 | it freely, subject to the following restrictions: 20 | 21 | 1. Redistributions of source code must retain the above copyright 22 | notice, disclaimer, and this list of conditions. 23 | 2. Redistributions in binary form must reproduce the above copyright 24 | notice, disclaimer, and this list of conditions in the documenta- 25 | tion and/or other materials provided with the distribution. 26 | 3. All advertising materials mentioning features or use of this 27 | software must display the following acknowledgment: 28 | 29 | This product includes software developed by Greg Roelofs 30 | and contributors for the book, "PNG: The Definitive Guide," 31 | published by O'Reilly and Associates. 32 | 33 | 34 | LICENSE 2 (GNU GPL v2 or later): 35 | 36 | This program is free software; you can redistribute it and/or modify 37 | it under the terms of the GNU General Public License as published by 38 | the Free Software Foundation; either version 2 of the License, or 39 | (at your option) any later version. 40 | 41 | This program is distributed in the hope that it will be useful, 42 | but WITHOUT ANY WARRANTY; without even the implied warranty of 43 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 44 | GNU General Public License for more details. 45 | 46 | You should have received a copy of the GNU General Public License 47 | along with this program; if not, write to the Free Software Foundation, 48 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 49 | 50 | --------------------------------------------------------------------------- 51 | -------------------------------------------------------------------------------- /utils/Singleton.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_UTILS_SINGLETON_H 18 | #define ANDROID_UTILS_SINGLETON_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace android { 25 | // --------------------------------------------------------------------------- 26 | 27 | template 28 | class Singleton 29 | { 30 | public: 31 | static TYPE& getInstance() { 32 | Mutex::Autolock _l(sLock); 33 | TYPE* instance = sInstance; 34 | if (instance == 0) { 35 | instance = new TYPE(); 36 | sInstance = instance; 37 | } 38 | return *instance; 39 | } 40 | 41 | static bool hasInstance() { 42 | Mutex::Autolock _l(sLock); 43 | return sInstance != 0; 44 | } 45 | 46 | protected: 47 | ~Singleton() { }; 48 | Singleton() { }; 49 | 50 | private: 51 | Singleton(const Singleton&); 52 | Singleton& operator = (const Singleton&); 53 | static Mutex sLock; 54 | static TYPE* sInstance; 55 | }; 56 | 57 | /* 58 | * use ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) in your implementation file 59 | * (eg: .cpp) to create the static instance of Singleton<>'s attributes, 60 | * and avoid to have a copy of them in each compilation units Singleton 61 | * is used. 62 | * NOTE: we use a version of Mutex ctor that takes a parameter, because 63 | * for some unknown reason using the default ctor doesn't emit the variable! 64 | */ 65 | 66 | #define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \ 67 | template class Singleton< TYPE >; \ 68 | template<> Mutex Singleton< TYPE >::sLock(Mutex::PRIVATE); \ 69 | template<> TYPE* Singleton< TYPE >::sInstance(0); 70 | 71 | 72 | // --------------------------------------------------------------------------- 73 | }; // namespace android 74 | 75 | #endif // ANDROID_UTILS_SINGLETON_H 76 | 77 | -------------------------------------------------------------------------------- /libpng/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the `m' library (-lm). */ 10 | #undef HAVE_LIBM 11 | 12 | /* Define to 1 if you have the `z' library (-lz). */ 13 | #undef HAVE_LIBZ 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_MALLOC_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_MEMORY_H 20 | 21 | /* Define to 1 if you have the `memset' function. */ 22 | #undef HAVE_MEMSET 23 | 24 | /* Define to 1 if you have the `pow' function. */ 25 | #undef HAVE_POW 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STDINT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STDLIB_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_STRINGS_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_STRING_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_SYS_STAT_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_SYS_TYPES_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_UNISTD_H 47 | 48 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 49 | */ 50 | #undef LT_OBJDIR 51 | 52 | /* Name of package */ 53 | #undef PACKAGE 54 | 55 | /* Define to the address where bug reports for this package should be sent. */ 56 | #undef PACKAGE_BUGREPORT 57 | 58 | /* Define to the full name of this package. */ 59 | #undef PACKAGE_NAME 60 | 61 | /* Define to the full name and version of this package. */ 62 | #undef PACKAGE_STRING 63 | 64 | /* Define to the one symbol short name of this package. */ 65 | #undef PACKAGE_TARNAME 66 | 67 | /* Define to the home page for this package. */ 68 | #undef PACKAGE_URL 69 | 70 | /* Define to the version of this package. */ 71 | #undef PACKAGE_VERSION 72 | 73 | /* Define to 1 if you have the ANSI C header files. */ 74 | #undef STDC_HEADERS 75 | 76 | /* Define to 1 if your declares `struct tm'. */ 77 | #undef TM_IN_SYS_TIME 78 | 79 | /* Version number of package */ 80 | #undef VERSION 81 | 82 | /* Define to empty if `const' does not conform to ANSI C. */ 83 | #undef const 84 | 85 | /* Define to `unsigned int' if does not define. */ 86 | #undef size_t 87 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.msc: -------------------------------------------------------------------------------- 1 | # makefile for libpng 2 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. 3 | # Copyright (C) 2006, 2009 Glenn Randers-Pehrson 4 | # 5 | # This code is released under the libpng license. 6 | # For conditions of distribution and use, see the disclaimer 7 | # and license in png.h 8 | # 9 | # Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib 10 | 11 | # -------- Microsoft C 5.1 and later, does not use assembler code -------- 12 | MODEL=L 13 | CFLAGS=-Oait -Gs -nologo -W3 -A$(MODEL) -I..\zlib 14 | #-Ox generates bad code with MSC 5.1 15 | CC=cl 16 | LD=link 17 | LDFLAGS=/e/st:0x1500/noe 18 | O=.obj 19 | 20 | #uncomment next to put error messages in a file 21 | ERRFILE= >> pngerrs 22 | 23 | # variables 24 | OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) 25 | OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) 26 | OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) 27 | 28 | all: libpng.lib 29 | 30 | png$(O): png.h pngconf.h 31 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 32 | 33 | pngset$(O): png.h pngconf.h 34 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 35 | 36 | pngget$(O): png.h pngconf.h 37 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 38 | 39 | pngread$(O): png.h pngconf.h 40 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 41 | 42 | pngpread$(O): png.h pngconf.h 43 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 44 | 45 | pngrtran$(O): png.h pngconf.h 46 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 47 | 48 | pngrutil$(O): png.h pngconf.h 49 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 50 | 51 | pngerror$(O): png.h pngconf.h 52 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 53 | 54 | pngmem$(O): png.h pngconf.h 55 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 56 | 57 | pngrio$(O): png.h pngconf.h 58 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 59 | 60 | pngwio$(O): png.h pngconf.h 61 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 62 | 63 | pngtrans$(O): png.h pngconf.h 64 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 65 | 66 | pngwrite$(O): png.h pngconf.h 67 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 68 | 69 | pngwtran$(O): png.h pngconf.h 70 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 71 | 72 | pngwutil$(O): png.h pngconf.h 73 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 74 | 75 | libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3) 76 | del libpng.lib 77 | lib libpng $(OBJS1); 78 | lib libpng $(OBJS2); 79 | lib libpng $(OBJS3); 80 | 81 | pngtest$(O): png.h pngconf.h 82 | $(CC) -c $(CFLAGS) $*.c $(ERRFILE) 83 | 84 | pngtest.exe: pngtest.obj libpng.lib 85 | $(LD) $(LDFLAGS) pngtest.obj,,,libpng.lib ..\zlib\zlib.lib ; 86 | 87 | test: pngtest.exe 88 | pngtest 89 | 90 | # End of makefile for libpng 91 | 92 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.openbsd: -------------------------------------------------------------------------------- 1 | # makefile for libpng 2 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. 3 | # Copyright (C) 2007-2009 Glenn Randers-Pehrson 4 | # 5 | # This code is released under the libpng license. 6 | # For conditions of distribution and use, see the disclaimer 7 | # and license in png.h 8 | 9 | PREFIX?= /usr/local 10 | LIBDIR= ${PREFIX}/lib 11 | MANDIR= ${PREFIX}/man/cat 12 | 13 | SHLIB_MAJOR= 0 14 | SHLIB_MINOR= 1.2.46 15 | 16 | LIB= png 17 | SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ 18 | pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \ 19 | pngwio.c pngwrite.c pngwtran.c pngwutil.c 20 | 21 | HDRS= png.h pngconf.h 22 | 23 | CFLAGS+= -W -Wall 24 | CPPFLAGS+= -I${.CURDIR} -DPNG_NO_MMX_CODE 25 | 26 | NOPROFILE= Yes 27 | 28 | CLEANFILES+= pngtest.o pngtest 29 | 30 | MAN= libpng.3 libpngpf.3 png.5 31 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO libpng.txt 32 | 33 | pngtest.o: pngtest.c 34 | ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} 35 | 36 | pngtest: pngtest.o 37 | ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm 38 | 39 | test: pngtest 40 | cd ${.OBJDIR} && env \ 41 | LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest 42 | 43 | beforeinstall: 44 | if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \ 45 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include; \ 46 | fi 47 | if [ ! -d ${DESTDIR}${LIBDIR} ]; then \ 48 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \ 49 | fi 50 | if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \ 51 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \ 52 | fi 53 | if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \ 54 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \ 55 | fi 56 | if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \ 57 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \ 58 | fi 59 | if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \ 60 | ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \ 61 | fi 62 | 63 | afterinstall: 64 | @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a 65 | @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a 66 | @rm -f ${DESTDIR}${PREFIX}/include/png.h 67 | @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h 68 | @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true 69 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ 70 | -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include 71 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ 72 | -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include 73 | ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ 74 | -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png 75 | 76 | .include 77 | -------------------------------------------------------------------------------- /libpng/projects/visualc71/README.txt: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Project File, Format Version 7.10 for libpng. 2 | 3 | Copyright (C) 2004 Simon-Pierre Cadieux. 4 | For conditions of distribution and use, see copyright notice in png.h 5 | 6 | Assumptions: 7 | * The libpng source files are in ..\.. 8 | * The zlib source files are in ..\..\..\zlib 9 | * The zlib project file is in . /* Warning: This is until the zlib project 10 | files get intergrated into the next zlib release. The final zlib project 11 | directory will then be ..\..\..\zlib\projects\visualc71. */ 12 | 13 | To use: 14 | 15 | 1) On the main menu, select "File | Open Solution". 16 | Open "libpng.sln". 17 | 18 | 2) Display the Solution Explorer view (Ctrl+Alt+L) 19 | 20 | 3) Set one of the project as the StartUp project. If you just want to build the 21 | binaries set "libpng" as the startup project (Select "libpng" tree view 22 | item + Project | Set as StartUp project). If you want to build and test the 23 | binaries set it to "pngtest" (Select "pngtest" tree view item + 24 | Project | Set as StartUp project) 25 | 26 | 4) Select "Build | Configuration Manager...". 27 | Choose the configuration you wish to build. 28 | 29 | 5) Select "Build | Clean Solution". 30 | 31 | 6) Select "Build | Build Solution (Ctrl-Shift-B)" 32 | 33 | This project builds the libpng binaries as follows: 34 | 35 | * Win32_DLL_Release\libpng13.dll DLL build 36 | * Win32_DLL_Debug\libpng13d.dll DLL build (debug version) 37 | * Win32_DLL_ASM_Release\libpng13.dll DLL build using ASM code 38 | * Win32_DLL_ASM_Debug\libpng13d.dll DLL build using ASM (debug version) 39 | * Win32_DLL_VB\libpng13vb.dll DLL build for Visual Basic, using stdcall 40 | * Win32_LIB_Release\libpng.lib static build 41 | * Win32_LIB_Debug\libpngd.lib static build (debug version) 42 | * Win32_LIB_ASM_Release\libpng.lib static build using ASM code 43 | * Win32_LIB_ASM_Debug\libpngd.lib static build using ASM (debug version) 44 | 45 | Notes: 46 | 47 | If you change anything in the source files, or select different compiler 48 | settings, please change the DLL name to something different than any of 49 | the above names. Also, make sure that in your "pngusr.h" you define 50 | PNG_USER_PRIVATEBUILD and PNG_USER_DLLFNAME_POSTFIX according to the 51 | instructions provided in "pngconf.h". 52 | 53 | All DLLs built by this project use the Microsoft dynamic C runtime library 54 | MSVCR71.DLL (MSVCR71D.DLL for debug versions). If you distribute any of the 55 | above mentioned libraries you may have to include this DLL in your package. 56 | For a list of files that are redistributable in Visual Studio see 57 | $(VCINSTALLDIR)\redist.txt. 58 | -------------------------------------------------------------------------------- /libpng/scripts/makefile.mips: -------------------------------------------------------------------------------- 1 | # makefile for libpng 2 | # Copyright (C) Glenn Randers-Pehrson 3 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. 4 | # 5 | # This code is released under the libpng license. 6 | # For conditions of distribution and use, see the disclaimer 7 | # and license in png.h 8 | 9 | # where make install puts libpng.a and png.h 10 | prefix=/usr/local 11 | INCPATH=$(prefix)/include 12 | LIBPATH=$(prefix)/lib 13 | 14 | # override DESTDIR= on the make install command line to easily support 15 | # installing into a temporary location. Example: 16 | # 17 | # make install DESTDIR=/tmp/build/libpng 18 | # 19 | # If you're going to install into a temporary location 20 | # via DESTDIR, $(DESTDIR)$(prefix) must already exist before 21 | # you execute make install. 22 | DESTDIR= 23 | 24 | CC=cc 25 | CFLAGS=-I../zlib -O -systype sysv -DSYSV -w -Dmips 26 | #CFLAGS=-O 27 | LDFLAGS=-L. -L../zlib/ -lpng -lz -lm 28 | 29 | #RANLIB=ranlib 30 | RANLIB=echo 31 | 32 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ 33 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ 34 | pngwtran.o pngmem.o pngerror.o pngpread.o 35 | 36 | all: libpng.a pngtest 37 | 38 | libpng.a: $(OBJS) 39 | ar rc $@ $(OBJS) 40 | $(RANLIB) $@ 41 | 42 | pngtest: pngtest.o libpng.a 43 | $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) 44 | 45 | test: pngtest 46 | ./pngtest 47 | 48 | install: libpng.a 49 | -@mkdir $(DESTDIR)$(INCPATH) 50 | -@mkdir $(DESTDIR)$(INCPATH)/libpng 51 | -@mkdir $(DESTDIR)$(LIBPATH) 52 | -@rm -f $(DESTDIR)$(INCPATH)/png.h 53 | -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h 54 | cp png.h $(DESTDIR)$(INCPATH)/libpng 55 | cp pngconf.h $(DESTDIR)$(INCPATH)/libpng 56 | chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h 57 | chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h 58 | (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) 59 | cp libpng.a $(DESTDIR)$(LIBPATH) 60 | chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a 61 | 62 | clean: 63 | rm -f *.o libpng.a pngtest pngout.png 64 | 65 | DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO 66 | writelock: 67 | chmod a-w *.[ch35] $(DOCS) scripts/* 68 | 69 | # DO NOT DELETE THIS LINE -- make depend depends on it. 70 | 71 | png.o: png.h pngconf.h 72 | pngerror.o: png.h pngconf.h 73 | pngrio.o: png.h pngconf.h 74 | pngwio.o: png.h pngconf.h 75 | pngmem.o: png.h pngconf.h 76 | pngset.o: png.h pngconf.h 77 | pngget.o: png.h pngconf.h 78 | pngread.o: png.h pngconf.h 79 | pngpread.o: png.h pngconf.h 80 | pngrtran.o: png.h pngconf.h 81 | pngrutil.o: png.h pngconf.h 82 | pngtrans.o: png.h pngconf.h 83 | pngwrite.o: png.h pngconf.h 84 | pngwtran.o: png.h pngconf.h 85 | pngwutil.o: png.h pngconf.h 86 | 87 | pngtest.o: png.h pngconf.h 88 | -------------------------------------------------------------------------------- /libpng/png.5: -------------------------------------------------------------------------------- 1 | .TH PNG 5 "July 9, 2011" 2 | .SH NAME 3 | png \- Portable Network Graphics (PNG) format 4 | .SH DESCRIPTION 5 | PNG (Portable Network Graphics) is an extensible file format for the 6 | lossless, portable, well-compressed storage of raster images. PNG provides 7 | a patent-free replacement for GIF and can also replace many 8 | common uses of TIFF. Indexed-color, grayscale, and truecolor images are 9 | supported, plus an optional alpha channel. Sample depths range from 10 | 1 to 16 bits. 11 | .br 12 | 13 | PNG is designed to work well in online viewing applications, such as the 14 | World Wide Web, so it is fully streamable with a progressive display 15 | option. PNG is robust, providing both full file integrity checking and 16 | fast, simple detection of common transmission errors. Also, PNG can store 17 | gamma and chromaticity data for improved color matching on heterogeneous 18 | platforms. 19 | 20 | .SH "SEE ALSO" 21 | .IR libpng(3) ", " zlib(3) ", " deflate(5) ", and " zlib(5) 22 | .LP 23 | PNG specification (second edition), November 2003: 24 | .IP 25 | .br 26 | lock_init) { 65 | store->lock_init = -1; 66 | InitializeCriticalSection( &store->lock ); 67 | store->lock_init = -2; 68 | } else while (store->lock_init != -2) { 69 | Sleep(10); /* 10ms */ 70 | } 71 | 72 | EnterCriticalSection( &store->lock ); 73 | if (!store->has_tls) { 74 | store->tls = TlsAlloc(); 75 | if (store->tls == TLS_OUT_OF_INDEXES) { 76 | LeaveCriticalSection( &store->lock ); 77 | return; 78 | } 79 | store->has_tls = 1; 80 | } 81 | LeaveCriticalSection( &store->lock ); 82 | 83 | TlsSetValue( store->tls, value ); 84 | } 85 | #endif 86 | -------------------------------------------------------------------------------- /utils-cpp/Static.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 | // All static variables go here, to control initialization and 18 | // destruction order in the library. 19 | 20 | #include 21 | 22 | #include 23 | //#include 24 | #include "fakeLog.h" 25 | 26 | #include 27 | #include 28 | 29 | namespace android { 30 | 31 | class LibUtilsFirstStatics 32 | { 33 | public: 34 | LibUtilsFirstStatics() 35 | { 36 | initialize_string8(); 37 | initialize_string16(); 38 | } 39 | 40 | ~LibUtilsFirstStatics() 41 | { 42 | terminate_string16(); 43 | terminate_string8(); 44 | } 45 | }; 46 | 47 | static LibUtilsFirstStatics gFirstStatics; 48 | int gDarwinCantLoadAllObjects = 1; 49 | 50 | // ------------ Text output streams 51 | 52 | Vector gTextBuffers; 53 | 54 | class LogTextOutput : public BufferedTextOutput 55 | { 56 | public: 57 | LogTextOutput() : BufferedTextOutput(MULTITHREADED) { } 58 | virtual ~LogTextOutput() { }; 59 | 60 | protected: 61 | virtual status_t writeLines(const struct iovec& vec, size_t N) 62 | { 63 | //android_writevLog(&vec, N); <-- this is now a no-op 64 | if (N != 1) LOGI("WARNING: writeLines N=%d\n", N); 65 | LOGI("%.*s", vec.iov_len, (const char*) vec.iov_base); 66 | return NO_ERROR; 67 | } 68 | }; 69 | 70 | class FdTextOutput : public BufferedTextOutput 71 | { 72 | public: 73 | FdTextOutput(int fd) : BufferedTextOutput(MULTITHREADED), mFD(fd) { } 74 | virtual ~FdTextOutput() { }; 75 | 76 | protected: 77 | virtual status_t writeLines(const struct iovec& vec, size_t N) 78 | { 79 | writev(mFD, &vec, N); 80 | return NO_ERROR; 81 | } 82 | 83 | private: 84 | int mFD; 85 | }; 86 | 87 | static LogTextOutput gLogTextOutput; 88 | static FdTextOutput gStdoutTextOutput(STDOUT_FILENO); 89 | static FdTextOutput gStderrTextOutput(STDERR_FILENO); 90 | 91 | TextOutput& alog(gLogTextOutput); 92 | TextOutput& aout(gStdoutTextOutput); 93 | TextOutput& aerr(gStderrTextOutput); 94 | 95 | } // namespace android 96 | -------------------------------------------------------------------------------- /utils/Errors.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_ERRORS_H 18 | #define ANDROID_ERRORS_H 19 | 20 | #include 21 | #include 22 | 23 | namespace android { 24 | 25 | // use this type to return error codes 26 | #ifdef HAVE_MS_C_RUNTIME 27 | typedef int status_t; 28 | #else 29 | typedef int32_t status_t; 30 | #endif 31 | 32 | /* the MS C runtime lacks a few error codes */ 33 | 34 | /* 35 | * Error codes. 36 | * All error codes are negative values. 37 | */ 38 | 39 | // Win32 #defines NO_ERROR as well. It has the same value, so there's no 40 | // real conflict, though it's a bit awkward. 41 | #ifdef _WIN32 42 | # undef NO_ERROR 43 | #endif 44 | 45 | enum { 46 | OK = 0, // Everything's swell. 47 | NO_ERROR = 0, // No errors. 48 | 49 | UNKNOWN_ERROR = 0x80000000, 50 | 51 | NO_MEMORY = -ENOMEM, 52 | INVALID_OPERATION = -ENOSYS, 53 | BAD_VALUE = -EINVAL, 54 | BAD_TYPE = 0x80000001, 55 | NAME_NOT_FOUND = -ENOENT, 56 | PERMISSION_DENIED = -EPERM, 57 | NO_INIT = -ENODEV, 58 | ALREADY_EXISTS = -EEXIST, 59 | DEAD_OBJECT = -EPIPE, 60 | FAILED_TRANSACTION = 0x80000002, 61 | JPARKS_BROKE_IT = -EPIPE, 62 | #if !defined(HAVE_MS_C_RUNTIME) 63 | BAD_INDEX = -EOVERFLOW, 64 | NOT_ENOUGH_DATA = -ENODATA, 65 | WOULD_BLOCK = -EWOULDBLOCK, 66 | TIMED_OUT = -ETIMEDOUT, 67 | UNKNOWN_TRANSACTION = -EBADMSG, 68 | #else 69 | BAD_INDEX = -E2BIG, 70 | NOT_ENOUGH_DATA = 0x80000003, 71 | WOULD_BLOCK = 0x80000004, 72 | TIMED_OUT = 0x80000005, 73 | UNKNOWN_TRANSACTION = 0x80000006, 74 | #endif 75 | FDS_NOT_ALLOWED = 0x80000007, 76 | }; 77 | 78 | // Restore define; enumeration is in "android" namespace, so the value defined 79 | // there won't work for Win32 code in a different namespace. 80 | #ifdef _WIN32 81 | # define NO_ERROR 0L 82 | #endif 83 | 84 | }; // namespace android 85 | 86 | // --------------------------------------------------------------------------- 87 | 88 | #endif // ANDROID_ERRORS_H 89 | --------------------------------------------------------------------------------